principia/android/principia/build.gradle
2025-03-04 23:17:47 +01:00

77 lines
1.7 KiB
Groovy

plugins {
id 'com.android.application'
id 'de.undercouch.download'
}
android {
compileSdk 35
ndkVersion "27.2.12479018"
namespace 'com.bithack.principia'
defaultConfig {
applicationId "com.bithack.principia"
minSdk 21
targetSdk 35
versionCode 37
versionName "2024.07.12"
externalNativeBuild {
ndkBuild {
arguments '-j' + Runtime.getRuntime().availableProcessors()
}
}
ndk {
abiFilters "arm64-v8a", "armeabi-v7a", "x86_64"
//abiFilters "arm64-v8a" // debugging on phone
//abiFilters "x86_64" // debugging on emulator
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
externalNativeBuild {
cmake {
path file("../../CMakeLists.txt")
}
}
sourceSets {
main {
assets.srcDirs = ['src/assets']
}
}
buildTypes {
release {
minifyEnabled false
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
}
// get precompiled deps
tasks.register('downloadDeps', Download) {
src 'https://github.com/principia-game/android-deps/releases/download/latest/deps.zip'
dest new File(buildDir, 'deps.zip')
overwrite false
}
tasks.register('getDeps', Copy) {
dependsOn downloadDeps
def deps = new File(buildDir.parent, '../deps')
if (!deps.exists()) {
deps.mkdir()
from zipTree(downloadDeps.dest)
into deps
}
}
preBuild.dependsOn getDeps