Fine-tune fire mode
[kaka/cakelight.git] / build.xml
index a0d21ec..c9dc10e 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -3,7 +3,6 @@
   
   
   <property file="config.properties"/>
-  <property name="jdk.home.1.8" value="/usr/lib/jvm/java-8-openjdk-amd64" />
   <!-- Uncomment the following property if no tests compilation is needed -->
   <!-- 
   <property name="skip.tests" value="true"/>
@@ -55,9 +54,9 @@
   
   <!-- JDK definitions -->
   
-  <property name="jdk.bin.1.8" value="${jdk.home.1.8}/bin"/>
-  <path id="jdk.classpath.1.8">
-    <fileset dir="${jdk.home.1.8}">
+  <property name="jdk.bin" value="${jdk.home}/bin"/>
+  <path id="jdk.classpath">
+    <fileset dir="${jdk.home}">
       <include name="jre/lib/charsets.jar"/>
       <include name="jre/lib/ext/cldrdata.jar"/>
       <include name="jre/lib/ext/dnsns.jar"/>
@@ -78,9 +77,9 @@
     </fileset>
   </path>
   
-  <property name="project.jdk.home" value="${jdk.home.1.8}"/>
-  <property name="project.jdk.bin" value="${jdk.bin.1.8}"/>
-  <property name="project.jdk.classpath" value="jdk.classpath.1.8"/>
+  <property name="project.jdk.home" value="${jdk.home}"/>
+  <property name="project.jdk.bin" value="${jdk.bin}"/>
+  <property name="project.jdk.classpath" value="jdk.classpath"/>
   
   
   <!-- Project Libraries -->
       <patternset refid="library.patterns"/>
     </fileset>
   </path>
-  
+
+  <path id="library.jnativehook.classpath">
+    <pathelement location="${basedir}/lib/jnativehook-2.1.0.jar"/>
+  </path>
+
   <!-- Modules -->
   
   
     <path refid="${module.jdk.classpath.cakelight}"/>
     <path refid="library.opencv.classpath"/>
     <path refid="library.pi4j.classpath"/>
+    <path refid="library.jnativehook.classpath"/>
   </path>
   
   <path id="cakelight.runtime.production.module.classpath">
     <pathelement location="${cakelight.output.dir}"/>
     <path refid="library.opencv.classpath"/>
     <path refid="library.pi4j.classpath"/>
+    <path refid="library.jnativehook.classpath"/>
   </path>
   
   <path id="cakelight.module.classpath">
     <pathelement location="${cakelight.output.dir}"/>
     <path refid="library.opencv.classpath"/>
     <path refid="library.pi4j.classpath"/>
+    <path refid="library.jnativehook.classpath"/>
   </path>
   
   <path id="cakelight.runtime.module.classpath">
     <pathelement location="${cakelight.output.dir}"/>
     <path refid="library.opencv.classpath"/>
     <path refid="library.pi4j.classpath"/>
+    <path refid="library.jnativehook.classpath"/>
   </path>
   
   
         <type type="file"/>
       </fileset>
     </copy>
+  </target>
 
+  <target name="jar" description="Builds a jar file">
+    <delete file="${cakelight.output.dir}/cakelight.jar"/>
     <jar destfile="${cakelight.output.dir}/cakelight.jar">
       <fileset dir="${cakelight.output.dir}" />
       <!-- TODO replace hard links -->
-      <zipfileset includes="**/*.class" src="${module.cakelight.basedir}/lib/pi4j/pi4j-core.jar" />
+      <zipfileset includes="**/*.class" src="/opt/pi4j/lib/pi4j-core.jar" />
       <zipfileset includes="**/*.class" src="/usr/share/java/opencv.jar" />
+      <zipfileset includes="**/*.class" src="${module.cakelight.basedir}/lib/jnativehook-2.1.0.jar" />
       <manifest>
         <attribute name="Main-Class" value="kaka.cakelight.LedController" />
       </manifest>
   
   <target name="clean" depends="clean.module.cakelight" description="cleanup all"/>
   
-  <target name="build.modules" depends="init, clean, compile.module.cakelight" description="build all modules"/>
+  <target name="build.modules" depends="init, clean, compile.module.cakelight, jar" description="build all modules"/>
   
   <target name="all" depends="build.modules" description="build all"/>
+
+  <target name="build" depends="compile.module.cakelight" description="build cakelight"/>
 </project>
\ No newline at end of file