2024-04-25 11:23:38 -07:00
|
|
|
def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
|
|
|
|
def buildAsApplication = !buildAsLibrary
|
|
|
|
if (buildAsApplication) {
|
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
apply plugin: 'com.android.library'
|
|
|
|
}
|
|
|
|
android {
|
|
|
|
buildFeatures {
|
|
|
|
prefab true
|
|
|
|
}
|
2024-10-19 16:37:43 -07:00
|
|
|
ndkVersion "${project.ndk_version}"
|
2024-04-25 11:23:38 -07:00
|
|
|
if (buildAsApplication) {
|
2024-04-28 12:31:40 -07:00
|
|
|
namespace "com.complecwaft.looper"
|
2024-04-25 11:23:38 -07:00
|
|
|
}
|
|
|
|
compileSdkVersion 34
|
|
|
|
defaultConfig {
|
|
|
|
minSdkVersion 30
|
|
|
|
targetSdkVersion 34
|
2024-10-21 13:28:38 -07:00
|
|
|
def revListStdout = new ByteArrayOutputStream();
|
|
|
|
exec {
|
|
|
|
executable "git"
|
|
|
|
commandLine "git", "rev-list", "--count", "HEAD"
|
|
|
|
standardOutput revListStdout
|
|
|
|
}
|
|
|
|
def revParseStdout = new ByteArrayOutputStream();
|
|
|
|
def versionNameData = ""
|
|
|
|
exec {
|
|
|
|
commandLine "git", "rev-parse", "--abbref-rev", "HEAD"
|
|
|
|
standardOutput revParseStdout
|
|
|
|
}
|
|
|
|
versionNameData = revParseStdout.toString() + "-"
|
|
|
|
revParseStdout = new ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine "git", "rev-parse", "--short", "HEAD"
|
|
|
|
standardOutput revParseStdout
|
|
|
|
}
|
|
|
|
versionCode revListStdout.toString() as Integer
|
|
|
|
versionName versionNameData + revParseStdout.toString()
|
2024-04-25 11:23:38 -07:00
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
arguments "-DUSE_GLES=ON", "-DUSE_PORTALS=OFF", "-DDOWNLOAD_AUDIO_CODECS_DEPENDENCY=ON", "-DENABLE_DBUS=OFF", "-DBUILD_SDL=ON", "-DBUILD_SDL_IMAGE=ON", "-DDISABLE_GTK_UI=ON", "-DDISABLE_IMGUI_UI=OFF"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
path 'jni/CMakeLists.txt';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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'
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
lint {
|
|
|
|
abortOnError false
|
|
|
|
}
|
|
|
|
|
|
|
|
if (buildAsLibrary) {
|
|
|
|
libraryVariants.all { variant ->
|
|
|
|
variant.outputs.each { output ->
|
|
|
|
def outputFile = output.outputFile
|
|
|
|
if (outputFile != null && outputFile.name.endsWith(".aar")) {
|
2024-04-28 12:31:40 -07:00
|
|
|
def fileName = "com.complecwaft.looper.app.aar";
|
2024-04-25 11:23:38 -07:00
|
|
|
output.outputFile = new File(outputFile.parent, fileName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-10-21 13:28:38 -07:00
|
|
|
implementation "androidx.core:core:1.13.1"
|
2024-04-25 11:23:38 -07:00
|
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
|
|
implementation group: 'com.getkeepsafe.relinker', name: 'relinker', version: '1.4.5'
|
|
|
|
}
|