comparison build.xml @ 25:3129d0e24086 pre-big-reorg

Use ant tasks, not <exec>.
author David Barts <n5jrn@me.com>
date Thu, 23 Jan 2020 20:46:59 -0800
parents 14049bc97a7c
children 8aa2dfac27eb
comparison
equal deleted inserted replaced
24:dac8dfb4b549 25:3129d0e24086
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="ClipMan" default="help" basedir="."> 2 <project name="ClipMan" default="help" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
3 <!-- import all environment variables as env.* --> 3 <!-- import all environment variables as env.* -->
4 <property environment="env"/> 4 <property environment="env"/>
5 5
6 <!-- ensure required environment variables are set --> 6 <!-- ensure required environment variables are set -->
7 <macrodef name="env-require"> 7 <macrodef name="env-require">
17 <env-require name="JRE_HOME"/> 17 <env-require name="JRE_HOME"/>
18 <env-require name="KOTLIN_HOME"/> 18 <env-require name="KOTLIN_HOME"/>
19 19
20 <!-- define the kotlin task --> 20 <!-- define the kotlin task -->
21 <property name="kotlin.lib" value="${env.KOTLIN_HOME}/libexec/lib"/> 21 <property name="kotlin.lib" value="${env.KOTLIN_HOME}/libexec/lib"/>
22 <typedef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/> 22 <typedef resource="org/jetbrains/kotlin/ant/antlib.xml"
23 classpath="${kotlin.lib}/kotlin-ant.jar"/>
24
25 <!-- define the package-building tasks -->
26 <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
27 uri="javafx:com.sun.javafx.tools.ant"
28 classpath="${env.JRE_HOME}/lib/ant-javafx.jar"/>
23 29
24 <!-- cribbed from https://stackoverflow.com/questions/7129672/uppercase-lowercase-capitalize-an-ant-property --> 30 <!-- cribbed from https://stackoverflow.com/questions/7129672/uppercase-lowercase-capitalize-an-ant-property -->
25 <scriptdef language="javascript" name="toLowerCase"> 31 <scriptdef language="javascript" name="toLowerCase">
26 <attribute name="value" /> 32 <attribute name="value" />
27 <attribute name="target" /> 33 <attribute name="target" />
96 <!-- for making bundled apps --> 102 <!-- for making bundled apps -->
97 <macrodef name="bundle"> 103 <macrodef name="bundle">
98 <attribute name="type"/> 104 <attribute name="type"/>
99 <element name="args"/> 105 <element name="args"/>
100 <sequential> 106 <sequential>
101 <exec executable="${env.JRE_HOME}/bin/javapackager" dir="${basedir}"> 107 <fx:deploy nativeBundles="@{type}" outdir="${basedir}" outfile="${app.name}"
102 <env key="JAVA_HOME" value="${env.JRE_HOME}"/> 108 signBundle="false">
103 <arg value="-deploy"/> 109 <fx:application mainClass="${app.entry}" name="${app.name}" toolkit="swing"
104 <arg value="-Bruntime=${env.JRE_HOME}"/> 110 version="1.0"/>
105 <arg value="-description"/> <arg value="ClipMan, a clipboard manager."/> 111 <fx:info description="ClipMan, a clipboard manager." title="${app.name}"
106 <arg value="-native"/> <arg value="@{type}"/> 112 vendor="David Barts &lt;n5jrn@me.com&gt;"/>
107 <arg value="-srcfiles"/> <arg value="${jar.name}"/> 113 <fx:resources>
108 <arg value="-outdir"/> <arg value="${basedir}"/> 114 <fx:fileset dir="${basedir}" includes="${lc.app.name}.jar"/>
109 <arg value="-outfile"/> <arg value="${app.name}"/> 115 </fx:resources>
110 <arg value="-appclass"/> <arg value="${app.entry}"/> 116 <fx:bundleArgument arg="runtime" value="${env.JRE_HOME}"/>
111 <arg value="-name"/> <arg value="${app.name}"/>
112 <arg value="-title"/> <arg value="${app.name}"/>
113 <arg value="-vendor"/> <arg value="David Barts &lt;n5jrn@me.com&gt;"/>
114 <arg value="-nosign"/>
115 <args/> 117 <args/>
116 </exec> 118 </fx:deploy>
117 </sequential> 119 </sequential>
118 </macrodef> 120 </macrodef>
119 121
120 <target name="dmg" depends="jar" description="Create MacOS app bundle."> 122 <target name="macapp" depends="jar" description="Create MacOS app bundle.">
121 <bundle type="dmg"> 123 <bundle type="image">
122 <args> 124 <args>
123 <arg value="-BjvmOptions=-Xdock:name=${app.name}"/> 125 <fx:bundleArgument arg="jvmOptions" value="-Xdock:name=${app.name}"/>
124 </args> 126 </args>
125 </bundle> 127 </bundle>
126 </target> 128 </target>
127 129
128 <target name="pkg" depends="jar" description="Create MacOS app bundle."> 130 <target name="app" depends="jar" description="Create app bundle.">
129 <bundle type="pkg"> 131 <bundle type="image"/>
130 <args>
131 <arg value="-BjvmOptions=-Xdock:name=${app.name}"/>
132 </args>
133 </bundle>
134 </target> 132 </target>
135 133
136 <target name="rpm" depends="jar" description="Create MacOS app bundle."> 134 <target name="rpm" depends="jar" description="Create RPM package.">
137 <bundle type="rpm"/> 135 <bundle type="rpm"/>
138 </target> 136 </target>
139 137
140 <target name="exe" depends="jar" description="Create MacOS app bundle."> 138 <target name="deb" depends="jar" description="Create Debian package.">
141 <bundle type="exe"/>
142 </target>
143
144 <target name="deb" depends="jar" description="Create MacOS app bundle.">
145 <bundle type="deb"/> 139 <bundle type="deb"/>
146 </target> 140 </target>
147 141
148 </project> 142 </project>