2017-03-27 10:03:49 +00:00
|
|
|
plugins {
|
2018-10-06 17:16:29 +00:00
|
|
|
id 'com.gladed.androidgitversion' version '0.4.5'
|
2017-03-27 10:03:49 +00:00
|
|
|
}
|
2017-03-13 22:45:25 +00:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
2017-03-27 10:03:49 +00:00
|
|
|
androidGitVersion {
|
|
|
|
codeFormat = "MNPPBBBB"
|
|
|
|
format = "%tag%%-count%%-branch%%-dirty%"
|
|
|
|
prefix = "v" // Only tags beginning with v are considered.
|
2017-11-29 14:44:16 +00:00
|
|
|
untrackedIsDirty = false
|
2017-03-27 10:03:49 +00:00
|
|
|
}
|
|
|
|
|
2017-03-13 22:45:25 +00:00
|
|
|
android {
|
2017-05-18 10:34:44 +00:00
|
|
|
flavorDimensions "variant"
|
|
|
|
|
2017-03-13 22:45:25 +00:00
|
|
|
signingConfigs {
|
2017-03-16 12:13:30 +00:00
|
|
|
debug {
|
|
|
|
storeFile file("debug.keystore")
|
|
|
|
}
|
|
|
|
optimized {
|
|
|
|
storeFile file("debug.keystore")
|
|
|
|
}
|
2017-03-20 10:06:52 +00:00
|
|
|
|
|
|
|
// Set these in a system global (or project local, but not checked in) gradle.properties .
|
|
|
|
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
|
|
|
release {
|
|
|
|
storeFile file(RELEASE_STORE_FILE)
|
|
|
|
storePassword RELEASE_STORE_PASSWORD
|
|
|
|
keyAlias RELEASE_KEY_ALIAS
|
|
|
|
keyPassword RELEASE_KEY_PASSWORD
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
release {
|
|
|
|
}
|
2017-03-13 22:45:25 +00:00
|
|
|
}
|
|
|
|
}
|
2018-06-26 02:04:42 +00:00
|
|
|
compileSdkVersion 28
|
2018-09-27 18:48:21 +00:00
|
|
|
buildToolsVersion '28.0.3'
|
2017-03-13 22:45:25 +00:00
|
|
|
defaultConfig {
|
|
|
|
applicationId 'org.ppsspp.ppsspp'
|
2017-03-27 10:03:49 +00:00
|
|
|
if (androidGitVersion.name() != "unknown" && androidGitVersion.code() >= 14000000) {
|
|
|
|
// Start using automatic Android version numbers from version 1.4.
|
|
|
|
println "Overriding Android Version Name, Code: " + androidGitVersion.name() + " " + androidGitVersion.code();
|
|
|
|
versionName androidGitVersion.name()
|
|
|
|
versionCode androidGitVersion.code()
|
|
|
|
} else {
|
|
|
|
println "(not using these:) Android Version Name, Code: " + androidGitVersion.name() + " " + androidGitVersion.code();
|
|
|
|
}
|
|
|
|
|
2017-03-27 14:58:08 +00:00
|
|
|
new File("versionname.txt").write(androidGitVersion.name())
|
|
|
|
new File("versioncode.txt").write(androidGitVersion.code().toString())
|
|
|
|
|
2017-03-13 22:45:25 +00:00
|
|
|
minSdkVersion 9
|
2018-06-26 02:04:42 +00:00
|
|
|
targetSdkVersion 28
|
2017-03-23 09:47:58 +00:00
|
|
|
if (project.hasProperty("ANDROID_VERSION_CODE") && project.hasProperty("ANDROID_VERSION_NAME")) {
|
|
|
|
versionCode ANDROID_VERSION_CODE
|
|
|
|
versionName ANDROID_VERSION_NAME
|
|
|
|
}
|
2017-03-13 22:45:25 +00:00
|
|
|
ndk {
|
2017-10-15 23:14:15 +00:00
|
|
|
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
2017-03-13 22:45:25 +00:00
|
|
|
}
|
2017-03-16 12:13:30 +00:00
|
|
|
signingConfig signingConfigs.debug
|
2017-03-13 22:45:25 +00:00
|
|
|
}
|
|
|
|
buildTypes {
|
2017-03-16 12:13:30 +00:00
|
|
|
debug {
|
|
|
|
minifyEnabled = false
|
|
|
|
jniDebuggable true
|
|
|
|
signingConfig signingConfigs.debug
|
|
|
|
}
|
|
|
|
optimized {
|
|
|
|
// Debug signed but optimized.
|
2017-03-13 22:45:25 +00:00
|
|
|
minifyEnabled = false
|
2018-11-26 21:38:10 +00:00
|
|
|
jniDebuggable true
|
2017-03-16 12:13:30 +00:00
|
|
|
signingConfig android.buildTypes.debug.signingConfig
|
2017-03-13 22:45:25 +00:00
|
|
|
}
|
2017-03-23 09:47:58 +00:00
|
|
|
release {
|
|
|
|
minifyEnabled = false
|
|
|
|
signingConfig signingConfigs.release
|
|
|
|
}
|
2017-03-13 22:45:25 +00:00
|
|
|
}
|
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
path '../CMakeLists.txt'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
manifest.srcFile 'AndroidManifest.xml'
|
|
|
|
res.srcDirs = ['res']
|
|
|
|
java.srcDirs = ['src']
|
|
|
|
aidl.srcDirs = ['src']
|
|
|
|
resources.srcDirs = ['src']
|
|
|
|
assets.srcDirs = [
|
2017-03-31 08:56:30 +00:00
|
|
|
'../assets',
|
2017-03-13 22:45:25 +00:00
|
|
|
]
|
|
|
|
jni.srcDirs = ['..']
|
|
|
|
}
|
2017-03-17 10:55:14 +00:00
|
|
|
gold {
|
|
|
|
res.srcDirs = ['gold/res']
|
|
|
|
}
|
2017-03-13 22:45:25 +00:00
|
|
|
}
|
|
|
|
productFlavors {
|
|
|
|
normal {
|
|
|
|
applicationId 'org.ppsspp.ppsspp'
|
2017-05-18 10:34:44 +00:00
|
|
|
dimension "variant"
|
2017-03-13 22:45:25 +00:00
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
// Available arguments listed at https://developer.android.com/ndk/guides/cmake.html
|
|
|
|
arguments '-DANDROID=true',
|
2018-10-24 23:20:41 +00:00
|
|
|
'-DANDROID_PLATFORM=android-16',
|
2017-03-13 22:45:25 +00:00
|
|
|
'-DANDROID_TOOLCHAIN=clang',
|
|
|
|
'-DANDROID_CPP_FEATURES=',
|
2017-12-07 22:45:36 +00:00
|
|
|
'-DANDROID_STL=c++_static',
|
2017-03-13 22:45:25 +00:00
|
|
|
'-DANDROID_ARM_NEON=TRUE'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
gold {
|
|
|
|
applicationId 'org.ppsspp.ppssppgold'
|
2017-05-18 10:34:44 +00:00
|
|
|
dimension "variant"
|
2017-03-13 22:45:25 +00:00
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
// Available arguments listed at https://developer.android.com/ndk/guides/cmake.html
|
|
|
|
arguments '-DANDROID=true',
|
2018-10-24 23:20:41 +00:00
|
|
|
'-DANDROID_PLATFORM=android-16',
|
2017-03-13 22:45:25 +00:00
|
|
|
'-DANDROID_TOOLCHAIN=clang',
|
|
|
|
'-DANDROID_CPP_FEATURES=',
|
2017-12-07 22:45:36 +00:00
|
|
|
'-DANDROID_STL=c++_static',
|
2017-03-13 22:45:25 +00:00
|
|
|
'-DANDROID_ARM_NEON=TRUE',
|
|
|
|
'-DGOLD=TRUE'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-09-27 19:31:53 +00:00
|
|
|
variantFilter { variant ->
|
|
|
|
def needed = variant.name in [
|
|
|
|
'normalDebug', // for debugging
|
|
|
|
'normalOptimized', // for testing
|
|
|
|
'normalRelease', // for Google Play releases
|
|
|
|
'goldRelease' // for Google Play releases
|
|
|
|
]
|
|
|
|
variant.setIgnore(!needed)
|
|
|
|
}
|
2017-03-13 22:45:25 +00:00
|
|
|
}
|
|
|
|
afterEvaluate {
|
|
|
|
android.sourceSets.main.assets.getSrcDirs().each { println it }
|
|
|
|
}
|
2018-10-31 21:36:38 +00:00
|
|
|
|
|
|
|
// F-Droid lite version can be created with : ./gradlew assembleOptimized -Pf_droid
|
|
|
|
if (project.hasProperty("f_droid")) {
|
|
|
|
project.android.sourceSets.main.java.srcDirs += 'libs/MogaStubs'
|
|
|
|
} else {
|
|
|
|
project.dependencies {
|
|
|
|
implementation files('libs/com.bda.controller.jar')
|
|
|
|
}
|
2017-03-13 22:45:25 +00:00
|
|
|
}
|