Skip to content

Commit

Permalink
fix building with luajava as a separate module
Browse files Browse the repository at this point in the history
  • Loading branch information
Ildar Mulyukov committed Jun 19, 2020
1 parent 85789d4 commit 5d549c9
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*~

# built application files
*.apk
*.ap_
Expand Down
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ android {

}

dependencies {
api project(":luajava")
}

task fix_lua {
doLast {
exec {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/jni/luajava
28 changes: 28 additions & 0 deletions luajava/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
minSdkVersion 9
targetSdkVersion 28
externalNativeBuild {
ndkBuild {
abiFilters 'armeabi-v7a'
}
}
}

//disable JNI build
/*
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}
*/
sourceSets { main { jni.srcDirs = [] } }
}

// TODO: javah -o /tmp/luajava.h -classpath build/intermediates/intermediate-jars/debug/classes.jar org.keplerproject.luajava.LuaState
9 changes: 9 additions & 0 deletions luajava/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.keplerproject.luajava">

<application
android:allowBackup="true"
/>

</manifest>
2 changes: 1 addition & 1 deletion luajava/src/main/jni/luajava/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_C_INCLUDES += $(LOCAL_PATH)/../lua/lua
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../../../app/src/main/jni/lua/lua
LOCAL_MODULE := luajava
LOCAL_SRC_FILES := luajava.c
LOCAL_STATIC_LIBRARIES := liblua
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include ':app'
include ':luajava'

0 comments on commit 5d549c9

Please sign in to comment.