From 90d3b69bd10c03d77b32e1877b6da478d4000b43 Mon Sep 17 00:00:00 2001 From: MeFisto94 Date: Sat, 14 Sep 2019 20:26:18 +0200 Subject: [PATCH] Build Android Natives (OpenAL, Vorbis, TextureLoading) on Travis (#1171) * First attempt at building android-natives. * Use OpenJDK because native build is broken without * Try OpenJDK 10 * Try openJDK 9 * Try openJDK11 again but "enable" the EE Module * OpenJDK 11 has no Java EE Module anymore. * Try to fix Android Header Generation * Fix invalid flag error with javac by removing empty quotes * Try to fix build of decode. * Remove jni generated headers from the repository. * Adjust .gitignore as those header files won't appear at that location anymore * Fix Android Build: Fill the jme3-android-native headers during the build of jme3-android. This works because jme3-android-native already depends on jme3-android. Due to technical reasons, the headers share the same location and thus the include directives have been adjusted slightly. * Copy jni headers to the jni directory. * Adjust the path slightly * Try to silence android sdk's license print out * Also fix openAL * Solve task name conflict * Really silence license now * Tasks seem shared but Strings are not... * Only build Android-Native * Trying to reduce the amount of dependencies needed. * Remove even more dependencies * Even more removal * Prepare Deployment * Fix Deployment * Cleanup: Remove feature branch from branches for travis. * Revert a few unnecessary things * Removed NDK Comments. --- .gitignore | 2 - .travis.yml | 14 ++ jme3-android-native/.gitignore | 2 + jme3-android-native/build.gradle | 2 +- jme3-android-native/decode.gradle | 20 +- jme3-android-native/openalsoft.gradle | 26 +-- .../com_jme3_audio_plugins_NativeVorbisFile.c | 4 +- ...texture_plugins_AndroidNativeImageLoader.c | 2 +- .../com_jme3_audio_android_AndroidAL.c | 2 +- .../com_jme3_audio_android_AndroidAL.h | 173 ------------------ .../com_jme3_audio_android_AndroidALC.c | 4 +- .../com_jme3_audio_android_AndroidALC.h | 77 -------- .../com_jme3_audio_android_AndroidEFX.c | 4 +- .../com_jme3_audio_android_AndroidEFX.h | 101 ---------- jme3-android/build.gradle | 7 + 15 files changed, 46 insertions(+), 394 deletions(-) create mode 100644 jme3-android-native/.gitignore delete mode 100644 jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidAL.h delete mode 100644 jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidALC.h delete mode 100644 jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidEFX.h diff --git a/.gitignore b/.gitignore index 6bed74f10..7cc55d212 100644 --- a/.gitignore +++ b/.gitignore @@ -33,8 +33,6 @@ /jme3-android-native/OpenALSoft.zip /jme3-android-native/src/native/jme_decode/STBI/ /jme3-android-native/src/native/jme_decode/Tremor/ -/jme3-android-native/src/native/jme_decode/com_jme3_audio_plugins_NativeVorbisFile.h -/jme3-android-native/src/native/jme_decode/com_jme3_texture_plugins_AndroidNativeImageLoader.h /jme3-android-native/stb_image.h !/jme3-bullet-native/libs/native/windows/x86_64/bulletjme.dll !/jme3-bullet-native/libs/native/windows/x86/bulletjme.dll diff --git a/.travis.yml b/.travis.yml index 051a9142f..d25843799 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,20 @@ matrix: - os: osx osx_image: xcode9.3 env: UPLOAD_NATIVE=true + - language: android + os: linux + dist: trusty + jdk: openjdk10 + install: + - export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee' + - echo y | sdkmanager "ndk-bundle" &> /dev/null + before_script: + - export ANDROID_NDK=$ANDROID_HOME/ndk-bundle + script: + - ./gradlew -PbuildNativeProjects=true jme3-android-native:assemble + after_success: + - '[ "$TRAVIS_PULL_REQUEST" == "false" ] && ./private/upload_native.sh || :' + - '[ -n "$TRAVIS_TAG" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && ./gradlew bintrayUpload || :' addons: ssh_known_hosts: github.com diff --git a/jme3-android-native/.gitignore b/jme3-android-native/.gitignore new file mode 100644 index 000000000..9010f892c --- /dev/null +++ b/jme3-android-native/.gitignore @@ -0,0 +1,2 @@ +# The headers are autogenerated and nobody should try to commit them... +src/native/headers diff --git a/jme3-android-native/build.gradle b/jme3-android-native/build.gradle index 0ca99df77..50e6f9417 100644 --- a/jme3-android-native/build.gradle +++ b/jme3-android-native/build.gradle @@ -46,4 +46,4 @@ ext { apply from: file('openalsoft.gradle') // apply from: file('stb_image.gradle') // apply from: file('tremor.gradle') -apply from: file('decode.gradle') \ No newline at end of file +apply from: file('decode.gradle') diff --git a/jme3-android-native/decode.gradle b/jme3-android-native/decode.gradle index f5ab90a00..e8e685c03 100644 --- a/jme3-android-native/decode.gradle +++ b/jme3-android-native/decode.gradle @@ -12,6 +12,7 @@ String decodePreCompiledLibsDir = 'libs' + File.separator + 'decode' // jME Android Native source files path String decodeSourceDir = 'src/native/jme_decode' +String jmeHeaders = 'src/native/headers' task downloadStbImage(type: MyDownload) { sourceUrl = stbiUrl @@ -45,24 +46,13 @@ task copyTremorFiles(type: Copy) { into outputDir } -// Generate headers via javac -h -task generateJavahHeaders(type: Exec) { - def files0 = fileTree("src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def files1 = fileTree("src/common/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def files2 = fileTree("../jme3-core/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def files3 = fileTree("../jme3-core/src/plugins/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def files4 = fileTree("../jme3-core/src/tools/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def files5 = fileTree("../jme3-terrain/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def filesList = "\"" + files0.join("\"\n\"") + "\"\n\"" + files1.join("\"\n\"") + "\"\n\"" + files2.join("\"\n\"") + "\"\n\"" + files3.join("\"\n\"") + "\"\n\"" + files4.join("\"\n\"") + "\"\n\"" + files5.join("\"\n\"") + "\"" - new File("$projectDir/java_classes.jtxt").text = filesList.replaceAll(java.util.regex.Pattern.quote("\\"), java.util.regex.Matcher.quoteReplacement("/")) - executable org.gradle.internal.jvm.Jvm.current().getExecutable('javac') - args '-h', decodeSourceDir - args "@$projectDir/java_classes.jtxt" - args '-d', decodeClassesBuildDir +task copyJmeHeadersDecode(type: Copy) { + from file(jmeHeaders) + into file(decodeBuildJniDir + File.separator + "headers") } // Copy jME Android native files to jni directory -task copySourceToBuild(type: Copy, dependsOn:[copyTremorFiles, copyStbiFiles, generateJavahHeaders]) { +task copySourceToBuild(type: Copy, dependsOn:[copyTremorFiles, copyStbiFiles, copyJmeHeadersDecode]) { def sourceDir = file(decodeSourceDir) def outputDir = file(decodeBuildJniDir) diff --git a/jme3-android-native/openalsoft.gradle b/jme3-android-native/openalsoft.gradle index ed4eeacfd..4893f0ef3 100644 --- a/jme3-android-native/openalsoft.gradle +++ b/jme3-android-native/openalsoft.gradle @@ -18,6 +18,7 @@ String openalsoftPreCompiledLibsDir = 'libs' + File.separator + 'openalsoft' // jME Android Native source files path String openalsoftJmeAndroidPath = 'src/native/jme_openalsoft' +String jmeHeaders = 'src/native/headers' // Download external source files if not available task downloadOpenALSoft(type: MyDownload) { @@ -62,8 +63,14 @@ copyOpenALSoft.dependsOn { } } +// Copy JME Headers to jni directory +task copyJmeHeadersOpenAL(type: Copy) { + from file(jmeHeaders) + into file(openalsoftBuildJniDir + File.separator + "headers") +} + // Copy jME Android native files to jni directory -task copyJmeOpenALSoft(type: Copy, dependsOn:copyOpenALSoft) { +task copyJmeOpenALSoft(type: Copy, dependsOn: [copyOpenALSoft, copyJmeHeadersOpenAL]) { def sourceDir = file(openalsoftJmeAndroidPath) def outputDir = file(openalsoftBuildJniDir) // println "copyJmeOpenALSoft sourceDir: " + sourceDir @@ -73,22 +80,7 @@ task copyJmeOpenALSoft(type: Copy, dependsOn:copyOpenALSoft) { into outputDir } -task generateOpenAlSoftHeaders(type:Exec, dependsOn: copyJmeOpenALSoft) { - def files0 = fileTree("src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def files1 = fileTree("src/common/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def files2 = fileTree("../jme3-core/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def files3 = fileTree("../jme3-core/src/plugins/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def files4 = fileTree("../jme3-core/src/tools/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def files5 = fileTree("../jme3-terrain/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files - def filesList = "\"" + files0.join("\"\n\"") + "\"\n\"" + files1.join("\"\n\"") + "\"\n\"" + files2.join("\"\n\"") + "\"\n\"" + files3.join("\"\n\"") + "\"\n\"" + files4.join("\"\n\"") + "\"\n\"" + files5.join("\"\n\"") + "\"" - new File("$projectDir/java_classes.jtxt").text = filesList.replaceAll(java.util.regex.Pattern.quote("\\"), java.util.regex.Matcher.quoteReplacement("/")) - executable org.gradle.internal.jvm.Jvm.current().getExecutable('javac') - args '-h', openalsoftJmeAndroidPath - args "@$projectDir/java_classes.jtxt" - args '-d', openalsoftClassesBuildDir -} - -task buildOpenAlSoftNativeLib(type: Exec, dependsOn: generateOpenAlSoftHeaders) { +task buildOpenAlSoftNativeLib(type: Exec, dependsOn: copyJmeOpenALSoft) { // println "openalsoft build dir: " + openalsoftBuildDir // println "ndkCommandPath: " + project.ndkCommandPath workingDir openalsoftBuildDir diff --git a/jme3-android-native/src/native/jme_decode/com_jme3_audio_plugins_NativeVorbisFile.c b/jme3-android-native/src/native/jme_decode/com_jme3_audio_plugins_NativeVorbisFile.c index 0b04cea1c..2e62dee6b 100644 --- a/jme3-android-native/src/native/jme_decode/com_jme3_audio_plugins_NativeVorbisFile.c +++ b/jme3-android-native/src/native/jme_decode/com_jme3_audio_plugins_NativeVorbisFile.c @@ -4,7 +4,7 @@ #include "Tremor/ivorbisfile.h" -#include "com_jme3_audio_plugins_NativeVorbisFile.h" +#include "../headers/com_jme3_audio_plugins_NativeVorbisFile.h" #ifndef NDEBUG #include @@ -345,4 +345,4 @@ JNIEXPORT void JNICALL Java_com_jme3_audio_plugins_NativeVorbisFile_close free(wrapper); free(ovf); (*env)->SetObjectField(env, nvf, nvf_field_ovf, NULL); -} \ No newline at end of file +} diff --git a/jme3-android-native/src/native/jme_decode/com_jme3_texture_plugins_AndroidNativeImageLoader.c b/jme3-android-native/src/native/jme_decode/com_jme3_texture_plugins_AndroidNativeImageLoader.c index b03dd8e7d..6d8084e6c 100644 --- a/jme3-android-native/src/native/jme_decode/com_jme3_texture_plugins_AndroidNativeImageLoader.c +++ b/jme3-android-native/src/native/jme_decode/com_jme3_texture_plugins_AndroidNativeImageLoader.c @@ -1,4 +1,4 @@ -#include "com_jme3_texture_plugins_AndroidNativeImageLoader.h" +#include "../headers/com_jme3_texture_plugins_AndroidNativeImageLoader.h" #include #ifndef NDEBUG diff --git a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidAL.c b/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidAL.c index 0b6fb61b7..10ba99755 100644 --- a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidAL.c +++ b/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidAL.c @@ -1,4 +1,4 @@ -#include "com_jme3_audio_android_AndroidAL.h" +#include "../headers/com_jme3_audio_android_AndroidAL.h" #include "AL/al.h" #include "AL/alext.h" diff --git a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidAL.h b/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidAL.h deleted file mode 100644 index 1fa80bbf4..000000000 --- a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidAL.h +++ /dev/null @@ -1,173 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_jme3_audio_android_AndroidAL */ - -#ifndef _Included_com_jme3_audio_android_AndroidAL -#define _Included_com_jme3_audio_android_AndroidAL -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alGetString - * Signature: (I)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_com_jme3_audio_android_AndroidAL_alGetString - (JNIEnv *, jobject, jint); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alGenSources - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_com_jme3_audio_android_AndroidAL_alGenSources - (JNIEnv *, jobject); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alGetError - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_com_jme3_audio_android_AndroidAL_alGetError - (JNIEnv *, jobject); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alDeleteSources - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alDeleteSources - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alGenBuffers - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alGenBuffers - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alDeleteBuffers - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alDeleteBuffers - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alSourceStop - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alSourceStop - (JNIEnv *, jobject, jint); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alSourcei - * Signature: (III)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alSourcei - (JNIEnv *, jobject, jint, jint, jint); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alBufferData - * Signature: (IILjava/nio/ByteBuffer;II)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alBufferData - (JNIEnv *, jobject, jint, jint, jobject, jint, jint); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alSourcePlay - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alSourcePlay - (JNIEnv *, jobject, jint); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alSourcePause - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alSourcePause - (JNIEnv *, jobject, jint); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alSourcef - * Signature: (IIF)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alSourcef - (JNIEnv *, jobject, jint, jint, jfloat); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alSource3f - * Signature: (IIFFF)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alSource3f - (JNIEnv *, jobject, jint, jint, jfloat, jfloat, jfloat); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alGetSourcei - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_com_jme3_audio_android_AndroidAL_alGetSourcei - (JNIEnv *, jobject, jint, jint); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alSourceUnqueueBuffers - * Signature: (IILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alSourceUnqueueBuffers - (JNIEnv *, jobject, jint, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alSourceQueueBuffers - * Signature: (IILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alSourceQueueBuffers - (JNIEnv *, jobject, jint, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alListener - * Signature: (ILjava/nio/FloatBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alListener - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alListenerf - * Signature: (IF)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alListenerf - (JNIEnv *, jobject, jint, jfloat); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alListener3f - * Signature: (IFFF)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alListener3f - (JNIEnv *, jobject, jint, jfloat, jfloat, jfloat); - -/* - * Class: com_jme3_audio_android_AndroidAL - * Method: alSource3i - * Signature: (IIIII)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidAL_alSource3i - (JNIEnv *, jobject, jint, jint, jint, jint, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidALC.c b/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidALC.c index 4438910cc..c919f951a 100644 --- a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidALC.c +++ b/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidALC.c @@ -1,5 +1,5 @@ #include "util.h" -#include "com_jme3_audio_android_AndroidALC.h" +#include "../headers/com_jme3_audio_android_AndroidALC.h" #include "AL/alc.h" #include "AL/alext.h" @@ -171,4 +171,4 @@ JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidALC_alcDeviceResumeSOF if (device == NULL) return; alcDeviceResumeSOFT(device); -} \ No newline at end of file +} diff --git a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidALC.h b/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidALC.h deleted file mode 100644 index e50b7b511..000000000 --- a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidALC.h +++ /dev/null @@ -1,77 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_jme3_audio_android_AndroidALC */ - -#ifndef _Included_com_jme3_audio_android_AndroidALC -#define _Included_com_jme3_audio_android_AndroidALC -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: com_jme3_audio_android_AndroidALC - * Method: createALC - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidALC_createALC - (JNIEnv *, jobject); - -/* - * Class: com_jme3_audio_android_AndroidALC - * Method: destroyALC - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidALC_destroyALC - (JNIEnv *, jobject); - -/* - * Class: com_jme3_audio_android_AndroidALC - * Method: isCreated - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_com_jme3_audio_android_AndroidALC_isCreated - (JNIEnv *, jobject); - -/* - * Class: com_jme3_audio_android_AndroidALC - * Method: alcGetString - * Signature: (I)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_com_jme3_audio_android_AndroidALC_alcGetString - (JNIEnv *, jobject, jint); - -/* - * Class: com_jme3_audio_android_AndroidALC - * Method: alcIsExtensionPresent - * Signature: (Ljava/lang/String;)Z - */ -JNIEXPORT jboolean JNICALL Java_com_jme3_audio_android_AndroidALC_alcIsExtensionPresent - (JNIEnv *, jobject, jstring); - -/* - * Class: com_jme3_audio_android_AndroidALC - * Method: alcGetInteger - * Signature: (ILjava/nio/IntBuffer;I)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidALC_alcGetInteger - (JNIEnv *, jobject, jint, jobject, jint); - -/* - * Class: com_jme3_audio_android_AndroidALC - * Method: alcDevicePauseSOFT - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidALC_alcDevicePauseSOFT - (JNIEnv *, jobject); - -/* - * Class: com_jme3_audio_android_AndroidALC - * Method: alcDeviceResumeSOFT - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidALC_alcDeviceResumeSOFT - (JNIEnv *, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidEFX.c b/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidEFX.c index ea50c2672..6d3b623db 100644 --- a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidEFX.c +++ b/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidEFX.c @@ -1,5 +1,5 @@ #include "util.h" -#include "com_jme3_audio_android_AndroidEFX.h" +#include "../headers/com_jme3_audio_android_AndroidEFX.h" #include "AL/alext.h" JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alGenAuxiliaryEffectSlots @@ -72,4 +72,4 @@ JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alEffectf (JNIEnv* env, jobject obj, jint effect, jint param, jfloat value) { alEffectf((ALuint)effect, (ALenum)param, (ALfloat)value); -} \ No newline at end of file +} diff --git a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidEFX.h b/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidEFX.h deleted file mode 100644 index 4bdd94f07..000000000 --- a/jme3-android-native/src/native/jme_openalsoft/com_jme3_audio_android_AndroidEFX.h +++ /dev/null @@ -1,101 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class com_jme3_audio_android_AndroidEFX */ - -#ifndef _Included_com_jme3_audio_android_AndroidEFX -#define _Included_com_jme3_audio_android_AndroidEFX -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: com_jme3_audio_android_AndroidEFX - * Method: alGenAuxiliaryEffectSlots - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alGenAuxiliaryEffectSlots - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidEFX - * Method: alGenEffects - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alGenEffects - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidEFX - * Method: alEffecti - * Signature: (III)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alEffecti - (JNIEnv *, jobject, jint, jint, jint); - -/* - * Class: com_jme3_audio_android_AndroidEFX - * Method: alAuxiliaryEffectSloti - * Signature: (III)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alAuxiliaryEffectSloti - (JNIEnv *, jobject, jint, jint, jint); - -/* - * Class: com_jme3_audio_android_AndroidEFX - * Method: alDeleteEffects - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alDeleteEffects - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidEFX - * Method: alDeleteAuxiliaryEffectSlots - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alDeleteAuxiliaryEffectSlots - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidEFX - * Method: alGenFilters - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alGenFilters - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidEFX - * Method: alFilteri - * Signature: (III)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alFilteri - (JNIEnv *, jobject, jint, jint, jint); - -/* - * Class: com_jme3_audio_android_AndroidEFX - * Method: alFilterf - * Signature: (IIF)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alFilterf - (JNIEnv *, jobject, jint, jint, jfloat); - -/* - * Class: com_jme3_audio_android_AndroidEFX - * Method: alDeleteFilters - * Signature: (ILjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alDeleteFilters - (JNIEnv *, jobject, jint, jobject); - -/* - * Class: com_jme3_audio_android_AndroidEFX - * Method: alEffectf - * Signature: (IIF)V - */ -JNIEXPORT void JNICALL Java_com_jme3_audio_android_AndroidEFX_alEffectf - (JNIEnv *, jobject, jint, jint, jfloat); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/jme3-android/build.gradle b/jme3-android/build.gradle index 4caad528e..98a2b37a0 100644 --- a/jme3-android/build.gradle +++ b/jme3-android/build.gradle @@ -1,3 +1,5 @@ +apply plugin: 'java' + if (!hasProperty('mainClass')) { ext.mainClass = '' } @@ -7,3 +9,8 @@ dependencies { compile project(':jme3-plugins') compileOnly 'android:android' } + +compileJava { + // The Android-Native Project requires the jni headers to be generated, so we do that here + options.compilerArgs += ["-h", "${project.rootDir}/jme3-android-native/src/native/headers"] +}