2 configurations { natives }
6 id "com.android.application"
10 def keystorePropertiesFile = rootProject.file("keystore.properties")
11 def keystoreProperties = new Properties()
12 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
15 namespace "ru.deadsoftware.cavedroid"
19 manifest.srcFile 'AndroidManifest.xml'
20 java.srcDirs = ['src']
21 aidl.srcDirs = ['src']
22 renderscript.srcDirs = ['src']
24 assets.srcDirs = ['assets']
25 jniLibs.srcDirs = ['libs']
28 res.srcDirs = ['debug/res']
32 sourceCompatibility 17
33 targetCompatibility 17
36 exclude 'META-INF/robovm/ios/robovm.xml'
39 applicationId "ru.deadsoftware.cavedroid"
43 versionName "alpha0.9.2"
45 applicationVariants.all { variant ->
47 outputFileName = "android-${versionName}.apk"
53 storeFile file(keystoreProperties['releaseKeystorePath'])
54 storePassword keystoreProperties['releaseKeystorePassword']
55 keyAlias keystoreProperties['releaseKeyAlias']
56 keyPassword keystoreProperties['releaseKeyPassword']
63 signingConfig signingConfigs.release_config
66 applicationIdSuffix ".debug"
76 // called every time gradle gets executed, takes the native dependencies of
77 // the natives configuration, and extracts them to the proper libs/ folders
78 // so they get packed with the APK.
79 task copyAndroidNatives {
81 file("libs/armeabi/").mkdirs()
82 file("libs/armeabi-v7a/").mkdirs()
83 file("libs/arm64-v8a/").mkdirs()
84 file("libs/x86_64/").mkdirs()
85 file("libs/x86/").mkdirs()
87 configurations.natives.files.each { jar ->
89 if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
90 if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
91 if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
92 if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
93 if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
94 if(outputDir != null) {
105 tasks.whenTaskAdded { packageTask ->
106 if (packageTask.name.contains("package")) {
107 packageTask.dependsOn 'copyAndroidNatives'
111 task run(type: Exec) {
113 def localProperties = project.file("../local.properties")
114 if (localProperties.exists()) {
115 Properties properties = new Properties()
116 localProperties.withInputStream { instr ->
117 properties.load(instr)
119 def sdkDir = properties.getProperty('sdk.dir')
123 path = "$System.env.ANDROID_HOME"
126 path = "$System.env.ANDROID_HOME"
129 def adb = path + "/platform-tools/adb"
130 commandLine "$adb", 'shell', 'am', 'start', '-n', 'ru.deadsoftware.cavedroid/ru.deadsoftware.cavedroid.AndroidLauncher'
134 implementation project(":core")
135 implementation platform("org.jetbrains.kotlin:kotlin-bom:$kotlinVersion")
136 api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
137 natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
138 natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
139 natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
140 natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
142 configurations.implementation {
143 exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'