aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Desruisseaux <martin.desruisseaux@geomatys.com>2018-04-27 18:15:08 +0200
committerMartin Desruisseaux <martin.desruisseaux@geomatys.com>2018-04-27 18:15:08 +0200
commitaef6d05bfe86b810dbd38dbdb9c757dae7b8368e (patch)
treebeff12a6207a5943c050a50ba124bb7b9d70c56c
parent44b83cbb394639f6c393c349b56360af27bc3020 (diff)
downloadPROJ-aef6d05bfe86b810dbd38dbdb9c757dae7b8368e.tar.gz
PROJ-aef6d05bfe86b810dbd38dbdb9c757dae7b8368e.zip
Update the Ant build.xml script for:
- Generating the C header file during javac task. - Provide more accurate information in META-INF/MANIFEST.MF. - Merge tasks intended to be executed together. The src/org_proj4_PJ.h file has been re-generated with the most recent Java compiler.
-rw-r--r--jniwrap/build.xml107
-rw-r--r--src/org_proj4_PJ.h2
2 files changed, 38 insertions, 71 deletions
diff --git a/jniwrap/build.xml b/jniwrap/build.xml
index 2888a1ec..85bcb2a5 100644
--- a/jniwrap/build.xml
+++ b/jniwrap/build.xml
@@ -1,87 +1,54 @@
<?xml version="1.0"?>
-<project name="jproj" default="compile" basedir=".">
-
- <!-- ******************************************* -->
- <!-- Set the variables -->
- <!-- ******************************************* -->
- <property name="src" value="org/proj4"/>
- <property name="srcProj" value="../src"/>
- <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>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}" encoding="UTF-8" source="1.5" target="1.5" includeAntRuntime="false"/>
- </target>
-
- <!-- ******************************************* -->
- <!-- Execute javah for JNI headers -->
- <!-- ******************************************* -->
- <!-- Needed if new native methods are added. -->
- <!-- Header file is created only if the old -->
- <!-- proj/src/org_proj4_PJ.h file is deleted -->
- <!-- before to run this task. -->
- <!-- ******************************************* -->
- <target name="do_javah" depends="do_javac">
- <echo>Creating jni headers...</echo>
- <javah classpath="${build}" class="org.proj4.PJ" destdir="${srcProj}"/>
- </target>
-
- <!-- ******************************************* -->
- <!-- Do the C part compilation through make -->
- <!-- ******************************************* -->
- <target name="do_make" depends="do_javah">
- <echo>Compiling libraries...</echo>
- <exec dir=".." executable="make"/>
- </target>
-
- <!-- ******************************************* -->
- <!-- Create binary package distribution -->
- <!-- ******************************************* -->
- <target name="jar_it">
- <jar destfile="${libs}/jproj.jar" basedir="${build}/">
+<project name="Java bridge to Proj.4" default="compile" basedir=".">
+
+ <!-- *******************************************
+ Set directory paths and versions.
+ ******************************************* -->
+ <property name="src-java" value="."/>
+ <property name="src-C" value="../src"/>
+ <property name="out" value="out"/>
+ <property name="classes" value="${out}/classes"/>
+ <property name="version" value="5.1"/>
+
+ <!-- *******************************************
+ Compile (default target).
+ Include generation of JNI header.
+ ******************************************* -->
+ <target name="compile">
+ <mkdir dir="${out}"/>
+ <mkdir dir="${classes}"/>
+ <javac srcdir="${src-java}" destdir="${classes}" encoding="UTF-8" nativeheaderdir="${src-C}"
+ createMissingPackageInfoClass = "false"
+ includeAntRuntime = "false"
+ includes = "org/**/*.java"/>
+
+ <jar destfile="${out}/proj.jar" basedir="${classes}" level="9" strict="fail">
<manifest>
- <attribute name="Built-By" value="Proj.4"/>
+ <attribute name="Implementation-Title" value="Proj bridge to Java"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ <attribute name="Implementation-Vendor" value="Proj.4 project"/>
+ <attribute name="Implementation-URL" value="http://proj4.org/"/>
</manifest>
</jar>
</target>
- <!-- ****************************************************** -->
- <!-- Execute doxygen help file and source file creation -->
- <!-- ****************************************************** -->
- <target name="do_make_help" depends="start">
+ <!-- **********************************************************
+ Execute doxygen help file and source file creation.
+ ********************************************************** -->
+ <target name="do_make_help">
<echo>Creating help files...</echo>
<exec dir="." executable="doxygen">
<arg line="doxygen.cfg"/>
</exec>
</target>
- <!-- ******************************************* -->
- <!-- Clean up everything -->
- <!-- ******************************************* -->
+ <!-- *******************************************
+ Clean up everything.
+ ******************************************* -->
<target name="clean">
<echo>Cleaning up...</echo>
- <delete dir="${build}"/>
- <delete dir="${libs}"/>
+ <delete dir="${classes}"/>
+ <delete dir="${out}"/>
<delete dir="docs"/>
</target>
diff --git a/src/org_proj4_PJ.h b/src/org_proj4_PJ.h
index 7e690e7a..be5d3f58 100644
--- a/src/org_proj4_PJ.h
+++ b/src/org_proj4_PJ.h
@@ -44,7 +44,7 @@ JNIEXPORT jstring JNICALL Java_org_proj4_PJ_getDefinition
/*
* Class: org_proj4_PJ
* Method: getType
- * Signature: ()Lorg/proj4/PJ$Type;
+ * Signature: ()Lorg/proj4/PJ/Type;
*/
JNIEXPORT jobject JNICALL Java_org_proj4_PJ_getType
(JNIEnv *, jobject);