2017-03-27 10:03:49 +00:00
plugins {
2024-07-16 14:53:35 +00:00
id 'com.gladed.androidgitversion' version '0.4.14'
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 {
2024-05-12 23:58:22 +00:00
// 1.2.0 is the newest version we can use that won't complain about minSdk version.
2021-03-13 14:49:25 +00:00
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 {
2024-05-12 23:58:22 +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
2024-09-09 09:00:30 +00:00
compileSdk 35
2022-11-06 08:44:06 +00:00
ndkVersion "21.4.7075529"
2024-10-10 10:10:20 +00:00
java {
toolchain {
languageVersion = JavaLanguageVersion . of ( 17 )
}
}
2017-03-13 22:45:25 +00:00
defaultConfig {
2024-05-12 23:58:22 +00:00
/ *
configurations . all {
resolutionStrategy {
// Newer versions are not compatible with our minsdk. Should find a way to exclude it entirely
// since we have no use for this transitive dependency.
force 'androidx.emoji2:emoji2-views-helper:1.0.0'
}
}
* /
2017-03-13 22:45:25 +00:00
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
2024-09-09 09:00:30 +00:00
targetSdk 35
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-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
]
}
2024-10-10 10:10:20 +00:00
normal {
res . srcDirs = [ 'normal/res' ]
}
2017-03-17 10:55:14 +00:00
gold {
res . srcDirs = [ 'gold/res' ]
}
2024-04-03 08:57:02 +00:00
vr {
2024-10-10 10:10:20 +00:00
res . srcDirs = [ 'normal/res' ]
2024-04-03 08:57:02 +00:00
manifest . srcFile 'VRManifest.xml'
}
2024-08-15 19:34:11 +00:00
legacy {
res . srcDirs = [ 'legacy/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=' ,
2024-04-03 08:57:02 +00:00
'-DANDROID_STL=c++_static'
2017-03-13 22:45:25 +00:00
}
}
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' ,
2024-04-03 08:57:02 +00:00
'-DGOLD=TRUE'
2022-07-31 13:27:15 +00:00
}
}
ndk {
2024-03-21 11:29:22 +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
}
2024-08-14 23:54:53 +00:00
legacy {
applicationId 'org.ppsspp.ppsspplegacy'
dimension "variant"
targetSdkVersion 29 // This is the point of legacy.
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_LEGACY=TRUE'
}
}
ndk {
abiFilters 'armeabi-v7a' , 'arm64-v8a'
}
}
2024-04-03 08:57:02 +00:00
vr {
applicationId 'org.ppsspp.ppssppvr'
dimension "variant"
targetSdkVersion 29 // Do not upgrade this, we depend on not requiring scoped storage on Oculus.
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' ,
2024-08-14 23:54:53 +00:00
'-DOPENXR=TRUE' ,
'-DANDROID_LEGACY=TRUE'
2024-04-03 08:57:02 +00:00
}
}
ndk {
abiFilters 'arm64-v8a'
}
}
2017-03-13 22:45:25 +00:00
}
2024-08-14 23:54:53 +00:00
// TODO: This is deprecated and needs a replacement. See https://stackoverflow.com/questions/67330818/android-gradle-plugin7-0-0-alpha15-removed-variantfilter-property-how-to-rest
// Though, not really that important.
2018-09-27 19:31:53 +00:00
variantFilter { variant - >
def needed = variant . name in [
2024-08-15 21:50:59 +00:00
'normalDebug' , // for debugging
'normalOptimized' , // for testing/user build
'normalRelease' , // for Google Play releases
2024-10-10 08:06:46 +00:00
'goldDebug' ,
2024-08-15 21:50:59 +00:00
'goldRelease' , // for Google Play releases
'vrDebug' , // for VR debugging
'vrOptimized' , // for VR testing
'vrRelease' , // for VR releases
'legacyDebug' , // for legacy debugging
'legacyOptimized' , // for legacy testing/user build
'legacyRelease' , // for buildbot 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
}