mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-10-01 10:47:23 +02:00
f3f9d1b523
This is somewhat convenient for development, as it means that Android Studio will only do a native build for the architecture of the device being used for testing. This is ignored for AABs, so it won't affect release builds (at least for Google Play).
75 lines
1.9 KiB
Groovy
75 lines
1.9 KiB
Groovy
def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
|
|
def buildAsApplication = !buildAsLibrary
|
|
if (buildAsApplication) {
|
|
apply plugin: 'com.android.application'
|
|
}
|
|
else {
|
|
apply plugin: 'com.android.library'
|
|
}
|
|
|
|
android {
|
|
if (buildAsApplication) {
|
|
namespace "com.distractionware.vvvvvv"
|
|
}
|
|
compileSdkVersion 34
|
|
defaultConfig {
|
|
minSdkVersion 19
|
|
targetSdkVersion 34
|
|
versionCode 1
|
|
versionName "1.0"
|
|
externalNativeBuild {
|
|
cmake {
|
|
arguments "-DANDROID_APP_PLATFORM=android-19", "-DANDROID_STL=c++_static"
|
|
}
|
|
}
|
|
}
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
applicationVariants.all { variant ->
|
|
tasks["merge${variant.name.capitalize()}Assets"]
|
|
.dependsOn("externalNativeBuild${variant.name.capitalize()}")
|
|
}
|
|
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
|
|
sourceSets.main {
|
|
jniLibs.srcDir 'libs'
|
|
}
|
|
externalNativeBuild {
|
|
cmake {
|
|
path 'jni/CMakeLists.txt'
|
|
}
|
|
}
|
|
|
|
}
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
splits {
|
|
abi {
|
|
enable true
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
}
|