annotate build.xml @ 45:ca8a23bae4fa

Adjust spacing in preferences.
author David Barts <n5jrn@me.com>
date Mon, 10 Feb 2020 06:55:07 -0700
parents 99220aa136d9
children 19d9da731c43
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
25
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
2 <project name="ClipMan" default="help" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
0
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
3 <!-- import all environment variables as env.* -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
4 <property environment="env"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
5
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
6 <!-- ensure required environment variables are set -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
7 <macrodef name="env-require">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
8 <attribute name="name"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
9 <sequential>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
10 <fail message="Environment variable @{name} not set!">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
11 <condition>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
12 <not><isset property="env.@{name}"/></not>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
13 </condition>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
14 </fail>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
15 </sequential>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
16 </macrodef>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
17 <env-require name="JRE_HOME"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
18 <env-require name="KOTLIN_HOME"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
19
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
20 <!-- define the kotlin task -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
21 <property name="kotlin.lib" value="${env.KOTLIN_HOME}/libexec/lib"/>
25
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
22 <typedef resource="org/jetbrains/kotlin/ant/antlib.xml"
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
23 classpath="${kotlin.lib}/kotlin-ant.jar"/>
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
24
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
25 <!-- define the package-building tasks -->
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
26 <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
27 uri="javafx:com.sun.javafx.tools.ant"
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
28 classpath="${env.JRE_HOME}/lib/ant-javafx.jar"/>
0
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
29
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
30 <!-- cribbed from https://stackoverflow.com/questions/7129672/uppercase-lowercase-capitalize-an-ant-property -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
31 <scriptdef language="javascript" name="toLowerCase">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
32 <attribute name="value" />
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
33 <attribute name="target" />
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
34 <![CDATA[
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
35 project.setProperty( attributes.get( "target" ),
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
36 attributes.get( "value" ).toLowerCase() );
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
37 ]]>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
38 </scriptdef>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
39
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
40 <!-- Define the properties used by the build -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
41 <property name="app.name" value="${ant.project.name}"/>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
42 <property name="app.entry" value="name.blackcap.clipman.MainKt"/>
0
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
43 <toLowerCase target="lc.app.name" value="${app.name}"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
44 <property name="jar.name" value="${basedir}/${lc.app.name}.jar"/>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
45 <property name="work.jar" value="${basedir}/work.jar"/>
0
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
46 <property name="lib.home" value="${basedir}/lib"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
47 <property name="src.home" value="${basedir}/src"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
48
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
49 <!-- help message -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
50 <target name="help">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
51 <echo>You can use the following targets:</echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
52 <echo> </echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
53 <echo> help : (default) Prints this message </echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
54 <echo> all : Cleans, compiles, and stages application</echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
55 <echo> clean : Deletes work directories</echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
56 <echo> compile : Compiles servlets into class files</echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
57 <echo> jar : Make JAR file.</echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
58 <echo> </echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
59 <echo>For example, to clean, compile, and package all at once, run:</echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
60 <echo>prompt> ant all </echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
61 </target>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
62
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
63 <!-- Define the CLASSPATH -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
64 <target name="classpath">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
65 <path id="std.classpath">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
66 <fileset dir="${lib.home}">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
67 <include name="*.jar"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
68 </fileset>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
69 </path>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
70 <path id="compile.classpath">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
71 <path refid="std.classpath"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
72 <pathelement location="${src.home}"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
73 </path>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
74 <path id="test.classpath">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
75 <path refid="std.classpath"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
76 <pathelement location="${work.home}"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
77 </path>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
78 </target>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
79
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
80 <!-- do everything but install -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
81 <target name="all" depends="jar"
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
82 description="Clean work dirs, compile, make JAR."/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
83
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
84 <!-- compile *.kt to *.class -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
85 <target name="compile" depends="classpath"
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
86 description="Compile Java sources to ${work.home}">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
87 <kotlinc src="${src.home}" output="${work.jar}"
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
88 classpathref="compile.classpath"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
89 </target>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
90
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
91 <!-- make .jar file -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
92 <target name="jar" depends="compile" description="Create JAR file.">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
93 <jar destfile="${jar.name}">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
94 <manifest>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
95 <attribute name="Main-Class" value="${app.entry}"/>
0
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
96 </manifest>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
97 <zipgroupfileset dir="${lib.home}" includes="*.jar"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
98 <zipfileset src="${work.jar}"/>
42
99220aa136d9 Add default.properties.
David Barts <n5jrn@me.com>
parents: 27
diff changeset
99 <zipfileset dir="${src.home}" includes="**/*.properties"/>
0
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
100 </jar>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
101 </target>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
102
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
103 <!-- for making bundled apps -->
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
104 <macrodef name="bundle">
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
105 <attribute name="type"/>
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
106 <element name="args"/>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
107 <sequential>
25
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
108 <fx:deploy nativeBundles="@{type}" outdir="${basedir}" outfile="${app.name}"
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
109 signBundle="false">
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
110 <fx:application mainClass="${app.entry}" name="${app.name}" toolkit="swing"
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
111 version="1.0"/>
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
112 <fx:info description="ClipMan, a clipboard manager." title="${app.name}"
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents: 25
diff changeset
113 vendor="David Barts &lt;n5jrn@me.com&gt;"
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents: 25
diff changeset
114 copyright="© MMXX, David W. Barts"/>
25
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
115 <fx:resources>
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
116 <fx:fileset dir="${basedir}" includes="${lc.app.name}.jar"/>
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
117 </fx:resources>
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
118 <fx:bundleArgument arg="runtime" value="${env.JRE_HOME}"/>
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
119 <args/>
25
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
120 </fx:deploy>
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
121 </sequential>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
122 </macrodef>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
123
25
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
124 <target name="macapp" depends="jar" description="Create MacOS app bundle.">
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
125 <bundle type="image">
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
126 <args>
25
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
127 <fx:bundleArgument arg="jvmOptions" value="-Xdock:name=${app.name}"/>
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
128 </args>
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
129 </bundle>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
130 </target>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
131
25
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
132 <target name="app" depends="jar" description="Create app bundle.">
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
133 <bundle type="image"/>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
134 </target>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
135
25
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
136 <target name="rpm" depends="jar" description="Create RPM package.">
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
137 <bundle type="rpm"/>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
138 </target>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
139
25
3129d0e24086 Use ant tasks, not <exec>.
David Barts <n5jrn@me.com>
parents: 23
diff changeset
140 <target name="deb" depends="jar" description="Create Debian package.">
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
141 <bundle type="deb"/>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
142 </target>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
143
0
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
144 </project>