Files
OxygenToolbox/app/build.gradle
2022-09-27 18:46:16 +08:00

114 lines
3.7 KiB
Groovy

plugins {
id 'com.android.application'
id 'com.mikepenz.aboutlibraries.plugin'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.fatapp.oxygentoolbox"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// Required when setting minSdkVersion to 20 or lower
multiDexEnabled true
Properties buildPro = loadBuildPro()
buildConfigField "String", "ROLL_APP_ID", buildPro['rollAppId']
buildConfigField "String", "ROLL_APP_SECRET", buildPro['rollAppSecret']
}
signingConfigs {
release {
Properties buildPro = loadBuildPro()
storeFile file(buildPro['storeFile'])
storePassword buildPro['storePassword']
keyAlias buildPro['keyAlias']
keyPassword buildPro['keyPassword']
}
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
}
android.applicationVariants.all {
variant ->
variant.outputs.all {
output -> outputFileName = new File(variant.name, "OxygenToolbox" + "_" + defaultConfig.versionName + "-" + defaultConfig.versionCode + "_" + buildType.name + ".apk")
}
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
namespace 'com.fatapp.oxygentoolbox'
}
def loadBuildPro() {
Properties buildProperties = new Properties()
buildProperties.load(new FileInputStream(file("../build.properties")))
return buildProperties
}
aboutLibraries {
registerAndroidTasks = false
configPath = "libConfig"
outputFileName = "dependencies.json"
exclusionPatterns = [
~'androidx.*',
~'org.jetbrains.*',
~"com.google.android.*",
~"com.google.guava:listenablefuture",
~"com.squareup.okio:okio-jvm"
]
}
task exportLibrariesToJson(group: 'build', description: 'Generate libraries definitions json file', type: com.mikepenz.aboutlibraries.plugin.AboutLibrariesTask, dependsOn: 'collectDependencies') {
resultDirectory = project.file('src/main/res/raw/')
variant = 'release'
}
afterEvaluate {
def assembleTask = tasks.findByName("assembleDebug")
assembleTask.dependsOn(exportLibrariesToJson)
}
dependencies {
//noinspection GradleDependency
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.2'
implementation 'androidx.core:core-splashscreen:1.0.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.github.KilleTom:BangScreenToolsMaster:v1.0.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
}