Files
EhViewer/app/build.gradle
T
2021-03-17 11:06:07 +08:00

176 lines
6.7 KiB
Groovy

import java.nio.file.Paths
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
signingConfigs {
def keystorePwd = null
def alias = null
def pwd = null
if (project.rootProject.file('local.properties').exists()) {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
keystorePwd = properties.getProperty("RELEASE_STORE_PASSWORD")
alias = properties.getProperty("RELEASE_KEY_ALIAS")
pwd = properties.getProperty("RELEASE_KEY_PASSWORD")
}
release {
storeFile file("hitokoto.jks")
storePassword keystorePwd != null ? keystorePwd : System.getenv("KEYSTORE_PASS")
keyAlias alias != null ? alias : System.getenv("ALIAS_NAME")
keyPassword pwd != null ? pwd : System.getenv("ALIAS_PASS")
}
}
defaultConfig {
applicationId "io.github.nekoinverter.ehviewer"
minSdkVersion 23
targetSdkVersion 30
versionCode 143
versionName "1.7.22"
resConfigs "zh", "zh-rCN", "zh-rHK", "zh-rTW",
"es", "ja", "ko", "fr", "de", "th"
testOptions.unitTests.includeAndroidResources = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
disable 'MissingTranslation'
abortOnError true
checkReleaseBuilds false
}
packagingOptions {
exclude 'META-INF/**'
exclude 'kotlin/**'
exclude 'org/**'
exclude '**.properties'
exclude '**.bin'
}
dependenciesInfo.includeInApk false
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
applicationIdSuffix ".debug"
signingConfig signingConfigs.release
}
}
sourceSets {
main {
java.srcDirs += 'src/main/java-gen'
}
}
}
tasks.withType(JavaCompile) {
task -> task.dependsOn ":daogenerator:executeDaoGenerator"
}
def optimizeReleaseResources = task('optimizeReleaseResources').doLast {
def aapt2 = Paths.get(project.android.sdkDirectory.path, 'build-tools', project.android.buildToolsVersion, 'aapt2')
def zip = Paths.get(
project.buildDir.path,
"intermediates",
"shrunk_processed_res",
"release",
"resources-release-stripped.ap_"
)
def optimized = new File("${zip}.opt")
def cmd = exec {
commandLine aapt2, 'optimize', '--collapse-resource-names',
'--shorten-resource-paths',
'-o', optimized, zip
ignoreExitValue false
}
if (cmd.exitValue == 0) {
delete(zip)
optimized.renameTo("$zip")
}
}
tasks.whenTaskAdded { task ->
if (task.name == 'shrinkReleaseRes') {
task.finalizedBy optimizeReleaseResources
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.activity:activity:1.2.1"
implementation 'androidx.appcompat:appcompat:1.3.0-beta01'
implementation 'androidx.biometric:biometric:1.1.0'
implementation "androidx.browser:browser:1.3.0"
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.core:core:1.5.0-beta03'
implementation 'androidx.dynamicanimation:dynamicanimation:1.1.0-alpha03'
implementation "androidx.fragment:fragment:1.3.1"
implementation "androidx.preference:preference:1.1.1"
implementation "androidx.recyclerview:recyclerview:1.2.0-beta02"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01"
implementation 'androidx.webkit:webkit:1.4.0'
implementation 'com.drakeet.drawer:drawer:1.0.3'
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.getkeepsafe.relinker:relinker:1.4.1'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.13.0'
implementation 'com.github.seven332.a7zip:extract-lite:1b21783'
implementation 'com.github.seven332:android-resource:0.1.0'
implementation 'com.github.seven332:beerbelly:0.1.4'
implementation 'com.github.seven332:glgallery:0.1.2'
implementation 'com.github.seven332:glview:0.1.0'
implementation 'com.github.seven332:glview-image:0.1.0'
implementation 'com.github.seven332:streampipe:0.1.0'
implementation 'com.github.seven332:tuxiang:0.1.6'
implementation 'com.github.seven332:unifile:9ec57bcd8f'
implementation 'com.github.seven332:yorozuya-thread:0.1.1'
implementation 'com.github.seven332:yorozuya-collect:0.1.4'
implementation 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:1.0.0'
def appCenterSdkVersion = '4.1.0'
implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
implementation "com.microsoft.appcenter:appcenter-distribute:${appCenterSdkVersion}"
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:4.9.1'
implementation 'com.takisoft.preferencex:preferencex:1.1.0'
implementation 'com.github.NekoInverter:Image:8fd6c1e1df'
implementation 'com.gitlab.NekoInverter:yorozuya:723dc867a9'
implementation 'dev.rikka.rikkax.appcompat:appcompat:1.2.0-rc01'
implementation 'dev.rikka.rikkax.core:core:1.3.0'
implementation 'dev.rikka.rikkax.material:material:1.6.0'
implementation 'dev.rikka.rikkax.recyclerview:recyclerview-adapter:1.2.0'
implementation 'dev.rikka.rikkax.recyclerview:recyclerview-ktx:1.2.0'
implementation 'dev.rikka.rikkax.widget:borderview:1.0.1'
implementation 'dev.rikka.rikkax.preference:simplemenu-preference:1.0.2'
implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
implementation 'org.greenrobot:greendao:3.3.0'
implementation 'org.jsoup:jsoup:1.13.1'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.2.1'
testImplementation 'org.jooq:joor:0.9.6'
}
configurations.all {
resolutionStrategy {
force 'com.github.seven332:glgallery:25893283ca'
force 'com.github.seven332:glview:ba6aee61d7'
force 'com.github.seven332:glview-image:68d94b0fc2'
exclude group: 'com.github.seven332', module: 'okhttp'
exclude group: 'com.github.seven332', module: 'image'
exclude group: 'com.github.seven332', module: 'yorozuya'
exclude group: 'androidx.appcompat', module: 'appcompat'
}
}