]> source.dussan.org Git - vaadin-framework.git/commitdiff
#3587 - Added targets for building javadoc and sources jar (mainly for Maven)
authorArtur Signell <artur.signell@itmill.com>
Tue, 20 Apr 2010 07:34:52 +0000 (07:34 +0000)
committerArtur Signell <artur.signell@itmill.com>
Tue, 20 Apr 2010 07:34:52 +0000 (07:34 +0000)
svn changeset:12665/svn branch:6.3

build/build.xml

index dca4570558ce2dfb8fdb04f8616a451abcffe287..8cedd9167c9483c145a094154a82d6f2cf899c08 100644 (file)
         <echo>We are using gwt version ${gwt-version}.</echo>
 
         <!-- Destination files -->
-        <property name="lib-jar-name" value="${product-file}-${version.full}.jar" />
+        <property name="base-name" value="${product-file}-${version.full}" />
+        <property name="lib-jar-name" value="${base-name}.jar" />
+        <property name="lib-sources-jar-name" value="${base-name}-sources.jar" />
+        <property name="lib-javadoc-jar-name" value="${base-name}-javadoc.jar" />
 
         <echo message="Prepared to build ${product-file} version ${version.full} packages" />
 
         <!-- Output directory -->
-        <property name="output-dir" value="${result-path}/${product-file}-${version.full}" />
+        <property name="output-dir" value="${result-path}/${base-name}" />
         <mkdir dir="${output-dir}" />
 
         <!-- Where widgetsets are written to.                             -->
     <target name="internal-package-zip">
         <antcontrib:var name="eclipse-launch-vmargs" value="-Xms256M -Xmx512M" />
         <antcall target="add-misc-files" inheritAll="true" inheritRefs="true" />
-        <zip zipfile="${result-path}/${product-file}-${version.full}.zip">
-            <zipfileset prefix="${product-file}-${version.full}" dir="${result-path}/${product-file}-${version.full}">
+        <zip zipfile="${result-path}/${base-name}.zip">
+            <zipfileset prefix="${base-name}" dir="${result-path}/${base-name}">
                 <patternset>
                     <include name="**/*" />
                 </patternset>
             </zipfileset>
-            <zipfileset prefix="${product-file}-${version.full}/gwt" dir="${gwt-dir}">
+            <zipfileset prefix="${base-name}/gwt" dir="${gwt-dir}">
                 <patternset>
                     <include name="**/*" />
                     <exclude name="doc**"/>
         <!-- We assume the needed files are put in place by internal-package-war -->
         <echo>Building Liferay zip</echo>
 
-        <zip zipfile="${result-path}/${product-file}-${version.full}-liferay.zip">
+        <zip zipfile="${result-path}/${base-name}-liferay.zip">
             <zipfileset prefix="VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet" dir="${output-dir}/WebContent/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet">
                 <patternset>
                     <include name="**/*" />
             
         </zip>
         
-        <echo>##teamcity[publishArtifacts '${result-path}/${product-file}-${version.full}-liferay.zip']</echo>
+        <echo>##teamcity[publishArtifacts '${result-path}/${base-name}-liferay.zip']</echo>
     </target>
 
     <target name="add-misc-files">
     <!-- However, since compiling the server-side is required by the client-side -->
     <!-- compilation, the server-side will actually be built before it.          -->
     <target name="build"
-            depends="compile-server-side, compile-client-side, libs, demo"
+            depends="compile-server-side, compile-client-side, libs, vaadin-sources.jar, demo"
             description="Build package required files, without packing them.">
     </target>
 
     <!-- individual widgetsets, because antcall does not fulfill            -->
     <!-- dependencies.                                                      -->
     <target name="libs" depends="compile-server-side, compile-client-side">
-        <echo>Creating libs (server-side) ${lib-jar-name}</echo>
-        <!-- Create Toolkit JAR -->
+        <echo>Creating JAR (server-side) ${lib-jar-name}</echo>
+        <!-- Create Vaadin JAR -->
         <mkdir dir="${output-dir}/META-INF"/>
         <echo file="${output-dir}/META-INF/VERSION">${version.full}</echo> 
         <echo file="${output-dir}/META-INF/GWT-VERSION">${gwt-version}</echo> 
         <copy file="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" tofile="${output-dir}/WebContent/${lib-jar-name}" />
     </target>
 
+       <target name="vaadin-sources.jar" depends="init">
+        <jar file="${output-dir}/${lib-sources-jar-name}" compress="true">
+                       <fileset dir="${result-path}/src/core">
+                       <patternset>
+                               <exclude name="${toolkit-package}/launcher/**" />
+                               <include name="**/*.java" />
+                               </patternset>
+                   </fileset>
+        </jar>
+       </target>
+       
     <!-- Demos  - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
     <target name="demo" depends="libs">
         <echo>Building demos</echo>
 
     <target name="manual-package" depends="manual-init, manual-copy">
         <zip destfile="${result-path}/${product-file}-docs-${version.full}.zip">
-            <zipfileset prefix="docs" dir="${result-path}/${product-file}-${version.full}/WebContent/docs">
+            <zipfileset prefix="docs" dir="${result-path}/${base-name}/WebContent/docs">
                 <patternset>
                     <include name="api/**" />
                     <include name="book-of-vaadin.pdf" />
             <link offline="true" href="http://java.sun.com/j2ee/1.4/docs/api/" packagelistLoc="build/javadoc/j2ee-1.4" />
         </javadoc>
 
+       <!-- Create a javadoc jar, mainly for Maven -->
+        <jar file="${output-dir}/${lib-javadoc-jar-name}" compress="true">
+                       <fileset dir="${javadoc.destdir}">
+                       <patternset>
+                               <include name="**" />
+                               </patternset>
+                   </fileset>
+        </jar>
+
         <!-- Append local style definitions. -->
         <echo>Appending local style definitions</echo>
         <concat destfile="${javadoc.destdir}/stylesheet.css" append="yes">
         <echo>Installing ${output-dir}/WebContent/${lib-jar-name} to ${nightly.publish}</echo>
         <echo>Hopefully you have permissions for the copy operation with SSH.</echo>
 
-        <property name="package.filename" value="${result-path}/${product-file}-${version.full}.zip"/>
+        <property name="package.filename" value="${result-path}/${base-name}.zip"/>
 
         <!-- Copy the linux installation package and the JAR. -->
         <exec executable="scp" searchpath="true" resultproperty="nightly.install.scp.result">
         <fail unless="com.vaadin.testbench.deployment.url" message="The 'com.vaadin.testbench.deployment.url' property must be defined."/>
         <fail unless="com.vaadin.testbench.lib.dir" message="The 'com.vaadin.testbench.lib.dir' property must be defined."/>
 
-        <property name="package.name" value="${product-file}-${version.full}"/>
+        <property name="package.name" value="${base-name}"/>
 
         <!-- Only Linux tests allowed. TODO: Generalize this. -->
         <property name="package.filename" value="${result-path}/${package.name}.zip"/>