You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2013/07/02 16:28:46 UTC
svn commit: r1498954 - in /httpcomponents/project-release-tools/trunk:
.gitignore build.gradle
Author: olegk
Date: Tue Jul 2 14:28:45 2013
New Revision: 1498954
URL: http://svn.apache.org/r1498954
Log:
Avoid SVN update on published release locations (meant to be immutable)
Modified:
httpcomponents/project-release-tools/trunk/.gitignore
httpcomponents/project-release-tools/trunk/build.gradle
Modified: httpcomponents/project-release-tools/trunk/.gitignore
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/.gitignore?rev=1498954&r1=1498953&r2=1498954&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/.gitignore (original)
+++ httpcomponents/project-release-tools/trunk/.gitignore Tue Jul 2 14:28:45 2013
@@ -3,3 +3,4 @@ build
.gradle
.idea
*.iml
+gradle.properties
Modified: httpcomponents/project-release-tools/trunk/build.gradle
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/build.gradle?rev=1498954&r1=1498953&r2=1498954&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/build.gradle (original)
+++ httpcomponents/project-release-tools/trunk/build.gradle Tue Jul 2 14:28:45 2013
@@ -45,13 +45,13 @@ task siteInit() << {
throw InvalidUserDataException("HC_SITE_STAGING not set")
}
URI stagingURI = new URI(HC_SITE_STAGING)
- staging = loadFromRepositry(stagingURI)
+ staging = checkout(stagingURI)
if (!HC_PROJECT_SITE) {
throw InvalidUserDataException("HC_PROJECT_SITE not set")
}
URI websiteURI = new URI(HC_PROJECT_SITE)
- File websiteDir = loadFromRepositry(websiteURI)
+ File websiteDir = checkout(websiteURI)
Pom websitePom = mvn.parsePom(websiteDir)
logger.info("Website ${websitePom.artifactId}:${websitePom.version}")
website = new HCProject(pom: websitePom, localDir: websiteDir, repo: websiteURI)
@@ -61,7 +61,7 @@ task siteInit() << {
publishedReleases = []
for (URI uri: uris) {
- File releaseDir = loadFromRepositry(uri)
+ File releaseDir = checkout(uri)
Pom releasePom = mvn.parsePom(releaseDir)
logger.info("Published release ${releasePom.artifactId}:${releasePom.version}")
publishedReleases.add(new HCProject(pom: releasePom, localDir: releaseDir, repo: uri))
@@ -69,11 +69,14 @@ task siteInit() << {
}
task clean() << {
- GFileUtils.cleanDirectory(project.buildDir)
+ if (project.buildDir.exists()) {
+ GFileUtils.cleanDirectory(project.buildDir)
+ }
}
task siteGenerate(dependsOn: siteInit) << {
logger.info("Generating website content ${website.pom.artifactId}:${website.pom.version}")
+ Svn.update(website.localDir)
mvn.exec(website.localDir, 'clean', 'site')
for (HCProject release: publishedReleases) {
logger.info("Generating published release content ${release.pom.artifactId}:${release.pom.version}")
@@ -95,7 +98,7 @@ task site(dependsOn: [siteInit, siteGene
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-File loadFromRepositry(URI location) {
+File checkout(URI location) {
File dst
if (!location.absolute) {
dst = new File(location.toString())
@@ -108,13 +111,8 @@ File loadFromRepositry(URI location) {
l = l.substring(0, l.length() - 1)
}
dst = new File(buildDir, l.replace('/', '-'))
-
- if (dst.exists() && new File(dst, '.svn').exists()) {
- logger.info("Updating from repostiry ${location}")
- Svn.update(dst)
- } else {
+ if (!dst.exists()) {
dst.mkdirs()
- GFileUtils.cleanDirectory(dst)
logger.info("Checking out from repostiry ${location}")
Svn.checkout(location, dst)
}
@@ -153,7 +151,6 @@ void copyReleaseContent(HCProject hcProj
// Deal with crappy links generated by Maven Site Plugin
project.fileTree(dir: moduleDstDir, include: '*.html').each {
File f ->
- logger.info("Rewriting links in ${f}")
Html.rewriteLinks(f, { URI href ->
if (!href.isAbsolute()) {
def m1 = href.path =~ /^..(\/..\/scp:\/people.apache.org\/www)?\/hc.apache.org\//
@@ -168,7 +165,6 @@ void copyReleaseContent(HCProject hcProj
pom.modules.each { String submodule ->
project.fileTree(dir: new File(moduleDstDir, submodule), include: '*.html').each {
File f ->
- logger.info("Rewriting links in ${f}")
Html.rewriteLinks(f, { URI href ->
if (!href.isAbsolute()) {
def m1 = href.path =~ /^..\/..(\/..\/scp:\/people.apache.org\/www)?\/hc.apache.org\//
@@ -181,4 +177,4 @@ void copyReleaseContent(HCProject hcProj
}
}
-}
\ No newline at end of file
+}