|
|
@@ -1,390 +0,0 @@
|
|
|
-plugins {
|
|
|
-// id "com.android.application"
|
|
|
-// id 'org.jetbrains.kotlin.android'
|
|
|
-// id 'kotlin-parcelize'
|
|
|
-// //id 'kotlin-kapt'
|
|
|
-// id 'com.google.devtools.ksp'
|
|
|
-// id "com.google.gms.google-services"
|
|
|
- alias libs.plugins.compose.compiler
|
|
|
- alias libs.plugins.android.application
|
|
|
- alias libs.plugins.kotlin.android
|
|
|
- alias libs.plugins.kotlin.parcelize
|
|
|
- alias libs.plugins.room
|
|
|
- alias libs.plugins.ksp
|
|
|
- alias libs.plugins.google.services
|
|
|
-}
|
|
|
-apply from: 'download.gradle'
|
|
|
-
|
|
|
-def versionPropsFile = file("version.properties")
|
|
|
-def versionProps = new Properties()
|
|
|
-versionProps.load(new FileInputStream(versionPropsFile))
|
|
|
-
|
|
|
-ext {
|
|
|
- versionMajor = versionProps['VERSION_MAJOR'].toInteger()
|
|
|
- versionMinor = versionProps['VERSION_MINOR'].toInteger()
|
|
|
- versionPatch = versionProps['VERSION_PATCH'].toInteger()
|
|
|
-}
|
|
|
-
|
|
|
-def name = "legado"
|
|
|
-def gitCommits = Integer.parseInt('git rev-list HEAD --count'.execute().text.trim())
|
|
|
-
|
|
|
-ext.versionBuild = gitCommits
|
|
|
-ext.versionName = "${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
|
|
|
-
|
|
|
-def getGitCommitHash() {
|
|
|
- try {
|
|
|
- def stdout = new ByteArrayOutputStream()
|
|
|
- ExecOperations.exec {
|
|
|
- commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
|
|
- standardOutput = stdout
|
|
|
- }
|
|
|
- return stdout.toString().trim()
|
|
|
- } catch (Exception ignored) {
|
|
|
- return "unknown"
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-android {
|
|
|
- compileSdk = compile_sdk_version
|
|
|
- namespace = "io.legado.app"
|
|
|
-
|
|
|
- buildFeatures {
|
|
|
- compose = true
|
|
|
- }
|
|
|
-
|
|
|
- kotlin {
|
|
|
- jvmToolchain {
|
|
|
- languageVersion.set(JavaLanguageVersion.of(21))
|
|
|
- vendor.set(JvmVendorSpec.ADOPTIUM)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- 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
|
|
|
- enableV3Signing = true
|
|
|
- enableV4Signing = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- defaultConfig {
|
|
|
- applicationId "io.legato.kazusa"
|
|
|
- minSdk 26
|
|
|
- targetSdk 36
|
|
|
- versionCode 10000 + gitCommits
|
|
|
- versionName project.ext.versionName
|
|
|
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
- project.ext.set("archivesBaseName", name + "_" + versionName)
|
|
|
-
|
|
|
- buildConfigField "String", "Cronet_Version", "\"$CronetVersion\""
|
|
|
- buildConfigField "String", "Cronet_Main_Version", "\"$CronetMainVersion\""
|
|
|
-
|
|
|
- javaCompileOptions {
|
|
|
- annotationProcessorOptions {
|
|
|
- arguments += [
|
|
|
- "room.incremental" : "true",
|
|
|
- "room.expandProjection": "true",
|
|
|
- "room.schemaLocation" : "$projectDir/schemas".toString()
|
|
|
- ]
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- def buildTime = new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("UTC"))
|
|
|
- buildConfigField "String", "BUILD_TIME", "\"${buildTime}\""
|
|
|
- }
|
|
|
-
|
|
|
- buildFeatures {
|
|
|
- buildConfig = true
|
|
|
- viewBinding = true
|
|
|
- }
|
|
|
-
|
|
|
- buildTypes {
|
|
|
- release {
|
|
|
- if (project.hasProperty("RELEASE_STORE_FILE")) {
|
|
|
- signingConfig signingConfigs.myConfig
|
|
|
- }
|
|
|
- //applicationIdSuffix '.release'
|
|
|
- manifestPlaceholders.put("app_name", "@string/app_name")
|
|
|
-
|
|
|
- minifyEnabled = true
|
|
|
- shrinkResources = true
|
|
|
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'cronet-proguard-rules.pro'
|
|
|
- }
|
|
|
- debug {
|
|
|
- applicationIdSuffix ".debug"
|
|
|
- if (project.hasProperty("RELEASE_STORE_FILE")) {
|
|
|
- signingConfig signingConfigs.myConfig
|
|
|
- }
|
|
|
- manifestPlaceholders.put("app_name", "@string/app_name")
|
|
|
-
|
|
|
- applicationIdSuffix '.debug'
|
|
|
- versionNameSuffix "_debug+${getGitCommitHash()}"
|
|
|
- minifyEnabled false
|
|
|
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'cronet-proguard-rules.pro'
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- splits {
|
|
|
- abi {
|
|
|
- enable = true
|
|
|
- reset()
|
|
|
- //noinspection ChromeOsAbiSupport
|
|
|
- include 'armeabi-v7a', 'arm64-v8a'
|
|
|
- universalApk = true
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //noinspection GrDeprecatedAPIUsage
|
|
|
- flavorDimensions = ['mode']
|
|
|
- productFlavors {
|
|
|
- app {
|
|
|
- dimension "mode"
|
|
|
- manifestPlaceholders.put("APP_CHANNEL_VALUE", "app")
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- android.applicationVariants.configureEach { variant ->
|
|
|
- variant.outputs.configureEach { output ->
|
|
|
- def abi = output.getFilter(com.android.build.OutputFile.ABI)
|
|
|
- def flavor = variant.productFlavors[0].name
|
|
|
- def baseVersionName = variant.versionName
|
|
|
- def apkName = "${name}_${flavor}_${baseVersionName}"
|
|
|
- if (abi != null) {
|
|
|
- apkName += "_${abi}"
|
|
|
- }
|
|
|
- apkName += ".apk"
|
|
|
- output.outputFileName = apkName
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- room {
|
|
|
- schemaDirectory "$projectDir/schemas"
|
|
|
- }
|
|
|
- // 设定Room的KSP参数
|
|
|
- ksp {
|
|
|
- arg("room.incremental", "true")
|
|
|
- arg("room.expandProjection", "true")
|
|
|
- arg("room.generateKotlin", "false")
|
|
|
- //arg("room.schemaLocation", "$projectDir/schemas")
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- compileOptions {
|
|
|
- // Flag to enable support for the new language APIs
|
|
|
- coreLibraryDesugaringEnabled = true
|
|
|
- // Sets Java compatibility
|
|
|
- sourceCompatibility JavaVersion.VERSION_21
|
|
|
- targetCompatibility JavaVersion.VERSION_21
|
|
|
- }
|
|
|
- packaging {
|
|
|
- resources.excludes.add('META-INF/*')
|
|
|
- }
|
|
|
-
|
|
|
- sourceSets {
|
|
|
- // Adds exported schema location as test app assets.
|
|
|
- androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
|
|
|
- }
|
|
|
- lint {
|
|
|
- checkDependencies = true
|
|
|
- }
|
|
|
- tasks.withType(JavaCompile).tap {
|
|
|
- configureEach {
|
|
|
- //options.compilerArgs << "-Xlint:unchecked"
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-dependencies {
|
|
|
- //compileOnly "com.android.tools.build:gradle:$agp_version"
|
|
|
- //noinspection GradleDependency,GradlePackageUpdate
|
|
|
- //coreLibraryDesugaring('com.android.tools:desugar_jdk_libs_nio:2.0.4')
|
|
|
- coreLibraryDesugaring(libs.desugar)
|
|
|
- testImplementation(libs.junit)
|
|
|
- androidTestImplementation(libs.bundles.androidTest)
|
|
|
- //kotlin
|
|
|
- //noinspection GradleDependency,DifferentStdlibGradleVersion
|
|
|
- implementation(libs.kotlin.stdlib)
|
|
|
- //Kotlin反射
|
|
|
- //noinspection GradleDependency,DifferentStdlibGradleVersion
|
|
|
- //implementation(libs.kotlin.reflect)
|
|
|
-
|
|
|
- //协程
|
|
|
- //def coroutines_version = '1.7.3'
|
|
|
- implementation(libs.bundles.coroutines)
|
|
|
-
|
|
|
-
|
|
|
- //androidX
|
|
|
- implementation(libs.core.ktx)
|
|
|
- implementation(libs.appcompat.appcompat)
|
|
|
- implementation(libs.activity.ktx)
|
|
|
- implementation(libs.fragment.ktx)
|
|
|
- implementation(libs.preference.ktx)
|
|
|
- implementation(libs.androidx.constraintlayout)
|
|
|
- implementation(libs.androidx.swiperefreshlayout)
|
|
|
- implementation(libs.androidx.recyclerview)
|
|
|
- implementation(libs.androidx.viewpager2)
|
|
|
- implementation(libs.androidx.webkit)
|
|
|
-
|
|
|
- //google
|
|
|
- implementation(libs.material)
|
|
|
- implementation(libs.flexbox)
|
|
|
- implementation(libs.gson)
|
|
|
-
|
|
|
- //lifecycle
|
|
|
- implementation(libs.lifecycle.common.java8)
|
|
|
- implementation(libs.lifecycle.service)
|
|
|
-
|
|
|
- //media
|
|
|
- implementation(libs.media.media)
|
|
|
- // For media playback using ExoPlayer
|
|
|
- implementation(libs.media3.exoplayer)
|
|
|
- // For loading data using the OkHttp network stack
|
|
|
- implementation(libs.media3.datasource.okhttp)
|
|
|
- // For exposing and controlling media sessions
|
|
|
- //implementation "androidx.media3:media3-session:$media3_version"
|
|
|
-
|
|
|
- //Splitties
|
|
|
- implementation(libs.splitties.appctx)
|
|
|
- implementation(libs.splitties.systemservices)
|
|
|
- implementation(libs.splitties.views)
|
|
|
-
|
|
|
- //room sql语句不高亮解决方法https://issuetracker.google.com/issues/234612964#comment6
|
|
|
- implementation(libs.room.runtime)
|
|
|
- implementation(libs.room.ktx)
|
|
|
- //kapt("androidx.room:room-compiler:$room_version")
|
|
|
- ksp(libs.room.compiler)
|
|
|
- androidTestImplementation(libs.room.testing)
|
|
|
-
|
|
|
- //liveEventBus
|
|
|
- implementation(libs.liveeventbus)
|
|
|
-
|
|
|
- //规则相关
|
|
|
- implementation(libs.jsoup)
|
|
|
- implementation(libs.json.path)
|
|
|
- implementation(libs.jsoupxpath)
|
|
|
- implementation(project(path: ':modules:book'))
|
|
|
- implementation(project(path: ':modules:rhino'))
|
|
|
-
|
|
|
- //JS rhino
|
|
|
-
|
|
|
- //网络
|
|
|
- implementation(libs.okhttp)
|
|
|
- implementation(fileTree(dir: 'cronetlib', include: ['*.jar', '*.aar']))
|
|
|
- implementation(libs.protobuf.javalite)
|
|
|
-
|
|
|
- //Glide
|
|
|
- implementation(libs.glide.glide)
|
|
|
- implementation(libs.glide.okhttp)
|
|
|
- ksp(libs.glide.ksp)
|
|
|
-
|
|
|
- //Svg
|
|
|
- implementation(libs.androidsvg)
|
|
|
- //Glide svg plugin
|
|
|
- implementation(libs.glide.svg)
|
|
|
-
|
|
|
- //webServer
|
|
|
- implementation(libs.nanohttpd.nanohttpd)
|
|
|
- implementation(libs.nanohttpd.websocket)
|
|
|
-
|
|
|
- //二维码
|
|
|
- //noinspection GradleDependency
|
|
|
- implementation(libs.zxing.lite)
|
|
|
-
|
|
|
- //颜色选择
|
|
|
- implementation(libs.colorpicker)
|
|
|
-
|
|
|
- //压缩解压
|
|
|
- implementation libs.libarchive
|
|
|
-
|
|
|
- //apache
|
|
|
- implementation(libs.commons.text)
|
|
|
-
|
|
|
- //MarkDown
|
|
|
- implementation(libs.markwon.core)
|
|
|
- implementation(libs.markwon.image.glide)
|
|
|
- implementation(libs.markwon.ext.tables)
|
|
|
- implementation(libs.markwon.html)
|
|
|
-
|
|
|
- //转换繁体
|
|
|
- implementation(libs.quick.chinese.transfer.core)
|
|
|
-
|
|
|
- //加解密类库,有些书源使用
|
|
|
- //noinspection GradleDependency,GradlePackageUpdate
|
|
|
- implementation(libs.hutool.crypto)
|
|
|
-
|
|
|
- //firebase, 崩溃统计和性能统计
|
|
|
- implementation platform(libs.firebase.bom)
|
|
|
- implementation libs.firebase.analytics
|
|
|
- implementation libs.firebase.perf
|
|
|
-
|
|
|
- implementation libs.glide.recyclerview
|
|
|
-
|
|
|
- //LeakCanary, 内存泄露检测
|
|
|
- //debugImplementation('com.squareup.leakcanary:leakcanary-android:2.7')
|
|
|
-
|
|
|
- //com.github.AmrDeveloper:CodeView代码编辑已集成到应用内
|
|
|
- //epubLib集成到应用内
|
|
|
-
|
|
|
- implementation libs.androidx.datastore.preferences
|
|
|
- implementation libs.androidx.palette
|
|
|
- implementation libs.androidx.core.splashscreen
|
|
|
- implementation libs.androidx.startup.runtime
|
|
|
-
|
|
|
- // Compose 基础
|
|
|
- implementation platform(libs.androidx.compose.bom)
|
|
|
- implementation libs.activity.compose
|
|
|
- implementation libs.androidx.compose.ui
|
|
|
- implementation libs.androidx.compose.ui.tooling.preview
|
|
|
- debugImplementation libs.androidx.compose.ui.tooling
|
|
|
-
|
|
|
- // Material3
|
|
|
- implementation libs.androidx.compose.material3
|
|
|
-
|
|
|
- // Lifecycle
|
|
|
- implementation libs.androidx.lifecycle.runtime.compose
|
|
|
-
|
|
|
- // Activity
|
|
|
- implementation libs.androidx.activity.compose
|
|
|
-
|
|
|
- // Coil
|
|
|
- implementation libs.coil.compose
|
|
|
-
|
|
|
- // accompanist – WebView(打开网页)
|
|
|
- implementation libs.accompanist.webview
|
|
|
-
|
|
|
- // Markdown 渲染(Compose MD)
|
|
|
- // implementation libs.markdown.compose
|
|
|
-
|
|
|
- // 协程
|
|
|
- implementation libs.kotlinx.coroutines.android
|
|
|
- implementation libs.androidx.lifecycle.runtime.compose
|
|
|
- implementation libs.androidx.lifecycle.viewmodel.compose
|
|
|
- implementation libs.androidx.compose.animation
|
|
|
- implementation libs.androidx.compose.foundation
|
|
|
- implementation libs.androidx.constraintlayout.compose
|
|
|
- implementation libs.androidx.compose.ui.viewbinding
|
|
|
- implementation libs.androidx.navigation.compose
|
|
|
- implementation libs.androidx.compose.material
|
|
|
- implementation libs.compose.materialIcons
|
|
|
-
|
|
|
- implementation(platform(libs.koin.bom))
|
|
|
- implementation(libs.koin.core)
|
|
|
- implementation(libs.koin.android)
|
|
|
- implementation(libs.koin.compose)
|
|
|
- implementation(libs.koin.compose.viewmodel)
|
|
|
-
|
|
|
- implementation(libs.reorderable)
|
|
|
- implementation(libs.material.kolor)
|
|
|
- implementation(libs.haze.core)
|
|
|
- implementation(libs.haze.materials)
|
|
|
-
|
|
|
-}
|