You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
legado/app/build.gradle

228 lines
7.9 KiB

6 years ago
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
4 years ago
apply plugin: 'kotlin-parcelize'
6 years ago
apply plugin: 'kotlin-kapt'
apply plugin: 'de.timfreiheit.resourceplaceholders'
3 years ago
apply from: 'download.gradle'
6 years ago
6 years ago
static def releaseTime() {
return new Date().format("yy.MMddHH", TimeZone.getTimeZone("GMT+8"))
}
def name = "legado"
def version = "3." + releaseTime()
6 years ago
def gitCommits = Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim())
6 years ago
android {
3 years ago
compileSdkVersion 32
buildToolsVersion '32.0.0'
3 years ago
kotlinOptions {
jvmTarget = "11"
}
6 years ago
signingConfigs {
if (project.hasProperty("RELEASE_STORE_FILE")) {
myConfig {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
v1SigningEnabled true
v2SigningEnabled true
}
6 years ago
}
}
6 years ago
defaultConfig {
6 years ago
applicationId "io.legado.app"
6 years ago
minSdkVersion 21
3 years ago
targetSdkVersion 32
6 years ago
versionCode gitCommits
versionName version
6 years ago
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
6 years ago
project.ext.set("archivesBaseName", name + "_" + version)
5 years ago
multiDexEnabled true
3 years ago
5 years ago
javaCompileOptions {
annotationProcessorOptions {
4 years ago
arguments += [
5 years ago
"room.incremental" : "true",
4 years ago
"room.expandProjection": "true",
"room.schemaLocation" : "$projectDir/schemas".toString()
5 years ago
]
}
}
6 years ago
}
4 years ago
buildFeatures {
viewBinding true
}
6 years ago
buildTypes {
release {
buildConfigField "String", "Cronet_Version", "\"$CronetVersion\""
if (project.hasProperty("RELEASE_STORE_FILE")) {
signingConfig signingConfigs.myConfig
}
applicationIdSuffix '.release'
5 years ago
minifyEnabled false
6 years ago
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
6 years ago
debug {
buildConfigField "String", "Cronet_Version", "\"$CronetVersion\""
if (project.hasProperty("RELEASE_STORE_FILE")) {
signingConfig signingConfigs.myConfig
}
6 years ago
applicationIdSuffix '.debug'
versionNameSuffix 'debug'
minifyEnabled false
5 years ago
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
6 years ago
}
android.applicationVariants.all { variant ->
variant.outputs.all {
def flavor = variant.productFlavors[0].name
outputFileName = "${name}_${flavor}_${defaultConfig.versionName}.apk"
6 years ago
}
}
6 years ago
}
flavorDimensions "mode"
productFlavors {
app {
dimension "mode"
manifestPlaceholders = [APP_CHANNEL_VALUE: "app"]
}
google {
dimension "mode"
applicationId "io.legado.play"
manifestPlaceholders = [APP_CHANNEL_VALUE: "google"]
}
}
6 years ago
compileOptions {
// Flag to enable support for the new language APIs
5 years ago
coreLibraryDesugaringEnabled true
3 years ago
// Sets Java compatibility to Java 11
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
6 years ago
}
3 years ago
sourceSets {
// Adds exported schema location as test app assets.
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
5 years ago
}
tasks.withType(JavaCompile) {
//options.compilerArgs << "-Xlint:unchecked"
}
6 years ago
}
5 years ago
resourcePlaceholders {
files = ['xml/shortcuts.xml']
}
6 years ago
kapt {
arguments {
arg("room.schemaLocation", "$projectDir/schemas")
}
6 years ago
}
dependencies {
coreLibraryDesugaring('com.android.tools:desugar_jdk_libs:1.1.5')
testImplementation('junit:junit:4.13.2')
androidTestImplementation('androidx.test:runner:1.4.0')
androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0')
implementation('androidx.multidex:multidex:2.0.1')
6 years ago
//kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
3 years ago
//Kotlin反射
3 years ago
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
3 years ago
//协程
3 years ago
def coroutines_version = '1.6.0'
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version")
6 years ago
6 years ago
//androidX
3 years ago
implementation('androidx.core:core-ktx:1.7.0')
3 years ago
implementation('androidx.appcompat:appcompat:1.4.0')
3 years ago
implementation('androidx.activity:activity-ktx:1.4.0')
3 years ago
implementation('androidx.fragment:fragment-ktx:1.4.0')
implementation('androidx.preference:preference-ktx:1.1.1')
3 years ago
implementation('androidx.constraintlayout:constraintlayout:2.1.2')
implementation('androidx.swiperefreshlayout:swiperefreshlayout:1.1.0')
implementation('androidx.viewpager2:viewpager2:1.0.0')
implementation('com.google.android.material:material:1.4.0')
implementation('com.google.android.flexbox:flexbox:3.0.0')
3 years ago
implementation('com.google.code.gson:gson:2.8.9')
implementation('androidx.webkit:webkit:1.4.0')
6 years ago
3 years ago
implementation('com.jakewharton.timber:timber:5.0.1')
4 years ago
//media
3 years ago
implementation("androidx.media:media:1.4.3")
def exoplayer_version = '2.16.1'
3 years ago
implementation("com.google.android.exoplayer:exoplayer-core:$exoplayer_version")
implementation("com.google.android.exoplayer:extension-okhttp:$exoplayer_version")
4 years ago
4 years ago
//Splitties
3 years ago
def splitties_version = '3.0.0'
4 years ago
implementation("com.louiscad.splitties:splitties-appctx:$splitties_version")
implementation("com.louiscad.splitties:splitties-systemservices:$splitties_version")
implementation("com.louiscad.splitties:splitties-views:$splitties_version")
6 years ago
//lifecycle
3 years ago
def lifecycle_version = '2.4.0'
implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycle_version")
6 years ago
6 years ago
//room
3 years ago
def room_version = '2.4.0'
implementation("androidx.room:room-runtime:$room_version")
3 years ago
implementation("androidx.room:room-ktx:$room_version")
kapt("androidx.room:room-compiler:$room_version")
testImplementation("androidx.room:room-testing:$room_version")
6 years ago
//liveEventBus
implementation('io.github.jeremyliao:live-event-bus-x:1.8.0')
6 years ago
//规则相关
3 years ago
implementation('org.jsoup:jsoup:1.14.3')
implementation('com.jayway.jsonpath:json-path:2.6.0')
3 years ago
implementation('cn.wanghaomiao:JsoupXpath:2.5.1')
implementation(project(path: ':epublib'))
//JS rhino
implementation('com.github.gedoor:rhino-android:1.6')
6 years ago
//网络
implementation('com.squareup.okhttp3:okhttp:4.9.3')
3 years ago
implementation(fileTree(dir: 'cronetlib', include: ['*.jar', '*.aar']))
6 years ago
//Glide
implementation('com.github.bumptech.glide:glide:4.12.0')
3 years ago
kapt('com.github.bumptech.glide:compiler:4.12.0')
6 years ago
5 years ago
//webServer
3 years ago
def nanoHttpdVersion = "2.3.1"
implementation("org.nanohttpd:nanohttpd:$nanoHttpdVersion")
implementation("org.nanohttpd:nanohttpd-websocket:$nanoHttpdVersion")
5 years ago
6 years ago
//二维码
3 years ago
implementation('com.github.jenly1314:zxing-lite:2.1.1')
6 years ago
6 years ago
//颜色选择
implementation('com.jaredrummler:colorpicker:1.1.0')
5 years ago
5 years ago
//apache
implementation('org.apache.commons:commons-text:1.9')
5 years ago
//MarkDown
3 years ago
def markwonVersion = "4.6.2"
implementation("io.noties.markwon:core:$markwonVersion")
implementation("io.noties.markwon:image-glide:$markwonVersion")
implementation("io.noties.markwon:ext-tables:$markwonVersion")
implementation("io.noties.markwon:html:$markwonVersion")
//转换繁体
3 years ago
implementation('com.github.liuyueyi.quick-chinese-transfer:quick-transfer-core:0.2.3')
3 years ago
//代码编辑com.github.AmrDeveloper:CodeView已集成到应用内
//epubLib集成到应用内
3 years ago
// LeakCanary
3 years ago
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
3 years ago
}