浏览代码

ZOOKEEPER-537. The zookeeper jar includes the java source files

git-svn-id: https://svn.apache.org/repos/asf/hadoop/zookeeper/trunk@833559 13f79535-47bb-0310-9956-ffa450edef68
Patrick D. Hunt 15 年之前
父节点
当前提交
8fb0deeb8f
共有 3 个文件被更改,包括 105 次插入10 次删除
  1. 3 0
      CHANGES.txt
  2. 23 0
      README.txt
  3. 79 10
      build.xml

+ 3 - 0
CHANGES.txt

@@ -100,6 +100,9 @@ BUGFIXES:
   ZOOKEEPER-562. c client can flood server with pings if tcp send queue
   filled. (ben reed via mahadev)
 
+  ZOOKEEPER-537. The zookeeper jar includes the java source files
+  (Thomas Dudziak via phunt)
+
 IMPROVEMENTS:
   ZOOKEEPER-473. cleanup junit tests to eliminate false positives due to
   "socket reuse" and failure to close client (phunt via mahadev)

+ 23 - 0
README.txt

@@ -7,3 +7,26 @@ and our wiki, at:
    http://wiki.apache.org/hadoop/ZooKeeper
 
 Full documentation for this release can also be found in docs/index.html
+
+---------------------------
+Packaging/release artifacts
+
+The release artifact contains the following jar files:
+
+zookeeper-<version>.jar         - legacy jar file which contains all classes
+                                  and source files. Prior to version 3.3.0 this
+                                  was the only jar file available. It has the 
+                                  benefit of having the source included (for
+                                  debugging purposes) however is also larger as
+                                  a result
+
+zookeeper-<version>-bin.jar     - contains only class (*.class) files
+zookeeper-<version>-src.jar     - contains only src (*.java) files
+zookeeper-<version>-javadoc.jar - contains only javadoc files
+
+The bin/src/javadoc jars were added specifically to support Maven/Ivy which have the
+ability to pull these down automatically as part of your build process. The content
+of the legacy jar and the bin+src jar are the same.
+
+As of version 3.3.0 bin/src/javadoc jars are deployed to the Apache Maven repository.
+  http://people.apache.org/repo/m2-ibiblio-rsync-repository/

+ 79 - 10
build.xml

@@ -305,10 +305,6 @@
             <compilerarg value="-Xlint:all"/>
             <compilerarg value="-Xlint:-path"/>
         </javac>
-        <copy todir="${build.classes}">
-            <fileset dir="${java.src.dir}"/>
-            <fileset dir="${src_generated.dir}"/>
-        </copy>
     </target>
 
     <target name="compile-test" depends="ivy-retrieve-test,compile">
@@ -431,8 +427,10 @@
         </java>
         <exec executable="hostname" outputproperty="host.name"/>
         <jar jarfile="${build.dir}/${final.name}.jar">
-            <fileset file="LICENSE" />
+            <fileset file="LICENSE.txt" />
             <fileset dir="${build.classes}" excludes="**/.generated"/>
+            <fileset dir="${java.src.dir}"/>
+            <fileset dir="${src_generated.dir}" excludes="**/.generated"/>
             <manifest>
                 <attribute name="Main-Class" value="org.apache.zookeeper.server.quorum.QuorumPeer" />
                 <attribute name="Built-By" value="${user.name}"/>
@@ -445,13 +443,78 @@
         </jar>
     </target>
     
-    <!-- ================================================================== -->
+    <!-- ====================================================== -->
+    <!-- Make zookeeper-bin.jar                                 -->
+    <!-- ====================================================== -->
+    <target name="bin-jar" depends="compile">
+        <java classname="org.apache.zookeeper.Version" fork="true"
+              outputproperty="revision" failonerror="true">
+            <arg value="--revision" />
+            <classpath>
+                <pathelement path="${build.classes}" />
+                <pathelement path="${clover.jar}" />
+            </classpath>
+        </java>
+        <exec executable="hostname" outputproperty="host.name"/>
+        <jar jarfile="${build.dir}/${final.name}-bin.jar">
+            <fileset file="LICENSE.txt" />
+            <fileset dir="${build.classes}" excludes="**/.generated"/>
+            <manifest>
+                <attribute name="Main-Class" value="org.apache.zookeeper.server.quorum.QuorumPeer" />
+                <attribute name="Built-By" value="${user.name}"/>
+                <attribute name="Built-At" value="${build.time}"/>
+                <attribute name="Built-On" value="${host.name}" />
+                <attribute name="Implementation-Title" value="org.apache.zookeeper"/>
+                <attribute name="Implementation-Version" value="${revision}"/> 
+                <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
+            </manifest>
+        </jar>
+    </target>
+
+	<!-- ====================================================== -->
+    <!-- Make zookeeper-src.jar                                 -->
+    <!-- ====================================================== -->
+    <target name="src-jar" depends="build-generated">
+        <jar jarfile="${build.dir}/${final.name}-src.jar">
+            <fileset file="LICENSE.txt" />
+            <fileset dir="${java.src.dir}"/>
+            <fileset dir="${src_generated.dir}" excludes="**/.generated"/>
+            <manifest>
+                <attribute name="Built-By" value="${user.name}"/>
+                <attribute name="Built-At" value="${build.time}"/>
+                <attribute name="Built-On" value="${host.name}" />
+                <attribute name="Implementation-Title" value="org.apache.zookeeper"/>
+                <attribute name="Implementation-Version" value="${revision}"/> 
+                <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
+            </manifest>
+        </jar>
+    </target>
+
+	<!-- ====================================================== -->
+    <!-- Make zookeeper-javadoc.jar                                 -->
+    <!-- ====================================================== -->
+    <target name="javadoc-jar" depends="javadoc">
+        <jar jarfile="${build.dir}/${final.name}-javadoc.jar">
+            <fileset file="LICENSE.txt" />
+            <fileset dir="${build.javadoc}"/>
+            <manifest>
+                <attribute name="Built-By" value="${user.name}"/>
+                <attribute name="Built-At" value="${build.time}"/>
+                <attribute name="Built-On" value="${host.name}" />
+                <attribute name="Implementation-Title" value="org.apache.zookeeper"/>
+                <attribute name="Implementation-Version" value="${revision}"/> 
+                <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
+            </manifest>
+        </jar>
+    </target>
+
+	<!-- ================================================================== -->
     <!-- D I S T R I B U T I O N                                            -->
     <!-- ================================================================== -->
     <!--                                                                    -->
     <!-- ================================================================== -->
     <target name="package"
-            depends="jar,api-report,create-cppunit-configure,compile-test"
+            depends="jar,bin-jar,src-jar,javadoc-jar,api-report,create-cppunit-configure,compile-test"
             description="Build distribution">
       <mkdir dir="${dist.dir}"/>
       <mkdir dir="${dist.dir}/lib"/>
@@ -480,10 +543,19 @@
 
       <copy todir="${dist.dir}"> 
         <fileset file="${build.dir}/${final.name}.jar"/>
+        <fileset file="${build.dir}/${final.name}-bin.jar"/>
+        <fileset file="${build.dir}/${final.name}-src.jar"/>
+        <fileset file="${build.dir}/${final.name}-javadoc.jar"/>
       </copy>
       
       <checksum file="${dist.dir}/${final.name}.jar" algorithm="md5"/>
       <checksum file="${dist.dir}/${final.name}.jar" algorithm="sha1"/>
+      <checksum file="${dist.dir}/${final.name}-bin.jar" algorithm="md5"/>
+      <checksum file="${dist.dir}/${final.name}-bin.jar" algorithm="sha1"/>
+      <checksum file="${dist.dir}/${final.name}-src.jar" algorithm="md5"/>
+      <checksum file="${dist.dir}/${final.name}-src.jar" algorithm="sha1"/>
+      <checksum file="${dist.dir}/${final.name}-javadoc.jar" algorithm="md5"/>
+      <checksum file="${dist.dir}/${final.name}-javadoc.jar" algorithm="sha1"/>
 
       <ivy:makepom ivyfile="${basedir}/ivy.xml"
                    pomfile="${dist.dir}/${final.name}.pom">
@@ -491,9 +563,6 @@
         <mapping conf="test" scope="test"/>
       </ivy:makepom>
 
-      <checksum file="${dist.dir}/${final.name}.pom" algorithm="md5"/>
-      <checksum file="${dist.dir}/${final.name}.pom" algorithm="sha1"/>
-
       <copy todir="${dist.dir}/bin">
         <fileset dir="bin"/>
       </copy>