annotate build.xml @ 24:dac8dfb4b549

Preliminary menu bar support.
author David Barts <n5jrn@me.com>
date Thu, 23 Jan 2020 19:25:17 -0800
parents 14049bc97a7c
children 3129d0e24086
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"?>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
2 <project name="ClipMan" default="help" basedir=".">
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"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
22 <typedef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
23
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
24 <!-- 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
25 <scriptdef language="javascript" name="toLowerCase">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
26 <attribute name="value" />
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
27 <attribute name="target" />
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
28 <![CDATA[
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
29 project.setProperty( attributes.get( "target" ),
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
30 attributes.get( "value" ).toLowerCase() );
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
31 ]]>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
32 </scriptdef>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
33
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
34 <!-- Define the properties used by the build -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
35 <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
36 <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
37 <toLowerCase target="lc.app.name" value="${app.name}"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
38 <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
39 <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
40 <property name="lib.home" value="${basedir}/lib"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
41 <property name="src.home" value="${basedir}/src"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
42
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
43 <!-- help message -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
44 <target name="help">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
45 <echo>You can use the following targets:</echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
46 <echo> </echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
47 <echo> help : (default) Prints this message </echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
48 <echo> all : Cleans, compiles, and stages application</echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
49 <echo> clean : Deletes work directories</echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
50 <echo> compile : Compiles servlets into class files</echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
51 <echo> jar : Make JAR file.</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>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
54 <echo>prompt> ant all </echo>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
55 </target>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
56
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
57 <!-- Define the CLASSPATH -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
58 <target name="classpath">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
59 <path id="std.classpath">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
60 <fileset dir="${lib.home}">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
61 <include name="*.jar"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
62 </fileset>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
63 </path>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
64 <path id="compile.classpath">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
65 <path refid="std.classpath"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
66 <pathelement location="${src.home}"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
67 </path>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
68 <path id="test.classpath">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
69 <path refid="std.classpath"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
70 <pathelement location="${work.home}"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
71 </path>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
72 </target>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
73
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
74 <!-- do everything but install -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
75 <target name="all" depends="jar"
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
76 description="Clean work dirs, compile, make JAR."/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
77
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
78 <!-- compile *.kt to *.class -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
79 <target name="compile" depends="classpath"
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
80 description="Compile Java sources to ${work.home}">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
81 <kotlinc src="${src.home}" output="${work.jar}"
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
82 classpathref="compile.classpath"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
83 </target>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
84
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
85 <!-- make .jar file -->
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
86 <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
87 <jar destfile="${jar.name}">
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
88 <manifest>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
89 <attribute name="Main-Class" value="${app.entry}"/>
0
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
90 </manifest>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
91 <zipgroupfileset dir="${lib.home}" includes="*.jar"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
92 <zipfileset src="${work.jar}"/>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
93 </jar>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
94 </target>
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
95
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
96 <!-- for making bundled apps -->
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
97 <macrodef name="bundle">
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
98 <attribute name="type"/>
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
99 <element name="args"/>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
100 <sequential>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
101 <exec executable="${env.JRE_HOME}/bin/javapackager" dir="${basedir}">
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
102 <env key="JAVA_HOME" value="${env.JRE_HOME}"/>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
103 <arg value="-deploy"/>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
104 <arg value="-Bruntime=${env.JRE_HOME}"/>
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
105 <arg value="-description"/> <arg value="ClipMan, a clipboard manager."/>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
106 <arg value="-native"/> <arg value="@{type}"/>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
107 <arg value="-srcfiles"/> <arg value="${jar.name}"/>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
108 <arg value="-outdir"/> <arg value="${basedir}"/>
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
109 <arg value="-outfile"/> <arg value="${app.name}"/>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
110 <arg value="-appclass"/> <arg value="${app.entry}"/>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
111 <arg value="-name"/> <arg value="${app.name}"/>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
112 <arg value="-title"/> <arg value="${app.name}"/>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
113 <arg value="-vendor"/> <arg value="David Barts &lt;n5jrn@me.com&gt;"/>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
114 <arg value="-nosign"/>
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
115 <args/>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
116 </exec>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
117 </sequential>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
118 </macrodef>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
119
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
120 <target name="dmg" depends="jar" description="Create MacOS app bundle.">
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
121 <bundle type="dmg">
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
122 <args>
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
123 <arg value="-BjvmOptions=-Xdock:name=${app.name}"/>
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
124 </args>
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
125 </bundle>
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
126 </target>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
127
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
128 <target name="pkg" depends="jar" description="Create MacOS app bundle.">
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
129 <bundle type="pkg">
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
130 <args>
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
131 <arg value="-BjvmOptions=-Xdock:name=${app.name}"/>
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
132 </args>
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
133 </bundle>
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
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
136 <target name="rpm" depends="jar" description="Create MacOS app bundle.">
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
23
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
140 <target name="exe" depends="jar" description="Create MacOS app bundle.">
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
141 <bundle type="exe"/>
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
142 </target>
14049bc97a7c More package stuff.
David Barts <n5jrn@me.com>
parents: 22
diff changeset
143
22
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
144 <target name="deb" depends="jar" description="Create MacOS app bundle.">
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
145 <bundle type="deb"/>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
146 </target>
829769cb1c13 Add some support for making bundled apps to build.xml.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
147
0
be282c48010a Incomplete; checking it in as a backup.
David Barts <n5jrn@me.com>
parents:
diff changeset
148 </project>