| 1 |
import org.gradle.internal.os.OperatingSystem; |
| 2 |
|
| 3 |
apply plugin: 'com.android.application' |
| 4 |
|
| 5 |
android { |
| 6 |
compileSdkVersion 29 |
| 7 |
// Each version of the Android Gradle Plugin now has a default version of the build tools |
| 8 |
//buildToolsVersion '29.0.2' |
| 9 |
|
| 10 |
// don't use Android.mk generated by Android Studio / Gradle |
| 11 |
sourceSets.main.jni.srcDirs = [] |
| 12 |
sourceSets.main.jniLibs.srcDirs = ['src/main/libs'] |
| 13 |
|
| 14 |
defaultConfig { |
| 15 |
applicationId "org.liri.liri" |
| 16 |
minSdkVersion 16 |
| 17 |
targetSdkVersion 33 |
| 18 |
} |
| 19 |
|
| 20 |
buildTypes { |
| 21 |
release { |
| 22 |
minifyEnabled false |
| 23 |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' |
| 24 |
} |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
// call regular ndk-build script from app directory |
| 29 |
task ndkBuild(type: Exec) { |
| 30 |
if (OperatingSystem.current().isWindows()) { |
| 31 |
commandLine 'ndk-build.cmd', '-C', file('src/main').absolutePath, '-j', Runtime.runtime.availableProcessors() |
| 32 |
} else { |
| 33 |
commandLine 'ndk-build', '-C', file('src/main').absolutePath, '-j', Runtime.runtime.availableProcessors() |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
task ndkClean(type: Exec) { |
| 38 |
if (OperatingSystem.current().isWindows()) { |
| 39 |
commandLine 'ndk-build.cmd', '-C', file('src/main').absolutePath, 'clean' |
| 40 |
} else { |
| 41 |
commandLine 'ndk-build', '-C', file('src/main').absolutePath, 'clean' |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
tasks.withType(JavaCompile) { |
| 46 |
compileTask -> compileTask.dependsOn ndkBuild |
| 47 |
} |
| 48 |
|
| 49 |
clean.dependsOn 'ndkClean' |