annotate build.xml @ 30:098c4f5507c7

Convert to JDK 15.
author David Barts <n5jrn@me.com>
date Mon, 13 Jun 2022 11:31:49 -0700
parents e90d290a9a8d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
2 <project name="ImagePrep" default="help" basedir=".">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
3 <!-- import all environment variables as env.* -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
4 <property environment="env"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
5
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
6 <!-- ensure required environment variables are set -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
7 <macrodef name="env-require">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
8 <attribute name="name"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
9 <sequential>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
10 <fail message="Environment variable @{name} not set!">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
11 <condition>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
12 <not><isset property="env.@{name}"/></not>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
13 </condition>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
14 </fail>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
15 </sequential>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
16 </macrodef>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
17 <env-require name="JRE_HOME"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
18 <env-require name="KOTLIN_HOME"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
19 <env-require name="OSDEP_HOME"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
20
29
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
21 <!-- du and toLowerCase need this -->
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
22 <property name="antlib.jar" value="${basedir}/antlib/antlib.jar"/>
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
23
29
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
24 <!-- turn a string to lower case -->
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
25 <taskdef name="toLowerCase" classname="ToLowerCase">
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
26 <classpath>
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
27 <pathelement location="${antlib.jar}"/>
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
28 </classpath>
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
29 </taskdef>
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
30
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
31 <!-- calculate disk usage in kbytes -->
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
32 <taskdef name="du" classname="Du">
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
33 <classpath>
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
34 <pathelement location="${antlib.jar}"/>
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
35 </classpath>
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
36 </taskdef>
28
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
37
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
38 <!-- Define the properties used by the build -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
39 <property name="app.name" value="${ant.project.name}"/>
29
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
40 <toLowerCase output="lc.app.name" value="${app.name}"/>
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
41 <property name="app.version" value="1.02"/>
2
a6f9b51d5e8d Got jar building.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
42 <property name="app.domain" value="name.blackcap.${lc.app.name}"/>
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
43 <property name="app.entry" value="${app.domain}.MainKt"/>
29
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
44 <property name="app.copyright" value="Copyright © 2020–2022, David W. Barts."/>
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
45 <property name="jar.name" value="${basedir}/${lc.app.name}.jar"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
46 <property name="work.jar" value="${basedir}/work.jar"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
47 <property name="lib.home" value="${basedir}/lib"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
48 <property name="src.home" value="${basedir}/src"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
49 <property name="dist.home" value="${basedir}/dist"/>
23
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
50 <property name="pf.home" value="${basedir}/package-files"/>
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
51 <property name="jvm.version" value="1.8"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
52
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
53 <!-- define the kotlin task -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
54 <property name="kotlin.lib" value="${env.KOTLIN_HOME}/lib"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
55 <typedef resource="org/jetbrains/kotlin/ant/antlib.xml"
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
56 classpath="${kotlin.lib}/kotlin-ant.jar"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
57
29
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
58 <target name="testIt">
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
59 <jshellTest message="This is a test." />
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
60 </target>
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
61
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
62 <!-- help message -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
63 <target name="help">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
64 <echo>You can use the following targets:</echo>
29
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
65 <echo>lc.app.name is ${lc.app.name}</echo>
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
66 <echo> </echo>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
67 <echo> help : (default) Prints this message </echo>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
68 <echo> all : Cleans, compiles, and stages application</echo>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
69 <echo> clean : Deletes work directories</echo>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
70 <echo> compile : Compiles servlets into class files</echo>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
71 <echo> jar : Make JAR file.</echo>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
72 <echo> </echo>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
73 <echo>For example, to clean, compile, and package all at once, run:</echo>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
74 <echo>prompt> ant all </echo>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
75 </target>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
76
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
77 <!-- Define the CLASSPATH -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
78 <target name="classpath">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
79 <path id="compile.classpath">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
80 <pathelement location="${src.home}"/>
4
5234e4500d45 Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents: 2
diff changeset
81 <fileset dir="${lib.home}">
5234e4500d45 Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents: 2
diff changeset
82 <include name="*.jar"/>
5234e4500d45 Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents: 2
diff changeset
83 </fileset>
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
84 </path>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
85 </target>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
86
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
87 <!-- make needed directories -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
88 <target name="mkdirs">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
89 <mkdir dir="${dist.home}"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
90 </target>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
91
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
92 <!-- remove old cruft -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
93 <target name="clean">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
94 <delete includeEmptyDirs="true" failonerror="false">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
95 <fileset dir="${dist.home}" includes="**/*"/>
29
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
96 <fileset file="${work.jar}"/>
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
97 <fileset file="${jar.name}"/>
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
98 </delete>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
99 </target>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
100
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
101 <!-- rename files containing OS-dependant code -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
102 <target name="osdep">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
103 <exec executable="${env.JRE_HOME}/bin/java" failonerror="true">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
104 <arg value="-jar"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
105 <arg file="${env.OSDEP_HOME}/osdep.jar"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
106 <arg value="${src.home}"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
107 </exec>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
108 </target>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
109
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
110 <!-- do everything but install -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
111 <target name="all" depends="jar"
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
112 description="Clean work dirs, compile, make JAR."/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
113
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
114 <!-- compile *.kt to *.class -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
115 <target name="compile" depends="mkdirs,osdep,classpath"
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
116 description="Compile Java sources to ${work.home}">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
117 <kotlinc src="${src.home}" output="${work.jar}"
29
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
118 noStdlib="false" includeRuntime="true"
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
119 classpathref="compile.classpath">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
120 <compilerarg line="-jvm-target ${jvm.version}"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
121 </kotlinc>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
122 </target>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
123
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
124 <!-- make .jar file -->
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
125 <target name="jar" depends="compile" description="Create JAR file.">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
126 <jar destfile="${jar.name}">
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
127 <manifest>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
128 <attribute name="Main-Class" value="${app.entry}"/>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
129 </manifest>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
130 <!-- <zipgroupfileset dir="${lib.home}" includes="*.jar"/> -->
4
5234e4500d45 Command-line arguments (only partially tested).
David Barts <n5jrn@me.com>
parents: 2
diff changeset
131 <zipgroupfileset dir="${lib.home}" includes="*.jar"/>
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
132 <zipfileset src="${work.jar}"/>
2
a6f9b51d5e8d Got jar building.
David Barts <n5jrn@me.com>
parents: 0
diff changeset
133 <zipfileset dir="${src.home}" includes="**/*.properties,**/*.html"/>
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
134 </jar>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
135 </target>
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
136
23
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
137 <target name="macapp" depends="jar" description="Create MacOS app bundle.">
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
138 <fail message="Macintosh packages can only be built on a Mac.">
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
139 <condition>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
140 <not><os family="mac"/></not>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
141 </condition>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
142 </fail>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
143 <sequential>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
144 <property name="mac.disk.image.filename"
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
145 value="${lc.app.name}_${app.version}.dmg"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
146 <property name="app.bundle" value="${dist.home}/${app.name}.app"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
147 <mkdir dir="${app.bundle}/Contents"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
148 <copy todir="${app.bundle}/Contents" encoding="UTF-8" overwrite="true">
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
149 <fileset file="${pf.home}/osx/Info.plist"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
150 <!-- XXX will break if any tokens contain <, >, or & -->
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
151 <filterset>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
152 <filter token="app.copyright" value="${app.copyright}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
153 <filter token="app.domain" value="${app.domain}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
154 <filter token="app.entry" value="${app.entry}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
155 <filter token="app.name" value="${app.name}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
156 <filter token="app.version" value="${app.version}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
157 <filter token="jar.filename" value="${lc.app.name}.jar"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
158 <filter token="jvm.version" value="${jvm.version}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
159 <filter token="lc.app.name" value="${lc.app.name}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
160 </filterset>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
161 </copy>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
162 <mkdir dir="${app.bundle}/Contents/MacOS"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
163 <copy todir="${app.bundle}/Contents/MacOS" encoding="UTF-8"
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
164 overwrite="true">
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
165 <fileset file="${pf.home}/osx/JavaApplicationStub"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
166 <filterset>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
167 <filter token="app.domain" value="${app.domain}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
168 <filter token="app.name" value="${app.name}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
169 </filterset>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
170 </copy>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
171 <chmod file="${app.bundle}/Contents/MacOS/JavaApplicationStub"
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
172 perm="755"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
173 <mkdir dir="${app.bundle}/Contents/Resources"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
174 <copy file="${basedir}/${app.name}.icns"
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
175 todir="${app.bundle}/Contents/Resources"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
176 <mkdir dir="${app.bundle}/Contents/Java"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
177 <copy file="${jar.name}" todir="${app.bundle}/Contents/Java"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
178 <echo file="${app.bundle}/Contents/PkgInfo" message="APPL????"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
179 <exec executable="hdiutil" failonerror="true">
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
180 <arg value="create"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
181 <arg value="-volname"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
182 <arg value="${app.name}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
183 <arg value="-srcfolder"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
184 <arg file="${app.bundle}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
185 <arg file="${dist.home}/orig-${mac.disk.image.filename}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
186 </exec>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
187 <exec executable="hdiutil" failonerror="true">
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
188 <arg value="convert"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
189 <arg file="${dist.home}/orig-${mac.disk.image.filename}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
190 <arg value="-format"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
191 <arg value="UDRW"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
192 <arg value="-o"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
193 <arg file="${dist.home}/udrw-${mac.disk.image.filename}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
194 </exec>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
195 <exec executable="hdiutil" failonerror="true">
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
196 <arg value="convert"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
197 <arg file="${dist.home}/udrw-${mac.disk.image.filename}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
198 <arg value="-format"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
199 <arg value="UDZO"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
200 <arg value="-imagekey"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
201 <arg value="zlib-level=9"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
202 <arg value="-o"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
203 <arg file="${dist.home}/${mac.disk.image.filename}"/>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
204 </exec>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
205 </sequential>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
206 </target>
92afaa27f40a Mac app support.
David Barts <n5jrn@me.com>
parents: 4
diff changeset
207
28
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
208 <target name="deb" depends="jar" description="Create Debian package.">
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
209 <fail message="Linux packages can only be built on Linux.">
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
210 <condition>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
211 <not><os family="unix"/></not>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
212 </condition>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
213 </fail>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
214 <sequential>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
215 <mkdir dir="${dist.home}/data/usr/share/applications"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
216 <copy file="${pf.home}/linux/deb/imageprep.desktop"
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
217 tofile="${dist.home}/data/usr/share/applications/imageprep.desktop"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
218 <mkdir dir="${dist.home}/data/usr/share/icons/hicolor/48x48/apps"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
219 <copy file="${pf.home}/linux/icon_48x48.png"
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
220 tofile="${dist.home}/data/usr/share/icons/hicolor/48x48/apps/imageprep.png"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
221 <mkdir dir="${dist.home}/data/usr/share/imageprep"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
222 <copy file="${jar.name}" todir="${dist.home}/data/usr/share/imageprep"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
223 <mkdir dir="${dist.home}/data/usr/share/doc/imageprep"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
224 <copy todir="${dist.home}/data/usr/share/doc/imageprep">
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
225 <filelist dir="${basedir}" files="Readme.html,Readme.rst"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
226 </copy>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
227 <copy todir="${dist.home}/data/usr/share/doc/imageprep" encoding="UTF-8" overwrite="true">
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
228 <fileset file="${pf.home}/linux/deb/copyright"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
229 <filterset>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
230 <filter token="app.copyright" value="${app.copyright}"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
231 </filterset>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
232 </copy>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
233 <gzip src="${pf.home}/linux/deb/changelog"
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
234 destfile="${dist.home}/data/usr/share/doc/imageprep/changelog.gz"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
235 <mkdir dir="${dist.home}/data/usr/share/man/man1"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
236 <gzip src="${pf.home}/linux/imageprep.1"
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
237 destfile="${dist.home}/data/usr/share/man/man1/imageprep.1.gz"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
238 <mkdir dir="${dist.home}/data/usr/bin"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
239 <copy todir="${dist.home}/data/usr/bin" encoding="UTF-8" overwrite="true">
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
240 <fileset file="${pf.home}/linux/imageprep"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
241 <filterset>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
242 <filter token="jar.filename" value="${lc.app.name}.jar"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
243 </filterset>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
244 </copy>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
245 <chmod file="${dist.home}/data/usr/bin/imageprep" perm="755"/>
29
e90d290a9a8d Remove dependence on Nashorn.
David Barts <n5jrn@me.com>
parents: 28
diff changeset
246 <du path="${dist.home}/data" output="deb.installed.size"/>
28
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
247 <mkdir dir="${dist.home}/control"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
248 <copy todir="${dist.home}/control" encoding="UTF-8" overwrite="true">
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
249 <fileset file="${pf.home}/linux/deb/control"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
250 <filterset>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
251 <filter token="app.version" value="${app.version}"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
252 <filter token="deb.installed.size" value="${deb.installed.size}"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
253 </filterset>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
254 </copy>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
255 <copy todir="${dist.home}/control">
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
256 <filelist dir="${pf.home}/linux/deb" files="postinst,postrm"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
257 </copy>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
258 <chmod perm="755">
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
259 <filelist dir="${dist.home}/control" files="postinst,postrm"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
260 </chmod>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
261 <exec executable="${basedir}/make-debian-package" failonerror="true">
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
262 <arg value="${dist.home}"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
263 <arg value="${lc.app.name}_${app.version}.deb"/>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
264 </exec>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
265 </sequential>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
266 </target>
c310ec097194 Add Linux support.
David Barts <n5jrn@me.com>
parents: 26
diff changeset
267
0
e0efe7848130 Initial commit. Untested!
David Barts <davidb@stashtea.com>
parents:
diff changeset
268 </project>