|
9 | 9 | <!-- Don't use or inherit the CLASSPATH environment variable for anything --> |
10 | 10 | <property name="build.sysclasspath" value="ignore" /> |
11 | 11 |
|
| 12 | + <property environment="env" /> |
| 13 | + <property name="java14-home" value="${env.JAVA14_HOME}" /> |
| 14 | + <property name="clover-jar" value="${env.CLOVER_JAR}" /> |
| 15 | + <property name="launch4j-home" value="${env.LAUNCH4J_HOME}" /> |
| 16 | + <property name="findbugs-home" value="${env.FINDBUGS_HOME}" /> |
| 17 | + |
12 | 18 | <!-- Extension containing various tools, including "for" and "if" --> |
13 | 19 | <taskdef resource="net/sf/antcontrib/antlib.xml" classpath="lib/buildlib/ant-contrib.jar"/> |
14 | 20 |
|
|
22 | 28 | <taskdef resource="com/cenqua/ant/antlib.xml" classpath="lib/buildlib/cenquatasks.jar" /> |
23 | 29 |
|
24 | 30 | <!-- fornum task, used for test-repeat --> |
25 | | - <taskdef name="fornum" classname="edu.rice.cs.plt.ant.ForNumTask" classpath="lib/buildlib/plt-ant.jar" onerror="report"/> |
26 | | - |
| 31 | + <taskdef name="fornum" classname="edu.rice.cs.plt.ant.ForNumTask" classpath="lib/buildlib/plt-ant.jar" onerror="report" /> |
| 32 | + |
| 33 | + <!-- findbugs task --> |
| 34 | + <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="lib/buildlib/findbugs-ant.jar" /> |
| 35 | + |
27 | 36 | <extendclasspath path="lib/buildlib/junit.jar" /> |
28 | | - <extendclasspath path="lib/buildlib/findbugs-ant.jar" /> |
29 | | - |
30 | | - <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/> |
31 | 37 |
|
32 | 38 | <!-- Load the property file if it exists --> |
33 | 39 | <if> |
|
48 | 54 | <property name="is-development" value="yes" /> <!-- Development or stable release --> |
49 | 55 | <property name="tag-append" value="" /> <!-- "stable", "beta", or none --> |
50 | 56 |
|
51 | | - <property environment="env" /> |
52 | | - <property name="java14-home" value="${env.JAVA14_HOME}" /> |
53 | | - <property name="clover-jar" value="${env.CLOVER_JAR}" /> |
54 | | - |
55 | 57 | <!-- Default settings for properties --> |
56 | 58 | <property name="test-spec" value="*" /> |
57 | 59 | <property name="test-repeat" value="1" /> |
|
89 | 91 | <echo message="JAVA14_HOME: Home folder of the Java 1.4 JRE or J2SDK" /> |
90 | 92 | <echo message="PATH: 'svn' needs to refer to the Subversion client executable" /> |
91 | 93 | <echo message="CLOVER_JAR: Location of the Clover jar file" /> |
| 94 | + <echo message="FINDBUGS_HOME: Location of the FindBugs installation" /> |
| 95 | + <echo message="LAUNCH4J_HOME: Location of the Launch4j installation (used to " /> |
| 96 | + <echo message=" generate a Windows application)." /> |
92 | 97 | <echo message="" /> |
93 | 98 | <echo message="Ant may also require the following, depending on your platform:" /> |
94 | 99 | <echo message="JAVA_HOME: Location of the JDK (many targets here require Java 5+)" /> |
|
345 | 350 |
|
346 | 351 | </target> |
347 | 352 |
|
| 353 | + <!-- >--> |
| 354 | + |
| 355 | + <target name="findbugs" depends="assert-findbugs-exists, compile-15" |
| 356 | + description="Generate a findbugs report in findbugs.html (after compiling)"> |
| 357 | + <delete file="${basedir}/findbugs.html" /> |
| 358 | + <findbugs home="${findbugs-home}" output="html" jvmargs="-Xmx512M" failOnError="true" |
| 359 | + outputFile="findbugs.html" timeout="1800000" |
| 360 | + excludeFilter="${basedir}/lib/buildlib/findbugs-filter.xml"> |
| 361 | + <auxclasspath> |
| 362 | + <pathelement location="${java15-tools}" /> |
| 363 | + <fileset refid="libs" /> |
| 364 | + <pathelement location="lib/buildlib/junit.jar" /> |
| 365 | + </auxclasspath> |
| 366 | + <sourcepath path="src" /> |
| 367 | + <class location="classes/base" /> |
| 368 | + <class location="classes/test" /> |
| 369 | + </findbugs> |
| 370 | + </target> |
| 371 | + |
348 | 372 |
|
349 | 373 | <!-- *************** |
350 | 374 | Testing Targets |
|
610 | 634 | </java> |
611 | 635 | </target> |
612 | 636 |
|
613 | | - <!-- *************** |
614 | | - FindBugs Target |
615 | | - Need to have FindBugs 1.3.1 installed and set the |
616 | | - FINDBUGS_HOME environment variable to that directory. |
617 | | - *************** --> |
618 | | - <target name="findbugs" depends="jar" description="Run findbugs 1.3.1 on the drjava code base creating the file findbugs.html"> |
619 | | - <available property="findbugs-exists" file="${env.FINDBUGS_HOME}/lib/findbugs.jar" /> |
620 | | - <fail message="FindBugs installation not found, or FINDBUGS_HOME environment variable not set." |
621 | | - unless="findbugs-exists" /> |
622 | | - <delete file="${basedir}/findbugs.html" /> |
623 | | - <findbugs home="${env.FINDBUGS_HOME}" |
624 | | - output="html" |
625 | | - jvmargs="-Xmx512M" |
626 | | - failOnError="true" |
627 | | - outputFile="${basedir}/findbugs.html" |
628 | | - timeout="1800000" |
629 | | - excludeFilter="${basedir}/lib/buildlib/findbugs-filter.xml"> |
630 | | - <auxClasspath path="${java15-tools}"/> |
631 | | - <sourcePath path="${basedir}/src"/> |
632 | | - <class location="${basedir}/${ant.project.name}-15.jar"/> |
633 | | - </findbugs> |
634 | | - </target> |
635 | 637 |
|
636 | 638 | <!-- *********** |
637 | 639 | Jar Targets |
|
915 | 917 | <delete dir="benchmarkSources" failonerror="${clean-can-fail}" /> |
916 | 918 | <delete dir="benchmarkResults" failonerror="${clean-can-fail}" /> |
917 | 919 |
|
918 | | - <delete failonerror="${clean-can-fail}"> |
| 920 | + <delete includeemptydirs="true" failonerror="${clean-can-fail}"> |
919 | 921 | <fileset dir="testFiles"> |
920 | 922 | <exclude name="**" /> |
921 | 923 | <!-- Additional test output files should be listed here --> |
922 | 924 | </fileset> |
923 | | - </delete> |
924 | | - |
925 | | - <delete includeemptydirs="true" failonerror="${clean-can-fail}"> |
926 | 925 | <fileset dir="${basedir}"> |
927 | 926 | <patternset refid="generated-sources" /> |
928 | 927 | </fileset> |
929 | | - </delete> |
930 | | - |
931 | | - <delete includeemptydirs="true" failonerror="${clean-can-fail}"> |
932 | 928 | <fileset dir="${basedir}" defaultexcludes="no"> |
933 | 929 | <include name="TEST*" /> |
934 | 930 | <include name="src/**/*.class" /> |
|
943 | 939 | </delete> |
944 | 940 |
|
945 | 941 | </target> |
946 | | - |
| 942 | + |
947 | 943 | <target name="clean-products" unless="skip-clean"> |
948 | 944 | <echo message="Deleting all final build products" /> |
949 | 945 |
|
|
954 | 950 | <include name="*.jar" /> |
955 | 951 | <include name="*.zip" /> |
956 | 952 | <include name="*.tar.gz" /> |
957 | | - <include name="${ant.project.name}-*" /> |
| 953 | + <include name="findbugs.html" /> |
958 | 954 | </fileset> |
959 | 955 | </delete> |
960 | | - |
961 | | - <delete file="${basedir}/findbugs.html" /> |
| 956 | + |
962 | 957 | </target> |
963 | 958 |
|
964 | 959 |
|
|
1059 | 1054 | <mkdir dir="${mac-app-dir}" /> |
1060 | 1055 | <filter token="VERSION" value="${version-tag}" /> |
1061 | 1056 | <copy todir="${mac-app-dir}/${readable-project-name}.app" filtering="yes" > |
1062 | | - <fileset dir="packaging/${readable-project-name}.app" excludes="**/*jar-goes-here" /> |
| 1057 | + <fileset dir="packaging/mac/${readable-project-name}.app" excludes="**/*jar-goes-here" /> |
1063 | 1058 | </copy> |
1064 | 1059 | <copy file="${ant.project.name}.jar" |
1065 | 1060 | todir="${mac-app-dir}/${readable-project-name}.app/Contents/Resources/Java" /> |
1066 | | - <tar tarfile="${mac-app-dir}/${version-tag}-osx.tar"> |
1067 | | - <tarfileset dir="${mac-app-dir}" includes="${readable-project-name}.app/**" |
1068 | | - excludes="${readable-project-name}.app/Contents/MacOS/${readable-project-name}" /> |
1069 | | - <tarfileset dir="${mac-app-dir}" mode="755" |
1070 | | - includes="${readable-project-name}.app/Contents/MacOS/${readable-project-name}" /> |
1071 | | - </tar> |
1072 | | - <gzip src="${mac-app-dir}/${version-tag}-osx.tar" destfile="${version-tag}-osx.tar.gz" /> |
1073 | | - </target> |
1074 | | - |
1075 | | - <target name="windows-app" depends="assert-jar-exists, resolve-version-tag"> |
1076 | | - <echo message="Creating ${version-tag}.exe" /> |
1077 | | - <concat destfile="${version-tag}.exe" binary="yes"> |
1078 | | - <filelist dir="${basedir}"> |
1079 | | - <!-- TODO: This should probably include WinExecutor.exe and the icon file |
1080 | | - rather than using the generated WinExecutorFor... --> |
1081 | | - <file name="packaging/WinExecutorFor${readable-project-name}.exe" /> |
1082 | | - <file name="${ant.project.name}.jar" /> |
1083 | | - </filelist> |
1084 | | - </concat> |
| 1061 | + <zip destfile="${version-tag}-osx.zip" basedir="${mac-app-dir}" /> |
| 1062 | + </target> |
| 1063 | + |
| 1064 | + <target name="windows-app" depends="assert-jar-exists, assert-launch4j-exists, resolve-version-tag"> |
| 1065 | + <!-- launch4j task, used to create the Windows executable --> |
| 1066 | + <echo message="Creating ${version-tag}-windows.zip" /> |
| 1067 | + <taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask"> |
| 1068 | + <classpath> |
| 1069 | + <pathelement location="${launch4j-home}/launch4j.jar" /> |
| 1070 | + <pathelement location="${launch4j-home}/lib/xstream.jar" /> |
| 1071 | + </classpath> |
| 1072 | + </taskdef> |
| 1073 | + <property name="windows-app-dir" value="${version-tag}/windows" /> |
| 1074 | + <mkdir dir="${windows-app-dir}" /> |
| 1075 | + <filter token="VERSION" value="${version-tag}" /> |
| 1076 | + <copy todir="${windows-app-dir}" filtering="yes" > |
| 1077 | + <fileset dir="packaging/windows" /> |
| 1078 | + </copy> |
| 1079 | + <copy file="${ant.project.name}.jar" todir="${windows-app-dir}" /> |
| 1080 | + <launch4j configfile="${windows-app-dir}/launch4j-config.xml" /> |
| 1081 | + <zip destfile="${version-tag}-windows.zip" basedir="${windows-app-dir}" |
| 1082 | + includes="${readable-project-name}.exe" /> |
1085 | 1083 | </target> |
1086 | 1084 |
|
1087 | 1085 | <target name="src-zip" depends="resolve-version-tag"> |
|
1244 | 1242 | <fail message="${clover-jar} does not exist" unless="clover-jar-exists" /> |
1245 | 1243 | </target> |
1246 | 1244 |
|
| 1245 | + <target name="assert-launch4j-exists"> |
| 1246 | + <available property="launch4j-exists" file="${launch4j-home}/launch4j.jar" /> |
| 1247 | + <fail message="${launch4j-home}/launch4j.jar does not exist" unless="launch4j-exists" /> |
| 1248 | + </target> |
| 1249 | + |
| 1250 | + <target name="assert-findbugs-exists"> |
| 1251 | + <available property="findbugs-exists" file="${findbugs-home}/lib/findbugs.jar" /> |
| 1252 | + <fail message="${findbugs-home}/lib/findbugs.jar does not exist" unless="findbugs-exists" /> |
| 1253 | + </target> |
| 1254 | + |
1247 | 1255 | <target name="resolve-development-value"> |
1248 | 1256 | <condition property="development-value" value="true"> |
1249 | 1257 | <istrue value="${is-development}" /> |
|
0 commit comments