/[pdpsoft]/branches/nl.nikhef.jgridstart-flyingsaucer/nl.nikhef.jgridstart/build.xml
ViewVC logotype

Diff of /branches/nl.nikhef.jgridstart-flyingsaucer/nl.nikhef.jgridstart/build.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1371 by wvengen, Mon Jan 11 15:43:33 2010 UTC revision 1372 by wvengen, Tue Jan 12 14:09:52 2010 UTC
# Line 80  Line 80 
80          <property name="dep.itext" location="${dir.thirdparty}/flyingsaucer/iText-2.0.8.jar"/>          <property name="dep.itext" location="${dir.thirdparty}/flyingsaucer/iText-2.0.8.jar"/>
81          <property name="dep.winregistry" location="${dir.thirdparty}/winregistry/WinRegistry-3.4.jar"/>          <property name="dep.winregistry" location="${dir.thirdparty}/winregistry/WinRegistry-3.4.jar"/>
82          <property name="dep.apiviz" location="${dir.thirdparty}/javadoc/apiviz-1.3.0.GA.jar"/>          <property name="dep.apiviz" location="${dir.thirdparty}/javadoc/apiviz-1.3.0.GA.jar"/>
83          <!-- activation framework is present in Java 1.6 and we don't use  
84               it apart for resolving; so we can omit it when compiling there          <!-- java activation framework; trickery to make it build on java6 and run on java5 too
85               to avoid ProGuard Warnings (which are fatal); so we need it for               (see target jar.small-add.activation) -->
              lower versions. This is a little trick with ProGuard's jarfilter -->  
86          <property name="dep.activation" location="${dir.thirdparty}/bouncycastle/activation.jar"/>          <property name="dep.activation" location="${dir.thirdparty}/bouncycastle/activation.jar"/>
87            <condition property="dep.activation.pgfilter" value="!javax/activation/**,!com/sun/activation/**" else="**">
88                    <available classname="javax.activation.DataSource"/>
89            </condition>
90            
91            <!-- Compile-time dependencies -->
92          <path id="path.dependencies">          <path id="path.dependencies">
                 <!-- TODO use jdk13 library versions and test -->  
93                  <pathelement location="${dep.bouncycastle}"/>                  <pathelement location="${dep.bouncycastle}"/>
94                  <pathelement location="${dep.bouncycastle.smime}"/>                  <pathelement location="${dep.bouncycastle.smime}"/>
95                          <pathelement location="${dep.javamail}"/>                          <pathelement location="${dep.javamail}"/>
96                            <pathelement location="${dep.activation}"/>
97                  <pathelement location="${dep.commons-lang}"/>                  <pathelement location="${dep.commons-lang}"/>
98                  <pathelement location="${dep.commons-cli}"/>                  <pathelement location="${dep.commons-cli}"/>
99                  <pathelement location="${dep.commons-exec}"/>                  <pathelement location="${dep.commons-exec}"/>
100                  <pathelement location="${dep.junit}"/>                  <pathelement location="${dep.swingworker}"/>
                 <pathelement location="${dep.abbot}"/>  
                 <pathelement location="${dep.swingworker}"/> <!-- for java1.5 and below -->  
101                  <pathelement location="${dep.xhtmlrenderer}"/>                  <pathelement location="${dep.xhtmlrenderer}"/>
102                          <pathelement location="${dep.itext}"/>                          <pathelement location="${dep.itext}"/>
103                  <pathelement location="${dep.winregistry}"/>                  <pathelement location="${dep.winregistry}"/>
104                  <pathelement location="${java.home}/lib/javaws.jar"/> <!-- for javax.jnlp.* -->                  <pathelement location="${dep.junit}"/>
105                    <pathelement location="${dep.abbot}"/>
106          </path>          </path>
107                    
108          <patternset id="distfiles">          <patternset id="distfiles">
# Line 116  Line 119 
119                  <exclude name="**/.svn"/>                  <exclude name="**/.svn"/>
120          </patternset>          </patternset>
121                    
122          <!-- files to include as dependencies in jars -->          <!-- files from dependencies to merge into main distribution jar -->
123          <resources id="depfiles">          <resources id="depfiles">
124                  <zipfileset src="${dep.commons-lang}" includes="**/*.class"/>                  <zipfileset src="${dep.commons-lang}" includes="**/*.class"/>
125                  <zipfileset src="${dep.commons-cli}" includes="**/*.class"/>                  <zipfileset src="${dep.commons-cli}" includes="**/*.class"/>
# Line 136  Line 139 
139                  <zipfileset src="${dep.winregistry}" includes="**/*.class"/>                  <zipfileset src="${dep.winregistry}" includes="**/*.class"/>
140                  <zipfileset src="${dep.bouncycastle.smime}" includes="**/*.class"/>                  <zipfileset src="${dep.bouncycastle.smime}" includes="**/*.class"/>
141                  <zipfileset src="${dep.bouncycastle.tsp}" includes="**/*.class"/>                  <zipfileset src="${dep.bouncycastle.tsp}" includes="**/*.class"/>
142                  <zipfileset src="${dep.javamail}">                  <zipfileset src="${dep.javamail}" includes="**/*.class"/>
                         <include name="com/sun/mail/handlers/**.class"/>  
                         <include name="com/sun/mail/iap/**.class"/>  
                         <include name="com/sun/mail/util/**.class"/>  
                         <include name="javax/mail/*.class"/>  
                         <include name="javax/mail/**/*.class"/>  
                 </zipfileset>  
143                  <zipfileset src="${dep.activation}" includes="**/*.class"/>                  <zipfileset src="${dep.activation}" includes="**/*.class"/>
144          </resources>          </resources>
145                    
# Line 151  Line 148 
148            - Initialisation and other setup            - Initialisation and other setup
149            -->            -->
150    
151          <!-- keystore; create one if not supplied -->          <!-- keystore; create one with test certificate if not supplied -->
152          <available file="${keystore.file}" type="file" property="keystore.available"/>          <available file="${keystore.file}" type="file" property="keystore.available"/>
153          <target name="keystore" unless="keystore.available">          <target name="keystore" unless="keystore.available">
154                  <tempfile property="keystore.file" prefix="keystore" suffix=".ks"/>                  <tempfile property="keystore.file" prefix="keystore" suffix=".ks"/>
# Line 212  Line 209 
209          <!--          <!--
210            -  Full JAR creation target            -  Full JAR creation target
211            -->            -->
212          <target name="jar.large" depends="compile">          <target name="jar.large" depends="compile,jar.bcprov">
213                  <jar jarfile="${dir.dist}/${target.name}.large.jar">                  <jar jarfile="${dir.dist}/${target.name}.large.jar">
214                          <manifest>                          <manifest>
215                                  <attribute name="Built-By" value="${user.name}"/>                                  <attribute name="Built-By" value="${user.name}"/>
# Line 232  Line 229 
229          <target name="jar.small" depends="jar.large">          <target name="jar.small" depends="jar.large">
230                  <!-- minimize jar file; skipnonpubliclibraryclasses needed for java1.6 -->                  <!-- minimize jar file; skipnonpubliclibraryclasses needed for java1.6 -->
231                  <proguard obfuscate="false" skipnonpubliclibraryclasses="false" verbose="true">                  <proguard obfuscate="false" skipnonpubliclibraryclasses="false" verbose="true">
232                          <injar file="${dir.dist}/${target.name}.large.jar"/>                          <!-- filter out activation classes when building on java6 to avoid clashing with
233                                 system classes. These are added at the end when needed to make sure it runs
234                                 on java5 as well -->
235                            <injar file="${dir.dist}/${target.name}.large.jar" filter="${dep.activation.pgfilter}"/>
236                          <outjar file="${dir.dist}/${target.name}.small.jar"/>                          <outjar file="${dir.dist}/${target.name}.small.jar"/>
237                          <libraryjar file="${java.home}/lib/rt.jar"/>                          <libraryjar file="${java.home}/lib/rt.jar"/>
238                          <libraryjar file="${java.home}/lib/jce.jar"/>                          <libraryjar file="${java.home}/lib/jce.jar"/>
239                          <libraryjar file="${java.home}/lib/jsse.jar"/>                          <libraryjar file="${java.home}/lib/jsse.jar"/>
                         <libraryjar file="${java.home}/lib/javaws.jar"/>  
240                          <libraryjar file="${dep.bouncycastle}"/>                          <libraryjar file="${dep.bouncycastle}"/>
241                          <libraryjar file="${dep.junit}"/>                          <libraryjar file="${dep.junit}"/>
242                          <libraryjar file="${dep.abbot}"/>                          <libraryjar file="${dep.abbot}"/>
243                            <!-- program entry point, keep this! -->
244                          <keepclasseswithmembers access="public">                          <keepclasseswithmembers access="public">
245                                  <method access="public static" type="void"                                  <method access="public static" type="void" name="main" parameters="java.lang.String[]"/>
                                         name="main" parameters="java.lang.String[]"/>  
246                          </keepclasseswithmembers>                          </keepclasseswithmembers>
247                          <!-- Somehow xhtmlrenderer classes are stripped too much, this is a workaround. Error e.g.                          <!-- Somehow xhtmlrenderer classes are stripped too much, this is a workaround. Error e.g.
248                               "Invalid index 2 in LocalVariableTable in class file org/xhtmlrenderer/render/Box" -->                               "Invalid index 2 in LocalVariableTable in class file org/xhtmlrenderer/render/Box" -->
# Line 273  Line 272 
272                          <keepclasseswithmembers name="javax.mail.internet.MimeBodyPart"> <method name="*"/></keepclasseswithmembers>                          <keepclasseswithmembers name="javax.mail.internet.MimeBodyPart"> <method name="*"/></keepclasseswithmembers>
273                          <keepclasseswithmembers name="javax.activation.ActivationDataFlavor"> <method name="*"/></keepclasseswithmembers>                          <keepclasseswithmembers name="javax.activation.ActivationDataFlavor"> <method name="*"/></keepclasseswithmembers>
274                  </proguard>                  </proguard>
275                    <!-- add activation framework when building on java6 -->
276                    <antcall target="jar.small-add.activation"/>
277          </target>          </target>
278            
279            <!--
280              - Target to add java activation framework to small jar
281              -  Since the java activation framework is present on java6, we can't include it in
282              -  the proguard step. But to make the resulting jar work on java6 as well, the
283              -  framework still needs to be present in the final jar. This target adds these
284              -  classes only if they're not already present in the final small jar.
285              -->
286            <target name="jar.small-add.activation">
287                    <condition property="dep.activation.needpostadd">
288                            <not>
289                                    <available classname="javax.activation.DataSource" classpath="${dir.dist}/${target.name}.small.jar" ignoresystemclasses="true"/>
290                            </not>
291                    </condition>
292                    <antcall target="jar.small-add.activation-do"/>
293            </target>
294            <target name="jar.small-add.activation-do" if="dep.activation.needpostadd">
295                    <jar destfile="${dir.dist}/${target.name}.small.jar" update="true" duplicate="fail">
296                            <zipfileset src="${dep.activation}" includes="**/*.class"/>
297                    </jar>
298            </target>
299            
300            <!--
301              - BouncyCastle copy target (dependency as external jar)
302              -->
303            <target name="jar.bcprov">
304                    <!-- copy bouncycastle jar to deployment area; also sign it -->
305                    <copy file="${dep.bouncycastle}" tofile="${dir.dist}/${target.bouncycastle}.jar"/>
306            </target>
307            
308          <!--          <!--
309            - Distribution creation target            - Distribution creation target
310            -->            -->
311          <target name="dist" depends="keystore,jar.small,jar.testgui">          <target name="dist" depends="keystore,jar.small,jar.testgui,jar.bcprov">
312                  <!-- copy large/small jar to distribution -->                  <!-- copy large/small jar to distribution -->
313                  <copy file="${dir.dist}/${target.name}.small.jar" tofile="${dir.dist}/${target.name}.jar"/>                  <copy file="${dir.dist}/${target.name}.small.jar" tofile="${dir.dist}/${target.name}.jar"/>
314                  <!-- sign, required for java web start -->                  <!-- sign, required for java web start -->
# Line 298  Line 328 
328                          <replacefilter token="@tests.name@" value="${tests.guitarget.name}"/>                          <replacefilter token="@tests.name@" value="${tests.guitarget.name}"/>
329                          <replacefilter token="@bouncycastle@" value="${target.bouncycastle}"/>                          <replacefilter token="@bouncycastle@" value="${target.bouncycastle}"/>
330                  </replace>                  </replace>
                 <!-- copy bouncycastle jar to deployment area; also sign it -->  
                 <copy file="${dep.bouncycastle}" tofile="${dir.dist}/${target.bouncycastle}.jar"/>  
331                  <signjar keystore="${keystore.file}" jar="${dir.dist}/${target.bouncycastle}.jar"                  <signjar keystore="${keystore.file}" jar="${dir.dist}/${target.bouncycastle}.jar"
332                          alias="${keystore.alias}" storepass="${keystore.passwd}"/>                          alias="${keystore.alias}" storepass="${keystore.passwd}"/>
333                  <delete file="${keystore.tempfile}" quiet="true"/>                  <delete file="${keystore.tempfile}" quiet="true"/>
# Line 361  Line 389 
389                          <zipfileset src="${dep.abbot}"/>                          <zipfileset src="${dep.abbot}"/>
390                  </jar>                  </jar>
391          </target>          </target>
392            
393          <!-- user test runner -->          <!-- user test runner -->
394          <target name="jar.testgui" depends="jar.tests,keystore">          <target name="jar.testgui" depends="jar.tests,keystore">
395                  <!-- create file with jar names -->                  <!-- create file with jar names -->

Legend:
Removed from v.1371  
changed lines
  Added in v.1372

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28