Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ECAB8FF14 for ; Tue, 6 Aug 2013 12:08:15 +0000 (UTC) Received: (qmail 23012 invoked by uid 500); 6 Aug 2013 12:08:15 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 22965 invoked by uid 500); 6 Aug 2013 12:08:14 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 22956 invoked by uid 99); 6 Aug 2013 12:08:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Aug 2013 12:08:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Aug 2013 12:08:13 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 08B4D23888CD for ; Tue, 6 Aug 2013 12:07:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1510917 - in /httpcomponents/project-release-tools/trunk: .gitignore site.gradle Date: Tue, 06 Aug 2013 12:07:52 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130806120753.08B4D23888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Tue Aug 6 12:07:52 2013 New Revision: 1510917 URL: http://svn.apache.org/r1510917 Log: Restored rewriting of Maven generated links Modified: httpcomponents/project-release-tools/trunk/.gitignore httpcomponents/project-release-tools/trunk/site.gradle Modified: httpcomponents/project-release-tools/trunk/.gitignore URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/.gitignore?rev=1510917&r1=1510916&r2=1510917&view=diff ============================================================================== --- httpcomponents/project-release-tools/trunk/.gitignore (original) +++ httpcomponents/project-release-tools/trunk/.gitignore Tue Aug 6 12:07:52 2013 @@ -3,4 +3,5 @@ build .gradle .idea *.iml +out gradle.properties Modified: httpcomponents/project-release-tools/trunk/site.gradle URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/site.gradle?rev=1510917&r1=1510916&r2=1510917&view=diff ============================================================================== --- httpcomponents/project-release-tools/trunk/site.gradle (original) +++ httpcomponents/project-release-tools/trunk/site.gradle Tue Aug 6 12:07:52 2013 @@ -68,6 +68,7 @@ task stage(dependsOn: prepareStage) << { with siteContent(file("${release.localDir}/${submodule}")) } } + fixLinks(release, file("${prepareStage.localDir}/${releaseSeries}")) } println("Copying content ${website.pom.artifactId}:${website.pom.version} to ${prepareStage.localDir}") copy { @@ -91,3 +92,36 @@ CopySpec siteContent(File dir) { CopySpec siteContent(HCProject hcProject) { siteContent(hcProject.localDir) } + +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 + }) + } + } + +}