changeset 2:a6f9b51d5e8d

Got jar building.
author David Barts <n5jrn@me.com>
date Fri, 17 Jul 2020 10:34:48 -0700
parents 0bded24f746e
children 09dcd475d1bf
files build.xml src/name/blackcap/imageprep/Settings.kt
diffstat 2 files changed, 6 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/build.xml	Thu Jul 16 21:51:08 2020 -0700
+++ b/build.xml	Fri Jul 17 10:34:48 2020 -0700
@@ -31,19 +31,16 @@
 
   <!-- Define the properties used by the build -->
   <property name="app.name"      value="${ant.project.name}"/>
+  <toLowerCase target="lc.app.name" value="${app.name}"/>
   <property name="app.version"   value="1.00"/>
-  <property name="app.domain"    value="name.blackcap.exifwasher"/>
+  <property name="app.domain"    value="name.blackcap.${lc.app.name}"/>
   <property name="app.entry"     value="${app.domain}.MainKt"/>
   <property name="app.copyright" value="Copyright © 2020, David W. Barts."/>
-  <toLowerCase target="lc.app.name" value="${app.name}"/>
   <property name="jar.name"      value="${basedir}/${lc.app.name}.jar"/>
   <property name="work.jar"      value="${basedir}/work.jar"/>
   <property name="lib.home"      value="${basedir}/lib"/>
   <property name="src.home"      value="${basedir}/src"/>
   <property name="dist.home"     value="${basedir}/dist"/>
-  <property name="pf.home"       value="${basedir}/package-files"/>
-  <property name="nat.dir"       value="${src.home}/name/blackcap/exifwasher/exiv2"/>
-  <property name="bin.dir"       value="${src.home}/name/blackcap/exifwasher/binaries"/>
   <property name="jvm.version"   value="1.8"/>
 
   <!-- define the kotlin task -->
@@ -74,7 +71,6 @@
 
   <!-- make needed directories -->
   <target name="mkdirs">
-    <mkdir dir="${bin.dir}/${os.type}"/>
     <mkdir dir="${dist.home}"/>
   </target>
 
@@ -82,7 +78,6 @@
   <target name="clean">
     <delete includeEmptyDirs="true" failonerror="false">
       <fileset dir="${dist.home}" includes="**/*"/>
-      <fileset dir="${bin.dir}"/>
     </delete>
   </target>
 
@@ -116,9 +111,7 @@
       </manifest>
       <!-- <zipgroupfileset dir="${lib.home}" includes="*.jar"/> -->
       <zipfileset src="${work.jar}"/>
-      <zipfileset dir="${src.home}" includes="**/*.properties,**/*.html,**/*.dll,**/*.so,**/*.dylib"/>
-      <zipfileset file="${pf.home}/linux/icon_48x48.png"
-        fullpath="name/blackcap/exifwasher/icon_48x48.png"/>
+      <zipfileset dir="${src.home}" includes="**/*.properties,**/*.html"/>
     </jar>
   </target>
 
--- a/src/name/blackcap/imageprep/Settings.kt	Thu Jul 16 21:51:08 2020 -0700
+++ b/src/name/blackcap/imageprep/Settings.kt	Fri Jul 17 10:34:48 2020 -0700
@@ -9,14 +9,14 @@
 private val _PROPS = PROPERTIES
 
 object Settings {
-    private var homeDir = System.getProperty("user.home")
+    private val homeDir = System.getProperty("user.home")
     val maxDimension = _PROPS.getProperty("maxDimension").toInt()
     val outputQuality = _PROPS.getProperty("outputQuality").toInt()
-    val outputSuffix = tilde(_PROPS.getProperty("outputSuffix"))
+    val outputSuffix = _PROPS.getProperty("outputSuffix")
     val outputTo = tilde(_PROPS.getProperty("outputTo"))
     val outputToInputDir = strToBool(_PROPS.getProperty("outputToInputDir"))
 
-    private fun tilde(s: String): String {
+    private fun tilde(s: String?): String {
         if (s.isNullOrEmpty())
             return homeDir
         if (s.startsWith("~/") || s.startsWith("~\\"))