mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-15 11:00:09 -07:00
143 lines
4.2 KiB
Groovy
143 lines
4.2 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
static def getDate() { return new Date().format('yyyyMMdd')}
|
|
|
|
static def getDateSeconds() {
|
|
if(System.getenv("GITHUB_ACTIONS") == "true") {
|
|
return 9934841+Integer.parseInt(System.getenv("GITHUB_RUN_NUMBER"))
|
|
}else{
|
|
return 172005
|
|
}
|
|
}
|
|
|
|
def getVersionName = {
|
|
// Get the last version tag, as well as the short head of the last commit
|
|
ByteArrayOutputStream TAG = new ByteArrayOutputStream()
|
|
ByteArrayOutputStream BRANCH = new ByteArrayOutputStream()
|
|
exec {
|
|
try{
|
|
commandLine 'git', 'describe', '--tags'
|
|
ignoreExitValue true
|
|
standardOutput = TAG
|
|
}catch(Exception e){}
|
|
}
|
|
exec{
|
|
try{
|
|
commandLine 'git', 'branch', '--show-current'
|
|
ignoreExitValue true
|
|
standardOutput = BRANCH
|
|
}catch(Exception e){}
|
|
}
|
|
|
|
if(TAG.toString() == ""){
|
|
return ("LOCAL-" + "${getDate()}")
|
|
}
|
|
|
|
return TAG.toString().trim().replace("-g","-") + "-" + BRANCH.toString().trim();
|
|
}
|
|
|
|
android {
|
|
compileSdkVersion 31
|
|
dexOptions {
|
|
javaMaxHeapSize "4g"
|
|
}
|
|
|
|
lintOptions {
|
|
abortOnError false
|
|
}
|
|
|
|
signingConfigs {
|
|
customDebug {
|
|
storeFile file("debug.keystore")
|
|
storePassword "android"
|
|
keyAlias "androiddebugkey"
|
|
keyPassword "android"
|
|
}
|
|
googlePlayBuild {
|
|
storeFile file("upload.jks")
|
|
storePassword System.getenv("GPLAY_KEYSTORE_PASSWORD")
|
|
keyAlias "upload"
|
|
keyPassword System.getenv("GPLAY_KEYSTORE_PASSWORD")
|
|
}
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId "net.kdt.pojavlaunch"
|
|
minSdkVersion 21
|
|
targetSdkVersion 31
|
|
versionCode getDateSeconds()
|
|
versionName getVersionName()
|
|
multiDexEnabled true //important
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
applicationIdSuffix '.debug'
|
|
minifyEnabled false
|
|
shrinkResources false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
signingConfig signingConfigs.customDebug
|
|
resValue 'string', 'storageProviderAuthorities', 'net.kdt.pojavlaunch.scoped.gamefolder.debug'
|
|
}
|
|
proguard {
|
|
initWith debug
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
}
|
|
|
|
release {
|
|
// Don't set to true or java.awt will be a.a or something similar.
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
// defaultConfig already set
|
|
// multiDexEnabled = true
|
|
// debuggable = true
|
|
resValue 'string', 'storageProviderAuthorities', 'net.kdt.pojavlaunch.scoped.gamefolder'
|
|
}
|
|
gplay {
|
|
initWith release
|
|
signingConfig signingConfigs.googlePlayBuild
|
|
}
|
|
}
|
|
|
|
externalNativeBuild {
|
|
ndkBuild {
|
|
path file('src/main/jni/Android.mk')
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
bundle {
|
|
language {
|
|
enableSplit = false
|
|
}
|
|
}
|
|
buildToolsVersion '30.0.2'
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'javax.annotation:javax.annotation-api:1.3.2'
|
|
implementation 'commons-codec:commons-codec:1.14'
|
|
// implementation 'com.wu-man:android-bsf-api:3.1.3'
|
|
implementation 'androidx.preference:preference:1.1.1'
|
|
//implementation 'androidx.core:core:1.7.0'
|
|
implementation 'androidx.drawerlayout:drawerlayout:1.1.1'
|
|
implementation 'androidx.viewpager2:viewpager2:1.0.0'
|
|
implementation 'androidx.annotation:annotation:1.3.0'
|
|
|
|
implementation "androidx.constraintlayout:constraintlayout:2.1.2"
|
|
|
|
implementation 'com.github.duanhong169:checkerboarddrawable:1.0.2'
|
|
|
|
|
|
// implementation 'com.intuit.sdp:sdp-android:1.0.5'
|
|
// implementation 'com.intuit.ssp:ssp-android:1.0.5'
|
|
|
|
implementation 'org.tukaani:xz:1.8'
|
|
implementation 'com.github.PojavLauncherTeam:exp4j:master-SNAPSHOT'
|
|
// implementation 'net.sourceforge.streamsupport:streamsupport-cfuture:1.7.0'
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
}
|