soc.2012.android: a9b9e815: Made output names for javah files nicer, ...
michael at soc.pidgin.im
michael at soc.pidgin.im
Mon May 28 07:18:23 EDT 2012
----------------------------------------------------------------------
Revision: a9b9e815db3424846349fe791eb95e77ac16194b
Parent: e598939413e2527367bab354a630faf02b1fff9f
Author: michael at soc.pidgin.im
Date: 05/28/12 06:36:33
Branch: im.pidgin.soc.2012.android
URL: http://d.pidgin.im/viewmtn/revision/info/a9b9e815db3424846349fe791eb95e77ac16194b
Changelog:
Made output names for javah files nicer, cleaned up build scripts
Changes against parent e598939413e2527367bab354a630faf02b1fff9f
dropped android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_PurpleInstance.c
added android/workspace/im.pidgin.libpurple/deploy
added android/workspace/im.pidgin.libpurple/native/PurpleInstance.c
patched android/workspace/im.pidgin.libpurple/loadlibs.ant
patched android/workspace/im.pidgin.libpurple/native/build.ant
patched android/workspace/im.pidgin.libpurple/native/generateheaders.ant
-------------- next part --------------
============================================================
--- android/workspace/im.pidgin.libpurple/native/build.ant f111d0581b5704e952b5765eef98c7c1a7e55655
+++ android/workspace/im.pidgin.libpurple/native/build.ant 2ea0eb20a128370fcb9ebe651fff7c0740fd3e2b
@@ -16,24 +16,16 @@
<import file="generateheaders.ant" />
<import file="distribute.ant"/>
- <property name="androidMakefile" location="Android.mk" />
-
<property name="libpurple.java.gen" location="../gen" />
<property name="libpurple.constants.outdir" location="${libpurple.java.gen}/im/pidgin/libpurple/constants" />
<property name="libpurple.constants.package" value="im.pidgin.libpurple.constants" />
-
<property name="javah.out" location="." />
- <property name="cc" value="${ndk.host}-gcc"/>
-
-
-
<!-- =================================
target: default
================================= -->
<target name="build" depends="ant-contrib.load,extractconstants,headers.create,distribute" description="Builds the native functions that need to exists to interface libpurple with java.">
-
</target>
<!-- - - - - - - - - - - - - - - - - -
@@ -87,12 +79,5 @@
<enum name="PurpleConnectionError" />
</extractconstants>
</target>
-
- <target name="constants.extract">
-
-
- </target>
-
-
-
+
</project>
============================================================
--- android/workspace/im.pidgin.libpurple/native/generateheaders.ant d999a563bf67e20423e970d94e6ec917d7845edb
+++ android/workspace/im.pidgin.libpurple/native/generateheaders.ant d3635bcabcd67bbefd8e3b7f5221ae68337c42f3
@@ -12,11 +12,8 @@
Generates header files automatically for jni.
</description>
- <property name="javah.src" location="../src"/>
+ <property name="javah.src" location="../src" />
-
-
-
<!-- = = = = = = = = = = = = = = = = =
macrodef: javah
= = = = = = = = = = = = = = = = = -->
@@ -26,38 +23,51 @@
<sequential>
<antcall target="javah">
<param name="classpath" value="@{classdefinition}" />
- <param name="to" value="@{to}" />
+ <param name="to" location="@{to}" />
</antcall>
</sequential>
</macrodef>
-
<!-- - - - - - - - - - - - - - - - - -
target: javah
- - - - - - - - - - - - - - - - - -->
- <target name="javah" depends="javah-checkchanges" unless="nochanges">
+ <target name="javah" depends="javah.vars,javah.checkchanges" unless="nochanges">
<echo message="generating jni header for ${classpath}" />
- <propertyregex property="classpath_with_slash" input="${classpath}" regexp="\." replace="/" global="true" />
<mkdir dir=".javah-tmp" />
- <javac srcdir="${javah.src}" destdir=".javah-tmp" listfiles="yes" >
- <include name="${classpath_with_slash}.java"/>
+ <javac srcdir="${javah.src}" destdir=".javah-tmp" listfiles="yes">
+ <include name="${classpath_with_slash}.java" />
</javac>
+ <echo>javah -jni -o ${headerfile} -classpath .javah-tmp -force ${classpath}
+ </echo>
<exec executable="javah" failifexecutionfails="true" failonerror="true">
<arg value="-jni" />
- <arg value="-d" />
- <arg path="${to}" />
+ <arg value="-o" />
+ <arg path="${headerfile}" />
<arg value="-classpath" />
<arg path=".javah-tmp" />
+ <arg value="-force" />
<arg value="${classpath}" />
</exec>
- <delete dir=".javah-tmp" />
+ <!--<delete dir=".javah-tmp" />-->
</target>
- <target name="javah-checkchanges">
+ <!-- - - - - - - - - - - - - - - - - -
+ target: javah.vars
+ - - - - - - - - - - - - - - - - - -->
+ <target name="javah.vars">
<propertyregex property="classpath_with_slash" input="${classpath}" regexp="\." replace="/" global="true" />
<propertyregex property="classpath_with__" input="${classpath}" regexp="\." replace="_" global="true" />
- <uptodate property="nochanges" srcfile="../src/${classpath_with_slash}.java" targetfile="${to}/${classpath_with__}.h" />
+
+ <propertyregex property="headerfilename" input="${classpath}" regexp="^(\w*\.)*(\w+)$" replace="\2.h" />
+ <property name="headerfile" location="${to}/${headerfilename}" />
</target>
+
+ <!-- - - - - - - - - - - - - - - - - -
+ target: javah.checkchanges
+ - - - - - - - - - - - - - - - - - -->
+ <target name="javah.checkchanges">
+ <uptodate property="nochanges" srcfile="${javah.src}/${classpath_with_slash}.java" targetfile="${headerfile}" />
+ </target>
</project>
============================================================
--- android/workspace/im.pidgin.libpurple/loadlibs.ant 4e67eb45f0050a40d6f7968e1c7da7965e7dc490
+++ android/workspace/im.pidgin.libpurple/loadlibs.ant 1ae8bf2d4b0f9ea157e65ea22b1f8048a105325a
@@ -16,8 +16,8 @@
<!-- = = = = = = = = = = = = = = = = =
macrodef: libpurple.loadlibs
= = = = = = = = = = = = = = = = = -->
- <macrodef name="libpurple.loadlibs">
- <attribute name="outproject" default="" />
+ <macrodef name="libpurple.loadlibs" description="copys the librarys to your android project.">
+ <attribute name="outproject" default=""/>
<sequential>
<dirname file="${ant.file.libpurple.loadlibs}" property="libpurple.projectroot" />
<property name="libpurple.deploy" location="${libpurple.projectroot}/deploy" />
@@ -35,5 +35,4 @@
</sequential>
</macrodef>
-
</project>
============================================================
--- android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_PurpleInstance.c ca9bbabe0ee3859ce49b6b43c4e05eeeb50dfa3f
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <jni.h>
-#include <libpurple/core.h>
-
-#include "im_pidgin_libpurple_core_PurpleInstance.h"
-
-/*
- * Class: im_pidgin_libpurple_core_PurpleInstance
- * Method: getVersion_native
- * Signature: ()Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_im_pidgin_libpurple_core_PurpleInstance_getVersion_1native
- (JNIEnv *env, jobject obj) {
- const char* version = purple_core_get_version();
- return (*env)->NewStringUTF(env, version);
-}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/PurpleInstance.c 8790ffc47fbf3f4df595909503282a06de658e39
@@ -0,0 +1,15 @@
+#include <jni.h>
+#include <libpurple/core.h>
+
+#include "PurpleInstance.h"
+
+/*
+ * Class: im_pidgin_libpurple_core_PurpleInstance
+ * Method: getVersion_native
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_im_pidgin_libpurple_core_PurpleInstance_getVersion_1native
+ (JNIEnv *env, jobject obj) {
+ const char* version = purple_core_get_version();
+ return (*env)->NewStringUTF(env, version);
+}
More information about the Commits
mailing list