lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sar...@apache.org
Subject [5/8] lucene-solr:branch_6_1: LUCENE-7543: Parse DOAP RDF files with Ant <xmlproperty> rather than Perl XML::Simple
Date Tue, 22 Nov 2016 01:54:41 GMT
LUCENE-7543: Parse DOAP RDF files with Ant <xmlproperty> rather than Perl XML::Simple


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/d8d8c77d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d8d8c77d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d8d8c77d

Branch: refs/heads/branch_6_1
Commit: d8d8c77dc0d7714778a35b57a8d64274c5753596
Parents: cf51e5c
Author: Steve Rowe <sarowe@apache.org>
Authored: Mon Nov 21 20:48:32 2016 -0500
Committer: Steve Rowe <sarowe@apache.org>
Committed: Mon Nov 21 20:49:22 2016 -0500

----------------------------------------------------------------------
 dev-tools/doap/lucene.rdf           |  2 +-
 dev-tools/doap/solr.rdf             |  2 +-
 lucene/common-build.xml             |  9 +++++--
 lucene/site/changes/changes2html.pl | 44 ++++++++++++++++++--------------
 4 files changed, 34 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d8d8c77d/dev-tools/doap/lucene.rdf
----------------------------------------------------------------------
diff --git a/dev-tools/doap/lucene.rdf b/dev-tools/doap/lucene.rdf
index d1293a4..4fd2942 100644
--- a/dev-tools/doap/lucene.rdf
+++ b/dev-tools/doap/lucene.rdf
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
 <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
@@ -16,7 +17,6 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<?xml version="1.0"?>
 <rdf:RDF xml:lang="en"
          xmlns="http://usefulinc.com/ns/doap#"
          xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d8d8c77d/dev-tools/doap/solr.rdf
----------------------------------------------------------------------
diff --git a/dev-tools/doap/solr.rdf b/dev-tools/doap/solr.rdf
index 87f2463..cc729dc 100644
--- a/dev-tools/doap/solr.rdf
+++ b/dev-tools/doap/solr.rdf
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
 <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
@@ -16,7 +17,6 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<?xml version="1.0"?>
 <rdf:RDF xml:lang="en"
          xmlns="http://usefulinc.com/ns/doap#"
          xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d8d8c77d/lucene/common-build.xml
----------------------------------------------------------------------
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index b2d3043..e20fedd 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -2487,21 +2487,26 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}
    -->
   <macrodef name="build-changes">
     <attribute name="changes.product"/>
+    <attribute name="doap.property.prefix" default="doap.@{changes.product}"/>
     <attribute name="changes.src.file" default="CHANGES.txt"/>
     <attribute name="changes.src.doap" default="${dev-tools.dir}/doap/@{changes.product}.rdf"/>
+    <attribute name="changes.version.dates" default="build/@{doap.property.prefix}.version.dates.csv"/>
     <attribute name="changes.target.dir" default="${changes.target.dir}"/>
     <attribute name="lucene.javadoc.url" default="${lucene.javadoc.url}"/>
     <sequential>
       <mkdir dir="@{changes.target.dir}"/>
+      <xmlproperty keeproot="false" file="@{changes.src.doap}" collapseAttributes="false"
prefix="@{doap.property.prefix}"/>
+      <echo file="@{changes.version.dates}" append="false">${@{doap.property.prefix}.Project.release.Version.revision}&#xA;</echo>
+      <echo file="@{changes.version.dates}" append="true">${@{doap.property.prefix}.Project.release.Version.created}&#xA;</echo>
       <exec executable="${perl.exe}" input="@{changes.src.file}" 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.src.doap}"/>
+        <arg value="@{changes.version.dates}"/>
         <arg value="@{lucene.javadoc.url}"/>
       </exec>
-      <delete file="@{changes.target.dir}/jiraVersionList.json"/>
+      <delete file="@{changes.version.dates}"/>
       <copy todir="@{changes.target.dir}">
         <fileset dir="${changes.src.dir}" includes="*.css"/>
       </copy>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d8d8c77d/lucene/site/changes/changes2html.pl
----------------------------------------------------------------------
diff --git a/lucene/site/changes/changes2html.pl b/lucene/site/changes/changes2html.pl
index b3f8fdb..11a0fab 100755
--- a/lucene/site/changes/changes2html.pl
+++ b/lucene/site/changes/changes2html.pl
@@ -23,7 +23,6 @@
 
 use strict;
 use warnings;
-use XML::Simple;
 
 my $jira_url_prefix = 'http://issues.apache.org/jira/browse/';
 my $github_pull_request_prefix = 'https://github.com/apache/lucene-solr/pull/';
@@ -823,26 +822,33 @@ sub get_release_date {
 # Pulls release dates from the project DOAP file.
 #
 sub setup_release_dates {
-  my %release_dates;
+  my %release_dates = ();
   my $file = shift;
-
-  my $project_info = XMLin($file)->{Project};
-  my $version;
+print STDERR "file: $file\n";
+  open(FILE, "<$file") || die "could not open $file: $!";
+  my $version_list = <FILE>;
+  my $created_list = <FILE>;
+  close(FILE);
+
+  $version_list =~ s/^\s+|\s+$//g;
+  my @versions = split /\s*,\s*/, $version_list;
+  $created_list =~ s/^\s+|\s+$//g;
+  my @created = split /\s*,\s*/, $created_list; 
+
+  if (scalar(@versions) != scalar(@created)) {
+    die $file . " contains" . scalar(@versions) . " versions but " . scalar(@created) . "
creation dates.";
+  }
   my $date;
-  for my $release (@{$project_info->{release}}) {
-    $version = $release->{Version};
-    if ($version->{created}) {
-      $date = normalize_date($version->{created});
-      my $version_name = $version->{revision};
-      $release_dates{$version->{revision}} = $date;
-      if ($version_name =~ /^([1-9]\d*\.\d+)([^.0-9].*|$)/) {
-        my $padded_version_name = "$1.0$2";             # Alias w/trailing ".0"
-        $release_dates{$padded_version_name} = $date;
-      } elsif ($version_name =~ /\.0(?=[^.0-9]|$)/) {
-        my $trimmed_version_name = $version_name;
-        $trimmed_version_name =~ s/\.0(?=[^.0-9]|$)//;  # Alias w/o trailing ".0"
-        $release_dates{$trimmed_version_name} = $date;
-      }
+  for my $pos (0..$#versions) {
+    $date = normalize_date($created[$pos]);
+    $release_dates{$versions[$pos]} = $date;
+    if ($versions[$pos] =~ /^([1-9]\d*\.\d+)([^.0-9].*|$)/) {
+      my $padded_version_name = "$1.0$2";             # Alias w/trailing ".0"
+      $release_dates{$padded_version_name} = $date;
+    } elsif ($versions[$pos] =~ /\.0(?=[^.0-9]|$)/) {
+      my $trimmed_version_name = $versions[$pos];
+      $trimmed_version_name =~ s/\.0(?=[^.0-9]|$)//;  # Alias w/o trailing ".0"
+      $release_dates{$trimmed_version_name} = $date;
     }
   }
   return %release_dates;


Mime
View raw message