annotate build.xml @ 37:4fdd2f7e2cec

Prune out more deadwood.
author David Barts <n5jrn@me.com>
date Fri, 01 May 2020 07:49:16 -0700
parents aa9ab6cbaa26
children 89d7f4d91f67
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"
37
4fdd2f7e2cec Prune out more deadwood.
David Barts <n5jrn@me.com>
parents: 36
diff changeset
5 xmlns:launch4j="antlib:net.sf.launch4j.ant">
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
6 <!-- import all environment variables as env.* -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
7 <property environment="env"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
8
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
9 <!-- ensure required environment variables are set -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
10 <macrodef name="env-require">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
11 <attribute name="name"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
12 <sequential>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
13 <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
14 <condition>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
15 <not><isset property="env.@{name}"/></not>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
16 </condition>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
17 </fail>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
18 </sequential>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
19 </macrodef>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
20 <env-require name="JRE_HOME"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
21 <env-require name="KOTLIN_HOME"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
22
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
23 <!-- 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
24 <scriptdef language="javascript" name="toLowerCase">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
25 <attribute name="value" />
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
26 <attribute name="target" />
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
27 <![CDATA[
34
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
28 "use strict";
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
29 project.setProperty( attributes.get( "target" ),
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
30 attributes.get( "value" ).toLowerCase() );
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
31 ]]>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
32 </scriptdef>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
33
35
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
34 <scriptdef language="javascript" name="du">
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
35 <attribute name="path" />
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
36 <attribute name="target" />
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
37 <![CDATA[
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
38 "use strict";
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
39 var File = Java.type('java.io.File');
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
40 function du(fp) {
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
41 if (fp.isDirectory()) {
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
42 var files = fp.listFiles();
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
43 if (!files) return 0;
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
44 var total = 0;
37
4fdd2f7e2cec Prune out more deadwood.
David Barts <n5jrn@me.com>
parents: 36
diff changeset
45 for (var i=0; i<files.length; i++)
35
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
46 total += du(files[i]);
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
47 return total;
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
48 } else {
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
49 return fp.length();
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
50 }
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
51 }
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
52 var path = new File(attributes.get("path"));
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
53 project.setProperty(attributes.get("target"),
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
54 Math.round(du(path) / 1024) + "");
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
55 ]]>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
56 </scriptdef>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
57
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
58 <!-- 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
59 <property name="app.name" value="${ant.project.name}"/>
23
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
60 <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
61 <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
62 <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
63 <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
64 <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
65 <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
66 <property name="src.home" value="${basedir}/src"/>
34
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
67 <property name="dist.home" value="${basedir}/dist"/>
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
68 <property name="pf.home" value="${basedir}/package-files"/>
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
69 <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
70 <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
71
33
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
72 <!-- load the ant-contrib tasks -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
73 <taskdef resource="net/sf/antcontrib/antlib.xml"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
74 uri="antlib:net.sf.antcontrib">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
75 <classpath>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
76 <fileset dir="${lib.home}/ant-contrib" includes="*.jar"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
77 </classpath>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
78 </taskdef>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
79
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
80 <!-- load jarbundler (Mac app bundler) tasks -->
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 <os family="mac"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
83 <contrib:then>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
84 <taskdef name="create"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
85 classname="com.ultramixer.jarbundler.JarBundler"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
86 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
87 uri="antlib:com.ultramixer.jarbundler">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
88 </taskdef>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
89 </contrib:then>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
90 </contrib:if>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
91
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
92 <!-- load launch4j (Windows app bundler) tasks -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
93 <contrib:if>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
94 <os family="windows"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
95 <contrib:then>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
96 <taskdef name="create"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
97 classname="net.sf.launch4j.ant.Launch4jTask"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
98 uri="antlib:net.sf.launch4j.ant">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
99 <classpath>
34
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
100 <fileset dir="${lib.home}/launch4j" includes="*.jar"/>
33
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
101 </classpath>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
102 </taskdef>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
103 </contrib:then>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
104 </contrib:if>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
105
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
106 <!-- define the kotlin task -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
107 <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
108 <typedef resource="org/jetbrains/kotlin/ant/antlib.xml"
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
109 classpath="${kotlin.lib}/kotlin-ant.jar"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
110
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
111 <!-- help message -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
112 <target name="help">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
113 <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
114 <echo> </echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
115 <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
116 <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
117 <echo> clean : Deletes work directories</echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
118 <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
119 <echo> jar : Make JAR file.</echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
120 <echo> </echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
121 <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
122 <echo>prompt> ant all </echo>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
123 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
124
33
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
125 <!-- Determine OS type -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
126 <condition property="os.type" value="mac">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
127 <os family="mac"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
128 </condition>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
129 <condition property="os.type" value="windows">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
130 <os family="windows"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
131 </condition>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
132 <condition property="os.type" value="linux">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
133 <!-- 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
134 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
135 <os family="unix"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
136 </condition>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
137 <property name="os.type" value="unknown"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
138
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
139 <!-- Define the CLASSPATH -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
140 <target name="classpath">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
141 <path id="compile.classpath">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
142 <pathelement location="${src.home}"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
143 </path>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
144 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
145
26
985d5b82a882 Make needed dirs.
davidb
parents: 25
diff changeset
146 <!-- make needed directories -->
985d5b82a882 Make needed dirs.
davidb
parents: 25
diff changeset
147 <target name="mkdirs">
34
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
148 <mkdir dir="${bin.dir}/${os.type}"/>
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
149 <mkdir dir="${dist.home}"/>
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
150 </target>
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
151
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
152 <!-- remove old cruft -->
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
153 <target name="clean">
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
154 <delete includeEmptyDirs="true">
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
155 <fileset dir="${dist.home}" includes="**/*"/>
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
156 <fileset dir="${bin.dir}"/>
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
157 </delete>
33
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
158 </target>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
159
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
160 <!-- rename files containing OS-dependant code -->
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
161 <target name="osdep">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
162 <exec executable="${env.JRE_HOME}/bin/java">
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
163 <arg value="-jar"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
164 <arg value="../Osdep/osdep.jar"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
165 <arg value="${src.home}"/>
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
166 </exec>
26
985d5b82a882 Make needed dirs.
davidb
parents: 25
diff changeset
167 </target>
985d5b82a882 Make needed dirs.
davidb
parents: 25
diff changeset
168
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
169 <!-- do everything but install -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
170 <target name="all" depends="jar"
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
171 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
172
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
173 <!-- compile *.kt to *.class -->
33
3d86f0391168 Work on improving the build system.
David Barts <davidb@stashtea.com>
parents: 26
diff changeset
174 <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
175 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
176 <kotlinc src="${src.home}" output="${work.jar}"
5
dc1f4359659d Got it compiling.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
177 classpathref="compile.classpath">
dc1f4359659d Got it compiling.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
178 <compilerarg line="-jvm-target 1.8"/>
dc1f4359659d Got it compiling.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
179 </kotlinc>
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
180 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
181
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
182 <!-- make .jar file -->
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
183 <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
184 <jar destfile="${jar.name}">
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
185 <manifest>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
186 <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
187 </manifest>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
188 <zipgroupfileset dir="${lib.home}" includes="*.jar"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
189 <zipfileset src="${work.jar}"/>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
190 <zipfileset dir="${src.home}" includes="**/*.properties,**/*.dll,**/*.so,**/*.dylib"/>
36
aa9ab6cbaa26 Duke has been banished from the dock.
David Barts <n5jrn@me.com>
parents: 35
diff changeset
191 <zipfileset file="${pf.home}/linux/icon_48x48.png"
aa9ab6cbaa26 Duke has been banished from the dock.
David Barts <n5jrn@me.com>
parents: 35
diff changeset
192 fullpath="name/blackcap/exifwasher/icon_48x48.png"/>
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
193 </jar>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
194 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
195
34
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
196 <!-- the packaging logic here is cribbed from what jEdit does -->
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
197
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
198 <target name="macapp" depends="jar" description="Create MacOS app bundle.">
34
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
199 <!-- not finished -->
23
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
200 </target>
5cac95c17fef More Windows stuff. Attempts to get Windows packages working.
davidb
parents: 22
diff changeset
201
34
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
202 <target name="winapp" depends="jar" description="Create app bundle.">
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
203 <!-- not finished -->
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
204 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
205
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
206 <target name="deb" depends="jar" description="Create Debian package.">
34
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
207 <sequential>
35
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
208 <mkdir dir="${dist.home}/data/usr/share/applications"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
209 <copy file="${pf.home}/linux/deb/jpegwasher.desktop"
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
210 tofile="${dist.home}/data/usr/share/applications/jpegwasher.desktop"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
211 <mkdir dir="${dist.home}/data/usr/share/icons/hicolor/48x48/apps"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
212 <copy file="${pf.home}/linux/icon_48x48.png"
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
213 tofile="${dist.home}/data/usr/share/icons/hicolor/48x48/apps/jpegwasher.png"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
214 <mkdir dir="${dist.home}/data/usr/share/jpegwasher"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
215 <copy file="${jar.name}" todir="${dist.home}/data/usr/share/jpegwasher"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
216 <mkdir dir="${dist.home}/data/usr/share/doc/jpegwasher"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
217 <copy todir="${dist.home}/data/usr/share/doc/jpegwasher">
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
218 <filelist dir="${basedir}" files="Readme.html,Readme.rst"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
219 <fileset file="${pf.home}/linux/deb/copyright"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
220 </copy>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
221 <gzip src="${pf.home}/linux/deb/changelog"
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
222 destfile="${dist.home}/data/usr/share/doc/jpegwasher/changelog.gz"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
223 <mkdir dir="${dist.home}/data/usr/share/man/man1"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
224 <gzip src="${pf.home}/linux/jpegwasher.1"
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
225 destfile="${dist.home}/data/usr/share/man/man1/jpegwasher.1.gz"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
226 <mkdir dir="${dist.home}/data/usr/bin"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
227 <copy todir="${dist.home}/data/usr/bin" encoding="UTF-8" overwrite="true">
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
228 <fileset file="${pf.home}/linux/jpegwasher"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
229 <filterset>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
230 <filter token="jar.filename" value="${lc.app.name}.jar"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
231 </filterset>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
232 </copy>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
233 <chmod file="${dist.home}/data/usr/bin/jpegwasher" perm="755"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
234 <du path="${dist.home}/data" target="deb.installed.size"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
235 <mkdir dir="${dist.home}/control"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
236 <copy todir="${dist.home}/control" encoding="UTF-8" overwrite="true">
34
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
237 <fileset file="${pf.home}/linux/deb/control"/>
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
238 <filterset>
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
239 <filter token="app.version" value="${app.version}"/>
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
240 <filter token="deb.installed.size" value="${deb.installed.size}"/>
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
241 </filterset>
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
242 </copy>
35
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
243 <copy todir="${dist.home}/control">
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
244 <filelist dir="${pf.home}/linux/deb" files="postinst,postrm"/>
34
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
245 </copy>
35
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
246 <chmod perm="755">
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
247 <filelist dir="${dist.home}/control" files="postinst,postrm"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
248 </chmod>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
249 <exec executable="${basedir}/make-debian-package">
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
250 <arg value="${dist.home}"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
251 <arg value="${lc.app.name}_${app.version}.deb"/>
bcbc92ffe0d0 Makes a .deb file at long last, but Duke still shows up as an icon in the dock.
David Barts <n5jrn@me.com>
parents: 34
diff changeset
252 </exec>
34
d175593317a8 Add a bunch of packaging stuff, NOT WORKING YET,
David Barts <n5jrn@me.com>
parents: 33
diff changeset
253 </sequential>
0
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
254 </target>
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
255
db63d01a23c6 JNI calls and test case (finally!) seem to work.
David Barts <n5jrn@me.com>
parents:
diff changeset
256 </project>