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 {
|
2020-06-27 09:11:04 +00:00
|
|
|
codeFormat = "MNNPPBBBB"
|
2017-03-27 10:03:49 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2021-03-13 14:49:25 +00:00
|
|
|
dependencies {
|
|
|
|
def appcompat_version = "1.2.0"
|
|
|
|
|
|
|
|
implementation "androidx.appcompat:appcompat:$appcompat_version"
|
2021-06-06 08:19:17 +00:00
|
|
|
|
|
|
|
// Convenient wrapper around DocumentContract. Might look into writing our own
|
|
|
|
// to see if there's some performance to squeeze at some point, but doubt it.
|
2021-02-28 12:46:08 +00:00
|
|
|
implementation "androidx.documentfile:documentfile:1.0.1"
|
2021-03-13 14:49:25 +00:00
|
|
|
}
|
|
|
|
|
2017-03-13 22:45:25 +00:00
|
|
|
android {
|
2017-05-18 10:34:44 +00:00
|
|
|
flavorDimensions "variant"
|
2023-03-02 11:51:55 +00:00
|
|
|
namespace 'org.ppsspp.ppsspp'
|
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
|
|
|
}
|
|
|
|
}
|
2023-04-29 21:54:47 +00:00
|
|
|
|
2023-08-22 15:10:25 +00:00
|
|
|
compileSdk 33
|
2022-11-06 08:44:06 +00:00
|
|
|
ndkVersion "21.4.7075529"
|
|
|
|
|
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.
|
2023-03-02 11:51:55 +00:00
|
|
|
println "Overriding Android Version Name, Code: " + androidGitVersion.name() + " " + androidGitVersion.code()
|
2017-03-27 10:03:49 +00:00
|
|
|
versionName androidGitVersion.name()
|
|
|
|
versionCode androidGitVersion.code()
|
|
|
|
} else {
|
2023-03-02 11:51:55 +00:00
|
|
|
println "(not using these:) Android Version Name, Code: " + androidGitVersion.name() + " " + androidGitVersion.code()
|
2017-03-27 10:03:49 +00:00
|
|
|
}
|
|
|
|
|
2017-03-27 14:58:08 +00:00
|
|
|
new File("versionname.txt").write(androidGitVersion.name())
|
|
|
|
new File("versioncode.txt").write(androidGitVersion.code().toString())
|
|
|
|
|
2023-08-22 15:10:25 +00:00
|
|
|
minSdk 9
|
|
|
|
targetSdk 33
|
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-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'
|
|
|
|
}
|
|
|
|
}
|
2023-02-08 16:26:36 +00:00
|
|
|
packagingOptions {
|
2023-03-02 11:51:55 +00:00
|
|
|
jniLibs {
|
|
|
|
excludes += ['lib/arm64-v8a/libopenxr_loader.so']
|
|
|
|
}
|
2023-12-12 16:26:22 +00:00
|
|
|
jniLibs.useLegacyPackaging = true
|
2023-02-08 16:26:36 +00:00
|
|
|
}
|
2017-03-13 22:45:25 +00:00
|
|
|
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
|
|
|
]
|
|
|
|
}
|
2017-03-17 10:55:14 +00:00
|
|
|
gold {
|
|
|
|
res.srcDirs = ['gold/res']
|
|
|
|
}
|
2023-02-08 16:26:36 +00:00
|
|
|
vr {
|
|
|
|
jniLibs.srcDirs = ['../ext/openxr/android']
|
|
|
|
manifest.srcFile 'VRManifest.xml'
|
2022-07-31 13:27:15 +00:00
|
|
|
}
|
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'
|
|
|
|
}
|
|
|
|
}
|
2022-07-31 13:27:15 +00:00
|
|
|
ndk {
|
2023-08-14 11:47:55 +00:00
|
|
|
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
|
2022-07-31 13:27:15 +00:00
|
|
|
}
|
2017-03-13 22:45:25 +00:00
|
|
|
}
|
|
|
|
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'
|
|
|
|
}
|
|
|
|
}
|
2022-07-31 13:27:15 +00:00
|
|
|
ndk {
|
2023-08-14 11:47:55 +00:00
|
|
|
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
|
2022-07-31 13:27:15 +00:00
|
|
|
}
|
|
|
|
}
|
2023-02-08 16:26:36 +00:00
|
|
|
vr {
|
2022-12-04 17:14:05 +00:00
|
|
|
applicationId 'org.ppsspp.ppssppvr'
|
2022-07-31 13:27:15 +00:00
|
|
|
dimension "variant"
|
2023-05-03 17:41:23 +00:00
|
|
|
targetSdkVersion 29
|
2022-07-31 13:27:15 +00:00
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
// Available arguments listed at https://developer.android.com/ndk/guides/cmake.html
|
|
|
|
arguments '-DANDROID=true',
|
|
|
|
'-DANDROID_PLATFORM=android-16',
|
|
|
|
'-DANDROID_TOOLCHAIN=clang',
|
|
|
|
'-DANDROID_CPP_FEATURES=',
|
|
|
|
'-DANDROID_STL=c++_static',
|
|
|
|
'-DANDROID_ARM_NEON=TRUE',
|
|
|
|
'-DOPENXR=TRUE'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ndk {
|
|
|
|
abiFilters 'arm64-v8a'
|
|
|
|
}
|
2017-03-13 22:45:25 +00:00
|
|
|
}
|
|
|
|
}
|
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
|
2022-07-31 13:27:15 +00:00
|
|
|
'goldRelease', // for Google Play releases
|
2023-02-08 16:41:50 +00:00
|
|
|
'vrDebug', // for VR debugging
|
|
|
|
'vrOptimized', // for VR testing
|
|
|
|
'vrRelease', // for VR releases
|
2018-09-27 19:31:53 +00:00
|
|
|
]
|
|
|
|
variant.setIgnore(!needed)
|
|
|
|
}
|
2023-04-18 08:41:24 +00:00
|
|
|
buildFeatures {
|
|
|
|
aidl true
|
2024-01-17 22:43:00 +00:00
|
|
|
buildConfig true
|
2023-04-18 08:41:24 +00:00
|
|
|
}
|
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
|
|
|
}
|