2023-03-06 07:01:37 +00:00
|
|
|
plugins {
|
|
|
|
id 'com.android.application'
|
|
|
|
id 'org.jetbrains.kotlin.android'
|
2023-03-21 05:56:58 +00:00
|
|
|
id 'kotlin-parcelize'
|
2023-03-06 07:01:37 +00:00
|
|
|
}
|
2022-12-18 07:25:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Use the number of seconds/10 since Jan 1 2016 as the versionCode.
|
|
|
|
* This lets us upload a new build at most every 10 seconds for the
|
|
|
|
* next 680 years.
|
|
|
|
*/
|
|
|
|
def autoVersion = (int) (((new Date().getTime() / 1000) - 1451606400) / 10)
|
|
|
|
def buildType
|
|
|
|
|
|
|
|
android {
|
2023-03-06 06:35:30 +00:00
|
|
|
namespace 'org.yuzu.yuzu_emu'
|
|
|
|
|
2023-03-06 06:26:43 +00:00
|
|
|
compileSdkVersion 33
|
2023-02-12 08:17:19 +00:00
|
|
|
ndkVersion "25.2.9519653"
|
2022-12-18 07:25:46 +00:00
|
|
|
|
2023-03-20 03:40:26 +00:00
|
|
|
viewBinding.enabled = true
|
|
|
|
|
2022-12-18 07:25:46 +00:00
|
|
|
compileOptions {
|
2023-03-06 06:54:10 +00:00
|
|
|
sourceCompatibility JavaVersion.VERSION_11
|
|
|
|
targetCompatibility JavaVersion.VERSION_11
|
2022-12-18 07:25:46 +00:00
|
|
|
}
|
|
|
|
|
2023-03-06 07:01:37 +00:00
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = '11'
|
|
|
|
}
|
|
|
|
|
2023-03-06 06:35:54 +00:00
|
|
|
lint {
|
2022-12-18 07:25:46 +00:00
|
|
|
// This is important as it will run lint but not abort on error
|
|
|
|
// Lint has some overly obnoxious "errors" that should really be warnings
|
|
|
|
abortOnError false
|
|
|
|
|
|
|
|
//Uncomment disable lines for test builds...
|
|
|
|
//disable 'MissingTranslation'bin
|
|
|
|
//disable 'ExtraTranslation'
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
// TODO If this is ever modified, change application_id in strings.xml
|
2022-12-31 02:09:03 +00:00
|
|
|
applicationId "org.yuzu.yuzu_emu"
|
2022-12-18 07:25:46 +00:00
|
|
|
minSdkVersion 28
|
2023-03-06 06:26:43 +00:00
|
|
|
targetSdkVersion 33
|
2022-12-18 07:25:46 +00:00
|
|
|
versionCode autoVersion
|
|
|
|
versionName getVersion()
|
2023-03-16 15:56:51 +00:00
|
|
|
ndk.abiFilters "arm64-v8a", "x86_64"
|
2023-04-04 16:54:45 +00:00
|
|
|
|
|
|
|
buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\""
|
|
|
|
buildConfigField "String", "BRANCH", "\"${getBranch()}\""
|
2022-12-18 07:25:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
signingConfigs {
|
|
|
|
//release {
|
|
|
|
// storeFile file('')
|
|
|
|
// storePassword System.getenv('ANDROID_KEYPASS')
|
|
|
|
// keyAlias = 'key0'
|
|
|
|
// keyPassword System.getenv('ANDROID_KEYPASS')
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
|
|
|
|
applicationVariants.all { variant ->
|
|
|
|
buildType = variant.buildType.name // sets the current build type
|
|
|
|
}
|
|
|
|
|
|
|
|
// Define build types, which are orthogonal to product flavors.
|
|
|
|
buildTypes {
|
|
|
|
|
|
|
|
// Signed by release key, allowing for upload to Play Store.
|
|
|
|
release {
|
|
|
|
signingConfig signingConfigs.debug
|
|
|
|
}
|
|
|
|
|
|
|
|
// builds a release build that doesn't need signing
|
|
|
|
// Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
|
|
|
|
relWithDebInfo {
|
|
|
|
initWith release
|
|
|
|
versionNameSuffix '-debug'
|
|
|
|
signingConfig signingConfigs.debug
|
|
|
|
minifyEnabled false
|
|
|
|
testCoverageEnabled false
|
|
|
|
debuggable true
|
|
|
|
jniDebuggable true
|
|
|
|
}
|
|
|
|
|
|
|
|
// Signed by debug key disallowing distribution on Play Store.
|
|
|
|
// Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
|
|
|
|
debug {
|
|
|
|
// TODO If this is ever modified, change application_id in debug/strings.xml
|
|
|
|
versionNameSuffix '-debug'
|
|
|
|
debuggable true
|
|
|
|
jniDebuggable true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
flavorDimensions "version"
|
|
|
|
productFlavors {
|
2023-03-05 02:19:35 +00:00
|
|
|
mainline {
|
2022-12-18 07:25:46 +00:00
|
|
|
dimension "version"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
version "3.22.1"
|
|
|
|
path "../../../CMakeLists.txt"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
arguments "-DENABLE_QT=0", // Don't use QT
|
|
|
|
"-DENABLE_SDL2=0", // Don't use SDL
|
|
|
|
"-DENABLE_WEB_SERVICE=0", // Don't use telemetry
|
2023-03-04 07:05:17 +00:00
|
|
|
"-DBUNDLE_SPEEX=ON",
|
2022-12-18 07:25:46 +00:00
|
|
|
"-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work
|
|
|
|
"-DYUZU_USE_BUNDLED_VCPKG=ON",
|
|
|
|
"-DYUZU_USE_BUNDLED_FFMPEG=ON"
|
|
|
|
|
2023-03-16 15:56:51 +00:00
|
|
|
abiFilters "arm64-v8a", "x86_64"
|
2022-12-18 07:25:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2023-03-06 07:01:37 +00:00
|
|
|
implementation 'androidx.core:core-ktx:1.9.0'
|
2023-03-06 06:51:36 +00:00
|
|
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
|
|
implementation 'androidx.exifinterface:exifinterface:1.3.6'
|
2022-12-18 07:25:46 +00:00
|
|
|
implementation 'androidx.cardview:cardview:1.0.0'
|
|
|
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
|
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
|
|
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1'
|
2023-03-06 06:51:36 +00:00
|
|
|
implementation 'androidx.fragment:fragment:1.5.5'
|
2022-12-18 07:25:46 +00:00
|
|
|
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
|
2023-02-04 00:13:16 +00:00
|
|
|
implementation "androidx.documentfile:documentfile:1.0.1"
|
2023-03-06 06:51:36 +00:00
|
|
|
implementation 'com.google.android.material:material:1.8.0'
|
2023-03-06 20:40:29 +00:00
|
|
|
implementation 'androidx.preference:preference:1.2.0'
|
|
|
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
|
2023-03-15 00:23:00 +00:00
|
|
|
implementation "io.coil-kt:coil:2.2.2"
|
2023-03-15 20:37:14 +00:00
|
|
|
implementation 'androidx.core:core-splashscreen:1.0.0'
|
2023-03-21 04:34:39 +00:00
|
|
|
implementation 'androidx.window:window:1.0.0'
|
2022-12-18 07:25:46 +00:00
|
|
|
implementation 'org.ini4j:ini4j:0.5.4'
|
|
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
|
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
|
|
|
}
|
|
|
|
|
|
|
|
def getVersion() {
|
|
|
|
def versionName = '0.0'
|
|
|
|
|
|
|
|
try {
|
|
|
|
versionName = 'git describe --always --long'.execute([], project.rootDir).text
|
|
|
|
.trim()
|
|
|
|
.replaceAll(/(-0)?-[^-]+$/, "")
|
|
|
|
} catch (Exception) {
|
|
|
|
logger.error('Cannot find git, defaulting to dummy version number')
|
|
|
|
}
|
|
|
|
|
|
|
|
if (System.getenv("GITHUB_ACTIONS") != null) {
|
|
|
|
def gitTag = System.getenv("GIT_TAG_NAME")
|
|
|
|
versionName = gitTag ?: versionName
|
|
|
|
}
|
|
|
|
|
|
|
|
return versionName
|
|
|
|
}
|
2023-04-04 16:54:45 +00:00
|
|
|
|
|
|
|
def getGitHash() {
|
|
|
|
try {
|
|
|
|
def gitHash = 'git rev-parse HEAD'.execute([], project.rootDir).text.trim()
|
|
|
|
return gitHash
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error(e + ': Cannot find git, defaulting to dummy build hash')
|
|
|
|
}
|
|
|
|
|
|
|
|
return '0'
|
|
|
|
}
|
|
|
|
|
|
|
|
def getBranch() {
|
|
|
|
try {
|
|
|
|
def branch = 'git rev-parse --abbrev-ref HEAD'.execute([], project.rootDir).text.trim()
|
|
|
|
return branch
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error(e + ': Cannot find git, defaulting to dummy branch')
|
|
|
|
}
|
|
|
|
|
|
|
|
return 'main'
|
|
|
|
}
|