LUCENE-4434: Make changes-to-html not depend on wget or curl, fix some unicode bugs with PERL, add -Dperl.exe property

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1390402 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-09-26 11:05:41 +00:00
parent 7fa1551efb
commit ad3fe2953e
5 changed files with 32 additions and 35 deletions

View File

@ -220,7 +220,8 @@
</java>
<echo>Benchmark output is in file: ${collation.output.file}</echo>
<echo>Converting to JIRA table format...</echo>
<exec executable="perl" output="${collation.jira.output.file}" failonerror="true">
<exec executable="${perl.exe}" output="${collation.jira.output.file}" failonerror="true">
<arg value="-CSD"/>
<arg value="scripts/collation.bm2jira.pl"/>
<arg value="${collation.output.file}"/>
</exec>
@ -246,7 +247,8 @@
</java>
<echo>Benchmark output is in file: ${shingle.output.file}</echo>
<echo>Converting to JIRA table format...</echo>
<exec executable="perl" output="${shingle.jira.output.file}" failonerror="true">
<exec executable="${perl.exe}" output="${shingle.jira.output.file}" failonerror="true">
<arg value="-CSD"/>
<arg value="scripts/shingle.bm2jira.pl"/>
<arg value="${shingle.output.file}"/>
</exec>

View File

@ -416,7 +416,7 @@
<delete dir="${svn.export.dir}/tools/clover"/>
<build-changes changes.src.dir="${svn.export.dir}/site/changes"
changes.target.dir="${svn.export.dir}/docs/changes"/>
changes.target.dir="${svn.export.dir}/docs/changes" changes.product="LUCENE"/>
<tar tarfile="${source.package.file}" compression="gzip" longfile="gnu">
<tarfileset prefix="lucene-${version}" dir="${svn.export.dir}"/>
</tar>
@ -507,7 +507,7 @@
</target>
<target name="changes-to-html">
<build-changes changes.src.dir="${changes.src.dir}" changes.target.dir="${changes.target.dir}" />
<build-changes changes.src.dir="${changes.src.dir}" changes.target.dir="${changes.target.dir}" changes.product="LUCENE"/>
</target>
<target name="pitest-modules" depends="compile-test">

View File

@ -209,6 +209,7 @@
-->
<property name="svnversion.exe" value="svnversion" />
<property name="svn.exe" value="svn" />
<property name="perl.exe" value="perl" />
<property name="hg.exe" value="hg" />
<property name="moman.url" value="https://bitbucket.org/jpbarrette/moman" />
@ -1351,7 +1352,8 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
<sequential>
<property name="output.build.xml" location="${build.dir}/stage_maven_build.xml"/>
<property name="dev-tools.scripts.dir" value="../dev-tools/scripts"/>
<exec dir="." executable="perl" failonerror="true" outputproperty="stage.maven.script.output">
<exec dir="." executable="${perl.exe}" failonerror="true" outputproperty="stage.maven.script.output">
<arg value="-CSD"/>
<arg value="${dev-tools.scripts.dir}/write.stage.maven.build.xml.pl"/>
<arg value="${maven.dist.dir}"/> <!-- Maven distribution artifacts directory -->
<arg value="${output.build.xml}"/> <!-- Ant build file to be written -->
@ -1889,14 +1891,21 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
compile changes.txt into an html file
-->
<macrodef name="build-changes">
<attribute name="changes.product"/>
<attribute name="changes.src.dir" default="${changes.src.dir}"/>
<attribute name="changes.target.dir" default="${changes.target.dir}"/>
<sequential>
<mkdir dir="@{changes.target.dir}"/>
<exec executable="perl" input="CHANGES.txt" output="@{changes.target.dir}/Changes.html"
<get src="https://issues.apache.org/jira/rest/api/2/project/@{changes.product}"
dest="@{changes.target.dir}/jiraVersionList.json" httpusecaches="false"/>
<exec executable="${perl.exe}" input="CHANGES.txt" output="@{changes.target.dir}/Changes.html"
failonerror="true" logError="true">
<arg value="-CSD"/>
<arg value="@{changes.src.dir}/changes2html.pl"/>
<arg value="@{changes.product}"/>
<arg value="@{changes.target.dir}/jiraVersionList.json"/>
</exec>
<delete file="@{changes.target.dir}/jiraVersionList.json"/>
<copy todir="@{changes.target.dir}">
<fileset dir="@{changes.src.dir}" includes="*.css"/>
</copy>

View File

@ -41,17 +41,10 @@ my $first_relid = undef;
my $second_relid = undef;
my @releases = ();
my @lines = <>; # Get all input at once
my @lines = <STDIN>; # Get all input at once
my $product = '';
for my $line (@lines) {
($product) = $line =~ /(Solr|Lucene)/i;
if ($product) {
$product = uc($product);
last;
}
}
my %release_dates = &setup_release_dates;
my $product = $ARGV[0];
my %release_dates = &setup_release_dates($ARGV[1]);
my $in_major_component_versions_section = 0;
@ -804,6 +797,7 @@ sub get_release_date {
#
sub setup_release_dates {
my %release_dates;
my $file = shift;
if (uc($product) eq 'LUCENE') {
%release_dates
= ( '0.01' => '2000-03-30', '0.04' => '2000-04-19',
@ -826,9 +820,7 @@ sub setup_release_dates {
'3.0.0' => '2009-11-25');
}
print STDERR "Retrieving $project_info_url/$product ...\n";
my $project_info_json = get_url_contents("$project_info_url/$product");
my $project_info_json = readFile($file);
my $project_info = json2perl($project_info_json);
for my $version (@{$project_info->{versions}}) {
if ($version->{releaseDate}) {
@ -844,20 +836,13 @@ sub setup_release_dates {
return %release_dates;
}
#
# returns contents of the passed in url
#
sub get_url_contents {
my $url = shift;
my $tryWget = `wget --no-check-certificate -O - $url`;
if ($? eq 0) {
return $tryWget;
}
my $tryCurl = `curl $url`;
if ($? eq 0) {
return $tryCurl;
}
die "could not retrieve $url with either wget or curl!";
sub readFile {
my $file = shift;
open(F, '<'.$file) || die "could not open $file: $!";
local $/ = undef;
my $project_info_json = <F>;
close(F);
return $project_info_json;
}
#

View File

@ -370,7 +370,8 @@
<delete dir="${svn.export.dir}/lucene/tools/clover"/>
<build-changes changes.src.dir="${svn.export.dir}/lucene/site/changes"
changes.target.dir="${svn.export.dir}/solr/docs/changes"/>
changes.target.dir="${svn.export.dir}/solr/docs/changes"
changes.product="SOLR"/>
<tar destfile="${source.package.file}" compression="gzip" longfile="gnu">
<tarfileset dir="${svn.export.dir}"
@ -498,7 +499,7 @@
</target>
<target name="changes-to-html">
<build-changes changes.src.dir="${changes.src.dir}" changes.target.dir="${changes.target.dir}" />
<build-changes changes.src.dir="${changes.src.dir}" changes.target.dir="${changes.target.dir}" changes.product="SOLR"/>
</target>
<target name="sign-artifacts">