2016-08-13 06:11:29 +00:00
|
|
|
apply plugin: 'com.android.library'
|
|
|
|
|
|
|
|
android {
|
2019-07-14 19:50:20 +00:00
|
|
|
compileSdkVersion appAndroidCompileSDK
|
2016-09-16 00:03:14 +00:00
|
|
|
|
2018-08-21 02:00:35 +00:00
|
|
|
defaultConfig {
|
|
|
|
//noinspection MinSdkTooLow
|
2019-07-14 19:50:20 +00:00
|
|
|
minSdkVersion appAndroidMinSDK
|
2019-07-30 20:50:40 +00:00
|
|
|
|
|
|
|
consumerProguardFiles 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
jniLibs.srcDirs = ['libs']
|
|
|
|
}
|
2018-08-21 02:00:35 +00:00
|
|
|
}
|
2018-08-04 00:56:40 +00:00
|
|
|
}
|
2019-07-30 20:50:40 +00:00
|
|
|
|
|
|
|
configurations { natives }
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
//TODO migrate this to implementation from api
|
|
|
|
//in order to do this I have to remove 100% of libGDX API access from core
|
|
|
|
api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
|
|
|
|
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
|
|
|
|
implementation "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
|
|
|
|
implementation "com.badlogicgames.gdx:gdx-controllers-android:$gdxVersion"
|
|
|
|
}
|
|
|
|
|
|
|
|
// called every time gradle gets executed, takes the native dependencies of
|
|
|
|
// the natives configuration, and extracts them to the proper libs/ folders
|
|
|
|
// so they get packed with the APK.
|
|
|
|
task copyAndroidNatives() {
|
|
|
|
file("libs/armeabi/").mkdirs()
|
|
|
|
file("libs/armeabi-v7a/").mkdirs()
|
|
|
|
file("libs/arm64-v8a/").mkdirs()
|
|
|
|
file("libs/x86_64/").mkdirs()
|
|
|
|
file("libs/x86/").mkdirs()
|
|
|
|
|
|
|
|
configurations.natives.files.each { jar ->
|
|
|
|
def outputDir = null
|
|
|
|
if(jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
|
|
|
|
if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
|
|
|
|
if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
|
|
|
|
if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
|
|
|
|
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
|
|
|
|
if(outputDir != null) {
|
|
|
|
copy {
|
|
|
|
from zipTree(jar)
|
|
|
|
into outputDir
|
|
|
|
include "*.so"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|