2023-09-02 22:23:17 +02:00
|
|
|
def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
|
|
|
|
def buildAsApplication = !buildAsLibrary
|
|
|
|
if (buildAsApplication) {
|
|
|
|
apply plugin: 'com.android.application'
|
2023-09-08 00:54:54 +02:00
|
|
|
} else {
|
2023-09-02 22:23:17 +02:00
|
|
|
apply plugin: 'com.android.library'
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
if (buildAsApplication) {
|
|
|
|
namespace "com.distractionware.vvvvvv"
|
|
|
|
}
|
|
|
|
compileSdkVersion 34
|
|
|
|
defaultConfig {
|
2023-09-08 00:10:28 +02:00
|
|
|
minSdkVersion 29
|
2023-09-02 22:23:17 +02:00
|
|
|
targetSdkVersion 34
|
2023-09-08 01:28:28 +02:00
|
|
|
versionCode 20004000
|
|
|
|
versionName "2.4"
|
|
|
|
applicationId "air.com.distractionware.vvvvvvmobile"
|
2023-09-02 22:23:17 +02:00
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
2023-09-08 00:10:28 +02:00
|
|
|
arguments "-DANDROID_APP_PLATFORM=android-29", "-DANDROID_STL=c++_static"
|
2023-09-02 22:23:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
applicationVariants.all { variant ->
|
|
|
|
tasks["merge${variant.name.capitalize()}Assets"]
|
2023-09-08 00:54:54 +02:00
|
|
|
.dependsOn("externalNativeBuild${variant.name.capitalize()}")
|
2023-09-02 22:23:17 +02:00
|
|
|
}
|
|
|
|
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
|
|
|
|
sourceSets.main {
|
|
|
|
jniLibs.srcDir 'libs'
|
|
|
|
}
|
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
path 'jni/CMakeLists.txt'
|
|
|
|
}
|
|
|
|
}
|
2023-09-08 00:20:57 +02:00
|
|
|
|
2023-09-02 22:23:17 +02:00
|
|
|
}
|
|
|
|
lint {
|
|
|
|
abortOnError false
|
|
|
|
}
|
|
|
|
aaptOptions {
|
|
|
|
noCompress 'zip'
|
|
|
|
}
|
|
|
|
|
|
|
|
if (buildAsLibrary) {
|
|
|
|
libraryVariants.all { variant ->
|
|
|
|
variant.outputs.each { output ->
|
|
|
|
def outputFile = output.outputFile
|
|
|
|
if (outputFile != null && outputFile.name.endsWith(".aar")) {
|
|
|
|
def fileName = "org.libsdl.app.aar";
|
|
|
|
output.outputFile = new File(outputFile.parent, fileName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-09-05 19:11:13 +02:00
|
|
|
|
|
|
|
splits {
|
|
|
|
abi {
|
|
|
|
enable true
|
|
|
|
}
|
|
|
|
}
|
2023-09-05 20:21:57 +02:00
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
assets {
|
|
|
|
srcDir layout.buildDirectory.dir("generated/main/assets")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def zipRepoAssetsTask = tasks.register("zipRepoAssets", Zip) {
|
|
|
|
from('../../fonts') { spec ->
|
|
|
|
spec.into('graphics')
|
|
|
|
}
|
|
|
|
from('../../lang') { spec ->
|
|
|
|
spec.into('lang')
|
|
|
|
}
|
|
|
|
archiveFileName.set('repo.zip')
|
|
|
|
destinationDirectory.value(layout.buildDirectory.dir("generated/main/assets"))
|
|
|
|
}
|
|
|
|
|
|
|
|
project.android.applicationVariants.configureEach { variant ->
|
|
|
|
def compressAssetsTask = project.tasks.named("merge${variant.name.capitalize()}Assets")
|
|
|
|
compressAssetsTask.configure { task ->
|
|
|
|
task.dependsOn zipRepoAssetsTask
|
|
|
|
}
|
2023-09-02 22:23:17 +02:00
|
|
|
}
|
|
|
|
|
2023-09-08 00:20:57 +02:00
|
|
|
afterEvaluate {
|
2023-09-08 00:54:54 +02:00
|
|
|
[lintReportDebug, lintAnalyzeDebug, lintReportRelease, lintAnalyzeRelease, lintVitalReportRelease, lintVitalAnalyzeRelease].each { task ->
|
2023-09-08 00:20:57 +02:00
|
|
|
task.dependsOn zipRepoAssetsTask
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-02 22:23:17 +02:00
|
|
|
dependencies {
|
|
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
2023-09-08 00:10:28 +02:00
|
|
|
implementation 'org.jetbrains:annotations:15.0'
|
|
|
|
implementation 'androidx.core:core:1.10.1'
|
|
|
|
implementation 'androidx.exifinterface:exifinterface:1.3.6'
|
2023-09-02 22:23:17 +02:00
|
|
|
}
|