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/08/02 13:42:07 UTC
svn commit: r1509642 -
/httpcomponents/project-release-tools/trunk/site.gradle
Author: olegk
Date: Fri Aug 2 11:42:07 2013
New Revision: 1509642
URL: http://svn.apache.org/r1509642
Log:
Fixed 'stage' taask; removed URL rewriting as no longer necessary
Modified:
httpcomponents/project-release-tools/trunk/site.gradle
Modified: httpcomponents/project-release-tools/trunk/site.gradle
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/site.gradle?rev=1509642&r1=1509641&r2=1509642&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/site.gradle (original)
+++ httpcomponents/project-release-tools/trunk/site.gradle Fri Aug 2 11:42:07 2013
@@ -49,67 +49,33 @@ task prepareStage(type: SvnGet) {
repo = new URI(HC_SITE_STAGING)
}
-task showStaged(type: SvnStatus) {
- repo = tasks.prepareStage.repo
+task showStaged(type: SvnStatus, dependsOn: prepareStage) {
+ repo = prepareStage.repo
}
-task stage << {
+task stage(dependsOn: prepareStage) << {
for (HCProject release: publishedReleases) {
String releaseSeries = "${release.pom.artifactId}-${release.pom.major}.${release.pom.minor}.x"
- def releaseStaging = "${staging}/${releaseSeries}"
- println("Coping content ${release.pom.artifactId}:${release.pom.version} to ${releaseStaging}")
+ def releaseStaging = "${prepareStage.localDir}/${releaseSeries}"
+ println("Copying content ${release.pom.artifactId}:${release.pom.version} to ${releaseStaging}")
copy {
- into "${staging}/${releaseSeries}"
+ into "${prepareStage.localDir}/${releaseSeries}"
with siteContent(release)
}
release.pom.modules.each { String submodule ->
copy {
- into "${staging}/${releaseSeries}/${submodule}"
+ into "${prepareStage.localDir}/${releaseSeries}/${submodule}"
with siteContent(file("${release.localDir}/${submodule}"))
}
}
- fixLinks(release, file("${staging}/${releaseSeries}"))
}
- println("Coping content ${website.pom.artifactId}:${website.pom.version} to ${staging}")
+ println("Copying content ${website.pom.artifactId}:${website.pom.version} to ${prepareStage.localDir}")
copy {
- into staging
+ into prepareStage.localDir
with siteContent(website)
}
}
-void fixLinks(HCProject hcProject, File dstDir) {
-
- // Deal with crappy links generated by Maven Site Plugin
- project.fileTree(dir: dstDir, include: '*.html').each {
- File f ->
- Html.rewriteLinks(f, { URI href ->
- if (!href.isAbsolute()) {
- def m1 = href.path =~ /^..(\/..\/scp:\/people.apache.org\/www)?\/hc.apache.org\//
- if (m1.find()) {
- return new URI(m1.replaceFirst('../'))
- }
- }
- return href
- })
- }
-
- hcProject.pom.modules.each { String submodule ->
- project.fileTree(dir: new File(dstDir, submodule), include: '*.html').each {
- File f ->
- Html.rewriteLinks(f, { URI href ->
- if (!href.isAbsolute()) {
- def m1 = href.path =~ /^..\/..(\/..\/scp:\/people.apache.org\/www)?\/hc.apache.org\//
- if (m1.find()) {
- return new URI(m1.replaceFirst('../../'))
- }
- }
- return href
- })
- }
- }
-
-}
-
CopySpec siteContent(File dir) {
copySpec {
from ("${dir}/target/site") {