version number set to 4.3.4.1
[rocksndiamonds.git] / build-projects / android / app / build.gradle.tmpl
1 def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
2 def buildAsApplication = !buildAsLibrary
3 if (buildAsApplication) {
4     apply plugin: 'com.android.application'
5 }
6 else {
7     apply plugin: 'com.android.library'
8 }
9
10 android {
11     compileSdkVersion 31
12
13     defaultConfig {
14         if (buildAsApplication) {
15             applicationId "org.artsoft.rocksndiamonds"
16         }
17
18         minSdkVersion 17
19         targetSdkVersion 31
20
21         versionCode  __VERSION_CODE__
22         versionName "__VERSION_NAME__"
23
24         externalNativeBuild {
25             ndkBuild {
26                 arguments "APP_PLATFORM=android-17"
27                 abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
28             }
29         }
30     }
31
32     buildTypes {
33         release {
34             minifyEnabled false
35             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
36         }
37     }
38
39     if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
40         sourceSets.main {
41             jniLibs.srcDir 'libs'
42         }
43
44         externalNativeBuild {
45             ndkBuild {
46                 path 'jni/Android.mk'
47             }
48         }
49     }
50
51     lintOptions {
52         abortOnError false
53     }
54
55     if (buildAsLibrary) {
56         libraryVariants.all { variant ->
57             variant.outputs.each { output ->
58                 def outputFile = output.outputFile
59                 if (outputFile != null && outputFile.name.endsWith(".aar")) {
60                     def fileName = "org.libsdl.app.aar";
61                     output.outputFile = new File(outputFile.parent, fileName);
62                 }
63             }
64         }
65     }
66
67     aaptOptions {
68         ignoreAssetsPattern ""
69     }
70 }
71
72 dependencies {
73     implementation fileTree(include: ['*.jar'], dir: 'libs')
74 }