PageRenderTime 29ms CodeModel.GetById 24ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/osx/javawfm/build.xml

https://code.google.com/p/javawfm/
XML | 89 lines | 61 code | 13 blank | 15 comment | 0 complexity | 31f54384e1983bafade2eb810d21f93b MD5 | raw file
 1<?xml version="1.0" encoding="UTF-8"?>
 2<project name="javawfm" default="install" basedir=".">
 3	<property name="src" location="../../farmR/src/java/src/"/> <!-- java source folder -->
 4	<property name="bin" location="bin"/> <!-- intermediate build products -->
 5	<property name="jars" location="jars"/> <!-- jar files -->
 6	<property name="lib" location="../../farmR/src/depends/libs"/> <!-- local libraries linked against -->
 7	<property name="dist" location="dist"/> <!-- build product location -->
 8	<property name="resources" location="resources"/> <!-- location of general java resources -->
 9    <property name="compile.debug" value="true"/>
10    <property name="native.target" value="JNILib"/>
11    <property name="native.project" value="javawfm.xcodeproj"/>
12    <property name="native.library" value="libjavawfm.jnilib"/>
13    <property name="env.CONFIGURATION" value="Release"/>
14
15    <fileset id="lib.jars" dir="${lib}">
16        <include name="**/*.jar"/>
17    </fileset>
18	
19    <path id="lib.path">
20        <fileset refid="lib.jars"/>
21    </path>
22
23    <target name="init" description="Initialize environment">
24		<!-- Get properties from environment -->
25		<property environment="env"/>	
26		<property name="curr_build_dir" location="build/${env.CONFIGURATION}"/>
27		<property name="curr_header_dir" location="build/${env.CONFIGURATION}/Headers"/>
28		
29		<!-- if you tweak these names, you'll have to change the JNILib target and the Xcode launcher arguments -->
30		<property name="jarfilename" value="javawfm"/>
31		<property name="jarfile" location="${jars}/${jarfilename}.jar"/>
32
33        <mkdir dir="${curr_build_dir}"/>
34        <mkdir dir="${curr_header_dir}"/>
35        <mkdir dir="${lib}"/>
36        <mkdir dir="${bin}"/>
37        <mkdir dir="${jars}"/>
38        <mkdir dir="${dist}"/>		
39    </target>
40
41    <target name="compile" depends="init" description="Compile JNI Wrapper code">
42        <javac srcdir="${src}" destdir="${bin}"
43               source="1.5" target="1.5"
44               includeAntRuntime="no"
45               classpathref="lib.path" debug="${compile.debug}">
46        </javac>			
47    </target>
48
49    <target name="jar" depends="compile" description="Build jar">
50        <jar jarfile="${jarfile}" basedir="${bin}" manifest="${resources}/Manifest">
51			<!-- Merge library jars into final jar file -->
52			<zipgroupfileset refid="lib.jars"/>
53		</jar>
54		
55		<!-- generate the header files -->
56		<exec executable="/usr/bin/javah">
57				<arg line="-classpath '${jarfile}' -force -d '${curr_header_dir}' jfm.lp.CBCPeer"/>
58		</exec>
59<!--		<exec executable="/usr/bin/javah">
60				<arg line="-classpath '${jarfile}' -force -d '${curr_header_dir}' jfm.lp.GLPKPeer"/>
61		</exec>-->
62    </target>
63
64	<!-- Note: this target requires that Xcode Tools be installed -->
65
66	
67    <!-- install target. Copy the built objects to the 'dist' directory. -->
68    <target name="install" description="Install jar" depends="jar">
69<!--        <copy file="${jarfile}" toDir="${dist}" failonerror="true" verbose="true"/>
70        <copy toDir="${dist}" failonerror="true" verbose="true">
71			<fileset dir="${bin}">
72				<include name="**/*.jnilib"/>
73			</fileset>
74		</copy>-->
75    </target>
76
77	<target name="run" depends="install">
78		<java classpath="${jarfile}" classname="${ant.project.name}" fork="true">
79			<sysproperty key="java.library.path" value="${dist}"/>
80		</java>
81	</target>
82	
83    <target name="clean" depends="init" description="Remove build and dist directories">
84        <delete dir="${bin}"/>
85        <delete dir="${dist}"/>
86        <delete dir="${jars}"/>
87		<delete dir="${curr_build_dir}"/>
88    </target>
89</project>