bullet: test mac native upload

native-compilation-test
Kirill Vainer 8 years ago
parent de1acb6a9b
commit 1e15fe0f44
  1. 11
      jme3-bullet-native/src/native/cpp/jmePhysicsSpace.cpp
  2. 5
      private/upload_native.sh

@ -36,6 +36,7 @@
* Author: Normen Hansen * Author: Normen Hansen
*/ */
jmePhysicsSpace::jmePhysicsSpace(JNIEnv* env, jobject javaSpace) { jmePhysicsSpace::jmePhysicsSpace(JNIEnv* env, jobject javaSpace) {
printf("hello\n");
//TODO: global ref? maybe not -> cleaning, rather callback class? //TODO: global ref? maybe not -> cleaning, rather callback class?
this->javaPhysicsSpace = env->NewWeakGlobalRef(javaSpace); this->javaPhysicsSpace = env->NewWeakGlobalRef(javaSpace);
this->env = env; this->env = env;
@ -117,16 +118,16 @@ void jmePhysicsSpace::createPhysicsSpace(jfloat minX, jfloat minY, jfloat minZ,
jmeUserPointer *up1 = (jmeUserPointer*) co1 -> getUserPointer(); jmeUserPointer *up1 = (jmeUserPointer*) co1 -> getUserPointer();
if (up0 != NULL && up1 != NULL) { if (up0 != NULL && up1 != NULL) {
collides = (up0->group & up1->groups) != 0 || (up1->group & up0->groups) != 0; collides = (up0->group & up1->groups) != 0 || (up1->group & up0->groups) != 0;
if(collides){ if(collides){
jmePhysicsSpace *dynamicsWorld = (jmePhysicsSpace *)up0->space; jmePhysicsSpace *dynamicsWorld = (jmePhysicsSpace *)up0->space;
JNIEnv* env = dynamicsWorld->getEnv(); JNIEnv* env = dynamicsWorld->getEnv();
jobject javaPhysicsSpace = env->NewLocalRef(dynamicsWorld->getJavaPhysicsSpace()); jobject javaPhysicsSpace = env->NewLocalRef(dynamicsWorld->getJavaPhysicsSpace());
jobject javaCollisionObject0 = env->NewLocalRef(up0->javaCollisionObject); jobject javaCollisionObject0 = env->NewLocalRef(up0->javaCollisionObject);
jobject javaCollisionObject1 = env->NewLocalRef(up1->javaCollisionObject); jobject javaCollisionObject1 = env->NewLocalRef(up1->javaCollisionObject);
jboolean notifyResult = env->CallBooleanMethod(javaPhysicsSpace, jmeClasses::PhysicsSpace_notifyCollisionGroupListeners, javaCollisionObject0, javaCollisionObject1); jboolean notifyResult = env->CallBooleanMethod(javaPhysicsSpace, jmeClasses::PhysicsSpace_notifyCollisionGroupListeners, javaCollisionObject0, javaCollisionObject1);
env->DeleteLocalRef(javaPhysicsSpace); env->DeleteLocalRef(javaPhysicsSpace);
env->DeleteLocalRef(javaCollisionObject0); env->DeleteLocalRef(javaCollisionObject0);
env->DeleteLocalRef(javaCollisionObject1); env->DeleteLocalRef(javaCollisionObject1);
@ -135,7 +136,7 @@ void jmePhysicsSpace::createPhysicsSpace(jfloat minX, jfloat minY, jfloat minZ,
env->Throw(env->ExceptionOccurred()); env->Throw(env->ExceptionOccurred());
return collides; return collides;
} }
collides = (bool) notifyResult; collides = (bool) notifyResult;
} }
@ -221,4 +222,4 @@ jobject jmePhysicsSpace::getJavaPhysicsSpace() {
jmePhysicsSpace::~jmePhysicsSpace() { jmePhysicsSpace::~jmePhysicsSpace() {
delete(dynamicsWorld); delete(dynamicsWorld);
} }

@ -1,11 +1,12 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
echo Running upload native ...
# NATIVE_CHANGES="$(git diff-tree --name-only "$TRAVIS_COMMIT" -- jme3-bullet-native/)" # NATIVE_CHANGES="$(git diff-tree --name-only "$TRAVIS_COMMIT" -- jme3-bullet-native/)"
# if [ "$NATIVE_CHANGES" != "" ]; then # if [ "$NATIVE_CHANGES" != "" ]; then
git config --global user.email "travis-ci" git config --global user.email "travis-ci"
git config --global user.name "travis-ci" git config --global user.name "travis-ci"
openssl aes-256-cbc -K $encrypted_f0a0b284e2e8_key -iv $encrypted_f0a0b284e2e8_iv -in private/key.enc -out "$HOME/.ssh/id_rsa" -d # openssl aes-256-cbc -K $encrypted_f0a0b284e2e8_key -iv $encrypted_f0a0b284e2e8_iv -in private/key.enc -out "$HOME/.ssh/id_rsa" -d
chmod 600 "$HOME/.ssh/id_rsa" # chmod 600 "$HOME/.ssh/id_rsa"
ls jme3-bullet-native/build/libs/bulletjme/shared/ ls jme3-bullet-native/build/libs/bulletjme/shared/
md5 -r jme3-bullet-native/libs/native/osx/x86/libbulletjme.dylib jme3-bullet-native/build/libs/bulletjme/shared/mac32/libbulletjme.dylib md5 -r jme3-bullet-native/libs/native/osx/x86/libbulletjme.dylib jme3-bullet-native/build/libs/bulletjme/shared/mac32/libbulletjme.dylib
git checkout "$TRAVIS_BRANCH" git checkout "$TRAVIS_BRANCH"

Loading…
Cancel
Save