lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From busc...@apache.org
Subject svn commit: r545010 - in /lucene/java/trunk: CHANGES.txt build.xml common-build.xml contrib/lucli/META-INF/ contrib/lucli/build.xml contrib/snowball/build.xml src/demo/demo-build.template
Date Thu, 07 Jun 2007 00:48:33 GMT
Author: buschmi
Date: Wed Jun  6 17:48:32 2007
New Revision: 545010

URL: http://svn.apache.org/viewvc?view=rev&rev=545010
Log:
LUCENE-908: 
- Improves content of MANIFEST file and makes it customizable for the contribs.
- Adds SNOWBALL-LICENSE.txt to META-INF of the snowball jar 
- lucli jar now contains LICENSE.txt and NOTICE.txt.

Removed:
    lucene/java/trunk/contrib/lucli/META-INF/
Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/build.xml
    lucene/java/trunk/common-build.xml
    lucene/java/trunk/contrib/lucli/build.xml
    lucene/java/trunk/contrib/snowball/build.xml
    lucene/java/trunk/src/demo/demo-build.template

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?view=diff&rev=545010&r1=545009&r2=545010
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Wed Jun  6 17:48:32 2007
@@ -271,6 +271,11 @@
     
  7. LUCENE-909: Demo targets for running the demo. (Doron Cohen)
 
+ 9. LUCENE-908: Improves content of MANIFEST file and makes it customizable
+    for the contribs. Adds SNOWBALL-LICENSE.txt to META-INF of the snowball
+    jar and makes sure that the lucli jar contains LICENSE.txt and NOTICE.txt.
+    (Chris Hostetter, Michael Busch)
+
 ======================= Release 2.1.0 2007-02-14 =======================
 
 Changes in runtime behavior

Modified: lucene/java/trunk/build.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/build.xml?view=diff&rev=545010&r1=545009&r2=545010
==============================================================================
--- lucene/java/trunk/build.xml (original)
+++ lucene/java/trunk/build.xml Wed Jun  6 17:48:32 2007
@@ -93,6 +93,23 @@
       destfile="${build.dir}/${demo.name}.jar"
       basedir="${build.dir}/classes/demo"
       excludes="**/*.java">
+      <manifest>
+        <attribute name="Specification-Title" value="Lucene Search Engine: demos"/>
+        <!-- spec version must match "digit+{.digit+}*" -->
+        <attribute name="Specification-Version" value="${version}"/>
+        <attribute name="Specification-Vendor"
+                   value="The Apache Software Foundation"/>
+        <attribute name="Implementation-Title" value="org.apache.lucene"/>
+        <!-- impl version can be any string -->
+        <attribute name="Implementation-Version"
+                   value="${version}"/>
+        <attribute name="Implementation-Vendor"
+                   value="The Apache Software Foundation"/>
+        <attribute name="X-Compile-Source-JDK" 
+                   value="${javac.source}"/>
+        <attribute name="X-Compile-Target-JDK" 
+                   value="${javac.target}"/>
+	  </manifest>    	
       <metainf dir="${common.dir}">
         <include name="LICENSE.txt"/>
         <include name="NOTICE.txt"/>
@@ -106,12 +123,30 @@
       <fileset dir="src/jsp" excludes="WEB-INF/web.xml"/>
       <lib dir="${build.dir}" includes="${demo.name}.jar"/>
       <lib dir="${build.dir}" includes="${final.name}.jar"/>
+      <manifest>
+        <attribute name="Specification-Title" value="Lucene Search Engine: demos"/>
+        <!-- spec version must match "digit+{.digit+}*" -->
+        <attribute name="Specification-Version" value="${version}"/>
+        <attribute name="Specification-Vendor"
+                   value="The Apache Software Foundation"/>
+        <attribute name="Implementation-Title" value="org.apache.lucene"/>
+        <!-- impl version can be any string -->
+        <attribute name="Implementation-Version"
+                   value="${version}"/>
+        <attribute name="Implementation-Vendor"
+                   value="The Apache Software Foundation"/>
+        <attribute name="X-Compile-Source-JDK" 
+                   value="${javac.source}"/>
+        <attribute name="X-Compile-Target-JDK" 
+                   value="${javac.target}"/>
+	  </manifest>    	
       <metainf dir="${common.dir}">
         <include name="LICENSE.txt"/>
         <include name="NOTICE.txt"/>
       </metainf>
     </war>
   </target>
+
 
   <!-- ================================================================== -->
   <!-- B U I L D  D E M O                                                 -->

Modified: lucene/java/trunk/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/common-build.xml?view=diff&rev=545010&r1=545009&r2=545010
==============================================================================
--- lucene/java/trunk/common-build.xml (original)
+++ lucene/java/trunk/common-build.xml Wed Jun  6 17:48:32 2007
@@ -45,6 +45,10 @@
   <property name="junit.includes" value="**/Test*.java,**/*Test.java"/>
   <property name="junit.excludes" value=""/>
 
+  <patternset id="metainf.includes">
+  	<exclude name="**/*"/>
+  </patternset>
+	
   <condition property="build-1-5-contrib">
      <equals arg1="1.5" arg2="${ant.java.version}" />
   </condition>
@@ -146,26 +150,70 @@
 
   <target name="jar-core" depends="compile-core"
     description="Packages the JAR file">
-    <jar
-      destfile="${build.dir}/${final.name}.jar"
-      basedir="${build.dir}/classes/java">
-      <manifest>
-        <attribute name="Created-By" value="Apache Lucene Java"/>
-        <section name="org/apache/lucene/">
-          <attribute name="Specification-Title" value="Lucene Search Engine"/>
+    <jarify />
+  </target>
+
+  <macrodef name="jarify" description="Builds a JAR file">
+    <attribute name="title" default="Lucene Search Engine: ${ant.project.name}" />
+    <element name="manifest-attributes" optional="yes"/>
+    <sequential>
+      <!-- If possible, include the svnversion -->
+      <exec dir="." executable="svnversion"
+            outputproperty="svnversion" failifexecutionfails="false">
+        <arg line="."/>
+      </exec>
+     
+      <jar
+        destfile="${build.dir}/${final.name}.jar"
+        basedir="${build.dir}/classes/java">
+        <manifest>
+          <!--
+          http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Manifest
+          http://java.sun.com/j2se/1.5.0/docs/guide/versioning/spec/versioning2.html
+          http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Package.html
+          http://java.sun.com/j2se/1.5.0/docs/api/java/util/jar/package-summary.html
+          http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html
+          -->
+          <!-- Don't set 'Manifest-Version' it identifies the version of the
+               manifest file format, and should allways be 1.0 (the default)
+  
+               Don't set 'Created-by' attribute, it's purpose is 
+               to identify the version of java used to build the jar,
+               which ant will do by default.
+  
+               Ant will happily override these with bogus strings if you
+               tell it to, so don't.
+  
+               NOTE: we don't use section info because all of our manifest data
+               applies to the entire jar/war ... no package specific info.
+          -->
+          <attribute name="Specification-Title" value="@{title}"/>
+          <!-- spec version must match "digit+{.digit+}*" -->
           <attribute name="Specification-Version" value="${version}"/>
-          <attribute name="Specification-Vendor" value="Lucene"/>
+          <attribute name="Specification-Vendor"
+                     value="The Apache Software Foundation"/>
           <attribute name="Implementation-Title" value="org.apache.lucene"/>
-          <attribute name="Implementation-Version" value="build ${DSTAMP}"/>
-          <attribute name="Implementation-Vendor" value="Lucene"/>
-        </section>
-      </manifest>
-      <metainf dir="${common.dir}">
-        <include name="LICENSE.txt"/>
-        <include name="NOTICE.txt"/>
-      </metainf>
-    </jar>
-  </target>
+          <!-- impl version can be any string -->
+          <attribute name="Implementation-Version"
+                     value="${version} ${svnversion} - ${user.name} - ${DSTAMP} ${TSTAMP}"/>
+          <attribute name="Implementation-Vendor"
+                     value="The Apache Software Foundation"/>
+          <attribute name="X-Compile-Source-JDK" 
+                     value="${javac.source}"/>
+          <attribute name="X-Compile-Target-JDK" 
+                     value="${javac.target}"/>
+          <manifest-attributes/>
+        </manifest>
+        <metainf dir="${common.dir}">
+          <include name="LICENSE.txt"/>
+          <include name="NOTICE.txt"/>
+        </metainf>
+        <metainf dir=".">
+          <patternset refid="metainf.includes"/>
+        </metainf>
+      </jar>
+    </sequential>
+  </macrodef>
 
   <target name="compile-test" depends="compile-core">
     <compile
@@ -341,6 +389,7 @@
   </macrodef>
 
 </project>
+
 
 
 

Modified: lucene/java/trunk/contrib/lucli/build.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/lucli/build.xml?view=diff&rev=545010&r1=545009&r2=545010
==============================================================================
--- lucene/java/trunk/contrib/lucli/build.xml (original)
+++ lucene/java/trunk/contrib/lucli/build.xml Wed Jun  6 17:48:32 2007
@@ -22,9 +22,11 @@
   <import file="../contrib-build.xml"/>
 
   <target name="jar" depends="compile" description="Create JAR">
-    <jar jarfile="${build.dir}/${final.name}.jar"
-         basedir="${build.dir}/classes/java"
-         manifest="META-INF/MANIFEST.MF"
-    />
+    <jarify>
+      <manifest-attributes>
+        <attribute name="Main-Class" value="lucli.Lucli" />
+        <attribute name="Class-Path" value="lib/jline.jar lib/lucene.jar" />
+      </manifest-attributes>
+    </jarify>
   </target>
 </project>

Modified: lucene/java/trunk/contrib/snowball/build.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/snowball/build.xml?view=diff&rev=545010&r1=545009&r2=545010
==============================================================================
--- lucene/java/trunk/contrib/snowball/build.xml (original)
+++ lucene/java/trunk/contrib/snowball/build.xml Wed Jun  6 17:48:32 2007
@@ -13,6 +13,9 @@
   <property name="snowball.root" value="snowball/website"/>
   <property name="bin.dir" location="bin"/>
 
+  <patternset id="metainf.includes">
+    <include name="SNOWBALL-LICENSE.txt"/>
+  </patternset>
 
   <!-- ====================================================== -->
   <!-- Download Snowball code                                 -->

Modified: lucene/java/trunk/src/demo/demo-build.template
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/demo/demo-build.template?view=diff&rev=545010&r1=545009&r2=545010
==============================================================================
--- lucene/java/trunk/src/demo/demo-build.template (original)
+++ lucene/java/trunk/src/demo/demo-build.template Wed Jun  6 17:48:32 2007
@@ -50,6 +50,23 @@
       destfile="${demo.name}.jar"
       basedir="${build.dir}/classes/demo"
       excludes="**/*.java">
+      <manifest>
+        <attribute name="Specification-Title" value="Lucene Search Engine: demos"/>
+        <!-- spec version must match "digit+{.digit+}*" -->
+        <attribute name="Specification-Version" value="${version}"/>
+        <attribute name="Specification-Vendor"
+                   value="The Apache Software Foundation"/>
+        <attribute name="Implementation-Title" value="org.apache.lucene"/>
+        <!-- impl version can be any string -->
+        <attribute name="Implementation-Version"
+                   value="${version}"/>
+        <attribute name="Implementation-Vendor"
+                   value="The Apache Software Foundation"/>
+        <attribute name="X-Compile-Source-JDK" 
+                   value="${javac.source}"/>
+        <attribute name="X-Compile-Target-JDK" 
+                   value="${javac.target}"/>
+	  </manifest>    	
       <metainf dir="${common.dir}">
         <include name="LICENSE.txt"/>
         <include name="NOTICE.txt"/>
@@ -64,6 +81,23 @@
       <fileset dir="src/jsp" excludes="WEB-INF/web.xml"/>
       <lib dir="." includes="${demo.name}.jar"/>
       <lib dir="." includes="${core.name}.jar"/>
+      <manifest>
+        <attribute name="Specification-Title" value="Lucene Search Engine: demos"/>
+        <!-- spec version must match "digit+{.digit+}*" -->
+        <attribute name="Specification-Version" value="${version}"/>
+        <attribute name="Specification-Vendor"
+                   value="The Apache Software Foundation"/>
+        <attribute name="Implementation-Title" value="org.apache.lucene"/>
+        <!-- impl version can be any string -->
+        <attribute name="Implementation-Version"
+                   value="${version}"/>
+        <attribute name="Implementation-Vendor"
+                   value="The Apache Software Foundation"/>
+        <attribute name="X-Compile-Source-JDK" 
+                   value="${javac.source}"/>
+        <attribute name="X-Compile-Target-JDK" 
+                   value="${javac.target}"/>
+	  </manifest>    	
       <metainf dir="${common.dir}">
         <include name="LICENSE.txt"/>
         <include name="NOTICE.txt"/>



Mime
View raw message