aboutsummaryrefslogtreecommitdiff
path: root/jniwrap/build.xml
blob: 8f181dd8b0958b3ee60b1dc39df858231962ec67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?xml version="1.0"?>
<project name="jproj" default="compile" basedir=".">
   
   <!-- ******************************************* -->
   <!--     set the variables                       -->
   <!-- ******************************************* -->
   <property name="src" value="org/proj4"/>
   <property name="build" value="classes"/>
   <property name="libs" value="libs"/>

   <!-- ******************************************* -->
   <!--     start everything (default target)       -->
   <!-- ******************************************* -->
   <target name="compile" depends="start, do_javac, jar_it">
        <echo>Compilation finished...</echo>
   </target>
   
   <!-- ******************************************* -->
   <!--     create some begin stuff                 -->
   <!-- ******************************************* -->
   <target name="start">
        <echo>Start compilation...</echo>
        <!-- <splash imageurl="./etc/images/logo.jpg" showduration="5000"/> -->
        <echo>Creating folder structure...</echo>
        <mkdir dir="${build}"/>
        <mkdir dir="${libs}"/>
   </target>
      
   <!-- ******************************************* -->
   <!--     execute javac compilation               -->
   <!-- ******************************************* -->
   <target name="do_javac" depends="start">
       <echo>Compiling the java code...</echo>
       <javac srcdir="${src}" destdir="${build}" debug="on">
       </javac>
   </target>
    
	

   <!-- ******************************************* -->
   <!--     execute javah for JNI headers           -->
   <!-- ******************************************* -->
   <!-- needed if something if new native methods are added  -->
	   <!-- ******************************************* -->
   <target name="do_javah" depends="do_javac">
       <echo>Creating jni headers...</echo>
       <exec dir="${build}" executable="javah" os="Linux">
          <arg line="-jni -d ../native org.proj4.Projections"/>
       </exec>
   </target>
   
   <!-- ******************************************* -->
   <!--     do the C part compilation through make  -->
   <!-- ******************************************* -->
   <target name="do_make" depends="do_javah">
       <echo>Compiling libraries ...</echo>
        <exec dir="." executable="make" os="Linux">
          <arg line=""/>
       </exec>
   </target>
   
   <!-- ******************************************* -->
   <!-- create binary package distribution with ant -->
   <!-- ******************************************* -->
   
   <!-- this is not working properly by now -->
   <target name="jar_it">
     <delete file="${libs}/jproj.jar"/>
      <jar destfile="${libs}/jproj.jar" basedir="${build}/">
          <manifest>
              <attribute name="Built-By" value="the jgrass idealists"/>
          </manifest>
      </jar>
       <delete dir="${build}"/>
   </target>
   
   <!-- ****************************************************** -->
   <!--     execute doxygen help file and source file creation -->
   <!-- ****************************************************** -->
   <target name="do_make_help" depends="start">
       <echo>Creating help files...</echo>
       <exec dir="." executable="doxygen">
          <arg line="doxygen.cfg"/>
       </exec>
   </target>

   <!-- ******************************************* -->
   <!--     clean up everything                     -->
   <!-- ******************************************* -->
   <target name="clean">
       <echo>Cleaning up...</echo>
       <delete dir="${build}"/>
       <delete dir="${libs}"/>
       <delete dir="docs"/>
   </target>

</project>