annotate build.xml @ 33:3d86f0391168

Work on improving the build system.
author David Barts <davidb@stashtea.com>
date Fri, 24 Apr 2020 19:45:57 -0700
parents 985d5b82a882
children d175593317a8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
33
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
2 <project name="JpegWasher" default="help" basedir="."
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
3 xmlns:contrib="antlib:net.sf.antcontrib"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
4 xmlns:jarbundler="antlib:com.ultramixer.jarbundler"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
5 xmlns:launch4j="antlib:net.sf.launch4j.ant"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
6 xmlns:mod="antlib:de.masters_of_disaster.ant.tasks">
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
7 <!-- import all environment variables as env.* -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
8 <property environment="env"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
9
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
10 <!-- ensure required environment variables are set -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
11 <macrodef name="env-require">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
12 <attribute name="name"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
13 <sequential>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
14 <fail message="Environment variable @{name} not set!">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
15 <condition>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
16 <not><isset property="env.@{name}"/></not>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
17 </condition>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
18 </fail>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
19 </sequential>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
20 </macrodef>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
21 <env-require name="JRE_HOME"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
22 <env-require name="KOTLIN_HOME"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
23
33
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
24 <!-- load launch4j (Windows app builder) -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
25 <!-- load m-o-d (Linux Gnome app builder) -->
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
26
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
27 <!-- cribbed from https://stackoverflow.com/questions/7129672/uppercase-lowercase-capitalize-an-ant-property -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
28 <scriptdef language="javascript" name="toLowerCase">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
29 <attribute name="value" />
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
30 <attribute name="target" />
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
31 <![CDATA[
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
32 project.setProperty( attributes.get( "target" ),
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
33 attributes.get( "value" ).toLowerCase() );
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
34 ]]>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
35 </scriptdef>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
36
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
37 <!-- Define the properties used by the build -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
38 <property name="app.name" value="${ant.project.name}"/>
23
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
39 <property name="app.version" value="1.03"/>
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
40 <property name="app.entry" value="name.blackcap.exifwasher.MainKt"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
41 <toLowerCase target="lc.app.name" value="${app.name}"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
42 <property name="jar.name" value="${basedir}/${lc.app.name}.jar"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
43 <property name="work.jar" value="${basedir}/work.jar"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
44 <property name="lib.home" value="${basedir}/lib"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
45 <property name="src.home" value="${basedir}/src"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
46 <property name="nat.dir" value="${src.home}/name/blackcap/exifwasher/exiv2"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
47 <property name="bin.dir" value="${src.home}/name/blackcap/exifwasher/binaries"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
48
33
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
49 <!-- load the ant-contrib tasks -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
50 <taskdef resource="net/sf/antcontrib/antlib.xml"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
51 uri="antlib:net.sf.antcontrib">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
52 <classpath>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
53 <fileset dir="${lib.home}/ant-contrib" includes="*.jar"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
54 </classpath>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
55 </taskdef>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
56
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
57 <!-- load jarbundler (Mac app bundler) tasks -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
58 <contrib:if>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
59 <os family="mac"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
60 <contrib:then>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
61 <taskdef name="create"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
62 classname="com.ultramixer.jarbundler.JarBundler"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
63 classpath="${lib.home}/jarbundler-core-3.3.0.jar"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
64 uri="antlib:com.ultramixer.jarbundler">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
65 </taskdef>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
66 </contrib:then>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
67 </contrib:if>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
68
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
69 <!-- load launch4j (Windows app bundler) tasks -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
70 <contrib:if>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
71 <os family="windows"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
72 <contrib:then>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
73 <taskdef name="create"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
74 classname="net.sf.launch4j.ant.Launch4jTask"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
75 uri="antlib:net.sf.launch4j.ant">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
76 <classpath>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
77 <fileset dir="${lib.dir}/launch4j" includes="*.jar"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
78 </classpath>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
79 </taskdef>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
80 </contrib:then>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
81 </contrib:if>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
82
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
83 <!-- load mod (Gnome app bundler) tasks -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
84 <contrib:if>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
85 <os family="unix"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
86 <contrib:then>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
87 <taskdef name="calculatesize"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
88 classname="de.masters_of_disaster.ant.tasks.calculatesize.CalculateSize"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
89 uri="antlib:de.masters_of_disaster.ant.tasks">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
90 <classpath>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
91 <fileset dir="${lib.dir}/mod" includes="*.jar"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
92 </classpath>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
93 </taskdef>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
94 <taskdef name="deb"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
95 classname="de.masters_of_disaster.ant.tasks.deb.Deb"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
96 uri="antlib:de.masters_of_disaster.ant.tasks"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
97 <classpath>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
98 <fileset dir="${lib.dir}/mod" includes="*.jar"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
99 </classpath>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
100 </taskdef>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
101 </contrib:then>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
102 </contrib:if>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
103
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
104 <!-- define the kotlin task -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
105 <property name="kotlin.lib" value="${env.KOTLIN_HOME}/lib"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
106 <typedef resource="org/jetbrains/kotlin/ant/antlib.xml"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
107 classpath="${kotlin.lib}/kotlin-ant.jar"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
108
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
109 <!-- help message -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
110 <target name="help">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
111 <echo>You can use the following targets:</echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
112 <echo> </echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
113 <echo> help : (default) Prints this message </echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
114 <echo> all : Cleans, compiles, and stages application</echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
115 <echo> clean : Deletes work directories</echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
116 <echo> compile : Compiles servlets into class files</echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
117 <echo> jar : Make JAR file.</echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
118 <echo> </echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
119 <echo>For example, to clean, compile, and package all at once, run:</echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
120 <echo>prompt> ant all </echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
121 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
122
33
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
123 <!-- Determine OS type -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
124 <condition property="os.type" value="mac">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
125 <os family="mac"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
126 </condition>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
127 <condition property="os.type" value="windows">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
128 <os family="windows"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
129 </condition>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
130 <condition property="os.type" value="linux">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
131 <!-- notes: 1) XXX not all non-mac UNIX systems are Linux, but this assumes
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
132 so; 2) this clause MUST appear AFTER the "mac" one -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
133 <os family="unix"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
134 </condition>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
135 <property name="os.type" value="unknown"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
136
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
137 <!-- Define the CLASSPATH -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
138 <target name="classpath">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
139 <path id="compile.classpath">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
140 <pathelement location="${src.home}"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
141 </path>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
142 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
143
26
985d5b82a882 Make needed dirs.
davidb
parents: 25
diff changeset
144 <!-- make needed directories -->
985d5b82a882 Make needed dirs.
davidb
parents: 25
diff changeset
145 <target name="mkdirs">
985d5b82a882 Make needed dirs.
davidb
parents: 25
diff changeset
146 <mkdir dir="${lib.home}"/>
33
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
147 <mkdir dir="${src.home}/name/blackcap/exifwasher/binaries/${os.type}"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
148 </target>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
149
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
150 <!-- rename files containing OS-dependant code -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
151 <target name="osdep">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
152 <exec executable="${env.JRE_HOME}/bin/java">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
153 <arg value="-jar"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
154 <arg value="../Osdep/osdep.jar"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
155 <arg value="${src.home}"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
156 </exec>
26
985d5b82a882 Make needed dirs.
davidb
parents: 25
diff changeset
157 </target>
985d5b82a882 Make needed dirs.
davidb
parents: 25
diff changeset
158
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
159 <!-- do everything but install -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
160 <target name="all" depends="jar"
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
161 description="Clean work dirs, compile, make JAR."/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
162
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
163 <!-- compile *.kt to *.class -->
33
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
164 <target name="compile" depends="mkdirs,osdep,classpath"
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
165 description="Compile Java sources to ${work.home}">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
166 <kotlinc src="${src.home}" output="${work.jar}"
5
dc1f4359659d Got it compiling.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
167 classpathref="compile.classpath">
dc1f4359659d Got it compiling.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
168 <compilerarg line="-jvm-target 1.8"/>
dc1f4359659d Got it compiling.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
169 </kotlinc>
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
170 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
171
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
172 <!-- make .jar file -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
173 <target name="jar" depends="compile" description="Create JAR file.">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
174 <jar destfile="${jar.name}">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
175 <manifest>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
176 <attribute name="Main-Class" value="${app.entry}"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
177 </manifest>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
178 <zipgroupfileset dir="${lib.home}" includes="*.jar"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
179 <zipfileset src="${work.jar}"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
180 <zipfileset dir="${src.home}" includes="**/*.properties,**/*.dll,**/*.so,**/*.dylib"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
181 </jar>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
182 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
183
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
184 <!-- for making bundled apps -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
185 <macrodef name="bundle">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
186 <attribute name="type"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
187 <element name="args"/>
11
e52fd1a575de Add Mac icons.
David Barts <n5jrn@me.com>
parents: 5
diff changeset
188 <element name="icons"/>
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
189 <sequential>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
190 <fx:deploy nativeBundles="@{type}" outdir="${basedir}" outfile="${app.name}"
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
191 signBundle="false">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
192 <fx:application mainClass="${app.entry}" name="${app.name}" toolkit="swing"
23
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
193 version="${app.version}"/>
25
5a5a7de27eb4 ExifWasher -> JpegWasher
David Barts <n5jrn@me.com>
parents: 23
diff changeset
194 <fx:info description="${app.name}" title="${app.name}"
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
195 vendor="David Barts &lt;n5jrn@me.com&gt;"
11
e52fd1a575de Add Mac icons.
David Barts <n5jrn@me.com>
parents: 5
diff changeset
196 copyright="© MMXX, David W. Barts">
e52fd1a575de Add Mac icons.
David Barts <n5jrn@me.com>
parents: 5
diff changeset
197 <icons/>
e52fd1a575de Add Mac icons.
David Barts <n5jrn@me.com>
parents: 5
diff changeset
198 </fx:info>
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
199 <fx:resources>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
200 <fx:fileset dir="${basedir}" includes="${lc.app.name}.jar"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
201 </fx:resources>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
202 <fx:bundleArgument arg="runtime" value="${env.JRE_HOME}"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
203 <args/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
204 </fx:deploy>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
205 </sequential>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
206 </macrodef>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
207
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
208 <target name="macapp" depends="jar" description="Create MacOS app bundle.">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
209 <bundle type="image">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
210 <args>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
211 <fx:bundleArgument arg="jvmOptions" value="-Xdock:name=${app.name}"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
212 </args>
11
e52fd1a575de Add Mac icons.
David Barts <n5jrn@me.com>
parents: 5
diff changeset
213 <icons>
25
5a5a7de27eb4 ExifWasher -> JpegWasher
David Barts <n5jrn@me.com>
parents: 23
diff changeset
214 <fx:icon href="${basedir}/${app.name}.icns"/>
11
e52fd1a575de Add Mac icons.
David Barts <n5jrn@me.com>
parents: 5
diff changeset
215 </icons>
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
216 </bundle>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
217 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
218
23
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
219 <target name="dummywork" description="dummy dir to make javapackager happy">
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
220 <mkdir dir="${work.home}"/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
221 <copy file="${jar.name}" tofile="${work.home}/${app.name}.jar"/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
222 </target>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
223
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
224 <!-- fx:deploy is broken on Windoze, must run javapackager command -->
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
225 <target name="winapp" depends="jar,dummywork" description="Create app bundle.">
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
226 <exec executable="${env.JRE_HOME}/bin/javapackager">
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
227 <arg value="-deploy"/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
228 <arg value="-Bicon=${app.name}.ico"/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
229 <arg value="-BappVersion=${app.version}"/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
230 <arg value="-title"/> <arg value="${app.name}"/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
231 <arg value="-appclass"/> <arg value="${app.entry}"/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
232 <arg value="-native"/> <arg value="image"/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
233 <arg value="-name"/> <arg value="${app.name}"/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
234 <arg value="-outdir"/> <arg value="."/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
235 <arg value="-outfile"/> <arg value="${app.name}"/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
236 <arg value="-srcdir"/> <arg value="${work.home}"/>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
237 </exec>
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
238 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
239
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
240 <target name="rpm" depends="jar" description="Create RPM package.">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
241 <bundle type="rpm"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
242 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
243
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
244 <target name="deb" depends="jar" description="Create Debian package.">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
245 <bundle type="deb"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
246 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
247
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
248 </project>