|
11 | 11 | <property name="dist.dir" value="dist"/> |
12 | 12 | <property name="docs.dir" value="build/docs"/> |
13 | 13 |
|
| 14 | + <!-- Javadoc external API links. Uses the JDK running Ant; no hard-coded Java version. --> |
| 15 | + <condition property="javadoc.api.url" value="https://docs.oracle.com/javase/8/docs/api/"> |
| 16 | + <equals arg1="${java.specification.version}" arg2="1.8"/> |
| 17 | + </condition> |
| 18 | + <condition property="javadoc.api.url" value="https://docs.oracle.com/en/java/javase/${java.specification.version}/docs/api/"> |
| 19 | + <not> |
| 20 | + <equals arg1="${java.specification.version}" arg2="1.8"/> |
| 21 | + </not> |
| 22 | + </condition> |
| 23 | + |
| 24 | + |
14 | 25 | <condition property="isMac"> |
15 | 26 | <os family="mac"/> |
16 | 27 | </condition> |
|
26 | 37 | <isset property="isMac"/> |
27 | 38 | </condition> |
28 | 39 |
|
| 40 | + <target name="preflight" description="Print toolchain/OS info"> |
| 41 | + <echo message="Java: ${java.runtime.name} ${java.runtime.version}"/> |
| 42 | + <echo message="Java Vendor: ${java.vendor}"/> |
| 43 | + <echo message="Java Home: ${java.home}"/> |
| 44 | + <echo message="Java Spec Version: ${java.specification.version}"/> |
| 45 | + <echo message="OS: ${os.name} ${os.version} (${os.arch})"/> |
| 46 | + </target> |
| 47 | + |
29 | 48 | <target name="clean" description="Remove all build and distribution files"> |
30 | 49 | <delete dir="build"/> |
31 | 50 | <delete dir="${dist.dir}"/> |
32 | 51 | </target> |
33 | 52 |
|
34 | | - <target name="compile" description="Compile Java source code"> |
| 53 | + <target name="compile" depends="preflight" description="Compile Java source code"> |
35 | 54 | <mkdir dir="${build.dir}"/> |
36 | 55 | <javac srcdir="${src.dir}" |
37 | 56 | destdir="${build.dir}" |
|
53 | 72 | <java jar="${jar.dir}/${app.name}.jar" fork="true"/> |
54 | 73 | </target> |
55 | 74 |
|
56 | | - <target name="javadoc" description="Generate API documentation with Javadoc"> |
| 75 | + <target name="javadoc" depends="preflight" description="Generate Javadoc (works for unnamed or named packages)"> |
57 | 76 | <mkdir dir="${docs.dir}"/> |
58 | 77 | <javadoc destdir="${docs.dir}" |
59 | | - sourcepath="${src.dir}" |
60 | | - packagenames="*" |
| 78 | + source="1.8" |
| 79 | + encoding="UTF-8" |
61 | 80 | use="true" |
62 | 81 | author="true" |
63 | | - version="true"/> |
| 82 | + version="true" |
| 83 | + failonerror="true"> |
| 84 | + <fileset dir="${src.dir}" includes="**/*.java"/> |
| 85 | + |
| 86 | + <link href="${javadoc.api.url}"/> |
| 87 | + <!-- Uncomment to resolve references in Javadoc comments. --> |
| 88 | + <!-- |
| 89 | + <classpath> |
| 90 | + <pathelement path="${build.dir}"/> |
| 91 | + <fileset dir="lib" includes="**/*.jar"/> |
| 92 | + </classpath> |
| 93 | + --> |
| 94 | + </javadoc> |
64 | 95 | </target> |
65 | 96 |
|
66 | 97 | <target name="package" description="Build the native installer for the current OS (DMG or DEB)"> |
|
79 | 110 | <arg value="--type"/><arg value="dmg"/> |
80 | 111 | <arg value="--icon"/><arg value="${icon.file}"/> |
81 | 112 | <arg value="--app-version"/><arg value="${app.version}"/> |
82 | | - |
83 | 113 | <arg value="--mac-package-name"/><arg value="${app.name}"/> |
84 | 114 | <arg value="--mac-package-identifier"/><arg value="com.example.${app.name}"/> |
85 | 115 | </exec> |
|
0 commit comments