changeset 51:e8d2a7e6f6c7

So it builds under Windoze (at last!)
author davidb
date Tue, 14 Apr 2020 14:35:04 -0700
parents 3f8409470fdf
children c8ec2d7af3fb
files build.xml setup.sh
diffstat 2 files changed, 21 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/build.xml	Sun Apr 12 18:45:23 2020 -0700
+++ b/build.xml	Tue Apr 14 14:35:04 2020 -0700
@@ -18,7 +18,7 @@
   <env-require name="KOTLIN_HOME"/>
 
   <!-- define the kotlin task -->
-  <property name="kotlin.lib" value="${env.KOTLIN_HOME}/libexec/lib"/>
+  <property name="kotlin.lib" value="${env.KOTLIN_HOME}/lib"/>
   <typedef resource="org/jetbrains/kotlin/ant/antlib.xml"
            classpath="${kotlin.lib}/kotlin-ant.jar"/>
 
@@ -45,6 +45,7 @@
   <property name="work.jar"      value="${basedir}/work.jar"/>
   <property name="lib.home"      value="${basedir}/lib"/>
   <property name="src.home"      value="${basedir}/src"/>
+  <property name="work.home"      value="${basedir}/work"/>
 
   <!-- help message -->
   <target name="help">
@@ -105,7 +106,7 @@
   <!-- for making bundled apps -->
   <macrodef name="bundle">
     <attribute name="type"/>
-    <element name="args"/>
+    <element name="args" optional="true"/>
     <sequential>
       <fx:deploy nativeBundles="@{type}" outdir="${basedir}" outfile="${app.name}"
         signBundle="false">
@@ -131,8 +132,23 @@
     </bundle>
   </target>
 
-  <target name="app" depends="jar" description="Create app bundle.">
-    <bundle type="image"/>
+  <target name="dummywork" description="dummy dir to make javapackager happy">
+    <mkdir dir="${work.home}"/>
+    <copy file="${jar.name}" tofile="${work.home}/${app.name}.jar"/>
+  </target>
+
+  <!-- fx:deploy is broken on Windoze, must run javapackager command -->
+  <target name="app" depends="jar,dummywork" description="Create app bundle.">
+    <exec executable="${env.JRE_HOME}/bin/javapackager">
+      <arg value="-deploy"/>
+      <arg value="-title"/> <arg value="${app.name}"/>
+      <arg value="-appclass"/> <arg value="${app.entry}"/>
+      <arg value="-native"/> <arg value="image"/>
+      <arg value="-name"/> <arg value="${app.name}"/>
+      <arg value="-outdir"/> <arg value="."/>
+      <arg value="-outfile"/> <arg value="${app.name}"/>
+      <arg value="-srcdir"/> <arg value="${work.home}"/>
+    </exec>
   </target>
 
   <target name="rpm" depends="jar" description="Create RPM package.">
--- a/setup.sh	Sun Apr 12 18:45:23 2020 -0700
+++ b/setup.sh	Tue Apr 14 14:35:04 2020 -0700
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 export JRE_HOME="$(/usr/libexec/java_home)"
-export KOTLIN_HOME="/usr/local/Cellar/kotlin/1.3.71"
+export KOTLIN_HOME="/usr/local/Cellar/kotlin/1.3.71/libexec"
 
 export ANT_HOME="$HOME/java/apache-ant-1.10.1"
 if [[ "$PATH" != *$ANT_HOME/bin* ]]