248 lines
8.3 KiB
Groovy
248 lines
8.3 KiB
Groovy
plugins {
|
|
id 'org.jetbrains.kotlin.plugin.serialization' version '2.2.10'
|
|
}
|
|
|
|
if (imitate_isApp.toBoolean()) {
|
|
apply plugin: 'com.android.application'
|
|
} else {
|
|
apply plugin: 'com.android.library'
|
|
}
|
|
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
|
|
apply plugin: 'kotlin-kapt'
|
|
|
|
class RoomSchemaArgProvider implements CommandLineArgumentProvider {
|
|
|
|
@InputDirectory
|
|
@PathSensitive(PathSensitivity.RELATIVE)
|
|
File schemaDir
|
|
|
|
RoomSchemaArgProvider(File schemaDir) {
|
|
this.schemaDir = schemaDir
|
|
}
|
|
|
|
@Override
|
|
Iterable<String> asArguments() {
|
|
// Note: If you're using KSP, change the line below to return
|
|
// ["room.schemaLocation=${schemaDir.path}".toString()].
|
|
return ["-Aroom.schemaLocation=${schemaDir.path}".toString()]
|
|
}
|
|
}
|
|
|
|
static def releaseTime() {
|
|
return new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("GMT+8"))
|
|
}
|
|
|
|
def ext = rootProject.ext
|
|
|
|
android {
|
|
compileSdk ext.compileSdk
|
|
//
|
|
defaultConfig {
|
|
minSdk ext.minSdk
|
|
targetSdk ext.targetSdk
|
|
versionCode 1
|
|
versionName "1.0"
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
kapt {
|
|
arguments {
|
|
arg("moduleName", project.getName())
|
|
}
|
|
}
|
|
javaCompileOptions {
|
|
annotationProcessorOptions {
|
|
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
|
compilerArgumentProviders(new RoomSchemaArgProvider(new File(projectDir, "schemas")))
|
|
}
|
|
}
|
|
//只保留中文资源和 xxhdpi 分辨率图片
|
|
resourceConfigurations += ['zh-rCN', 'xxhdpi']
|
|
|
|
ndk {
|
|
//目前已支持 "armeabi-v7a","arm64-v8a","x86","x86_64" 平台架构
|
|
abiFilters "arm64-v8a"
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
signingConfig signingConfigs.debug
|
|
}
|
|
}
|
|
|
|
android.applicationVariants.all { variant ->
|
|
variant.outputs.all {
|
|
// outputFileName = "app_" + variant.name + "_" + versionName +
|
|
// "_" + versionCode + "_" + releaseTime() + ".apk"
|
|
// outputFileName = releaseTime() + ".apk"
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_21
|
|
targetCompatibility JavaVersion.VERSION_21
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = '21'
|
|
}
|
|
buildFeatures {
|
|
viewBinding true
|
|
compose true
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
if (imitate_isApp.toBoolean()) {
|
|
manifest.srcFile 'src/main/module/AndroidManifest.xml'
|
|
} else {
|
|
manifest.srcFile 'src/main/AndroidManifest.xml'
|
|
}
|
|
|
|
res.srcDirs += ['src/main/res/layouts/ninepoint']
|
|
}
|
|
}
|
|
packagingOptions {
|
|
resources {
|
|
pickFirsts += ['META-INF/library_release.kotlin_module']
|
|
}
|
|
}
|
|
|
|
|
|
testOptions {
|
|
unitTests {
|
|
includeAndroidResources = true
|
|
}
|
|
}
|
|
|
|
signingConfigs {
|
|
debug {
|
|
keyAlias IMITATE_DEBUG_KEY_ALIAS
|
|
keyPassword IMITATE_DEBUG_KEY_PASSWORD
|
|
storeFile file(IMITATE_DEBUG_STORE_FILE)
|
|
storePassword IMITATE_DEBUG_STORE_PASSWORD
|
|
}
|
|
}
|
|
namespace 'com.engineer.imitate'
|
|
}
|
|
|
|
kapt {
|
|
arguments {
|
|
arg("moduleName", project.getName())
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
implementation "androidx.appcompat:appcompat:$ext.androidx_appcompat"
|
|
implementation "androidx.cardview:cardview:1.0.0"
|
|
implementation "androidx.constraintlayout:constraintlayout:${ext.constraint_layout}"
|
|
implementation "com.github.bumptech.glide:glide:$ext.glide"
|
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
|
implementation libs.androidx.lifecycle.process
|
|
implementation libs.androidx.lifecycle.viewmodel.ktx
|
|
|
|
|
|
testImplementation 'junit:junit:4.13.2'
|
|
androidTestImplementation 'androidx.test:runner:1.6.2'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
|
|
|
|
|
implementation "com.alibaba:arouter-api:$ext.arouter_api"
|
|
kapt "com.alibaba:arouter-compiler:$ext.arouter_compiler"
|
|
implementation('com.facebook.fresco:fresco:3.6.0') {
|
|
exclude group: 'com.facebook.soloader', module: 'soloader'
|
|
exclude group: 'com.facebook.fresco', module: 'soloader'
|
|
exclude group: 'com.facebook.fresco', module: 'nativeimagefilters'
|
|
exclude group: 'com.facebook.fresco', module: 'nativeimagetranscoder'
|
|
exclude group: 'com.facebook.fresco', module: 'memory-type-native'
|
|
exclude group: 'com.facebook.fresco', module: 'imagepipeline-native'
|
|
}
|
|
implementation 'com.facebook.fresco:animated-webp:3.6.0'
|
|
implementation 'com.facebook.fresco:webpsupport:3.6.0'
|
|
implementation 'com.github.REBOOTERS:Matisse:v0.6.0'
|
|
// implementation fileTree(include: ['matisse-release.aar'], dir: 'libs')
|
|
implementation 'com.guolindev.permissionx:permissionx:1.8.1'
|
|
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
|
|
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
|
implementation 'com.facebook.stetho:stetho:1.6.0'
|
|
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'
|
|
implementation 'net.sourceforge.streamsupport:streamsupport:1.7.4'
|
|
//
|
|
implementation 'com.github.andrefrsousa:SuperBottomSheet:1.3.0'
|
|
|
|
implementation 'de.hdodenhof:circleimageview:3.1.0'
|
|
implementation 'androidx.viewpager:viewpager:1.1.0'
|
|
|
|
implementation 'com.afollestad:assent:2.3.1'
|
|
|
|
|
|
implementation 'androidx.viewpager2:viewpager2:1.1.0'
|
|
|
|
// https://github.com/prostory/AndroidZdog
|
|
implementation 'com.github.prostory:AndroidZdog:v1.0.0'
|
|
|
|
// robolectric
|
|
testImplementation 'androidx.test:core:1.6.1'
|
|
testImplementation 'androidx.test:rules:1.6.1'
|
|
testImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
|
// testImplementation 'org.robolectric:robolectric:4.6.1'
|
|
testImplementation 'com.facebook.soloader:soloader:0.12.1'
|
|
// robolectric
|
|
|
|
implementation group: 'commons-io', name: 'commons-io', version: '20030203.000550'
|
|
implementation project(path: ':subs:game')
|
|
implementation project(path: ':subs:gif-revert')
|
|
implementation project(path: ':subs:ai')
|
|
implementation project(path: ':subs:cpp_native')
|
|
implementation project(path: ':subs:compose')
|
|
|
|
implementation 'com.jaredrummler:simple-mvp:1.0.2'
|
|
|
|
implementation 'com.github.Dovar66:DToast:1.1.5'
|
|
// implementation 'com.romandanylyk:pageindicatorview:1.0.3'
|
|
implementation 'com.github.romandanylyk:PageIndicatorView:v.1.0.3'
|
|
|
|
// from 2020
|
|
implementation "com.google.android.material:material:$ext.androidx_material"
|
|
implementation "androidx.preference:preference-ktx:${ext.androidx_preference}"
|
|
|
|
|
|
//room
|
|
implementation "androidx.room:room-runtime:$ext.roomVersion_runtime"
|
|
implementation libs.androidx.room.rxjava2
|
|
// kapt 'org.xerial:sqlite-jdbc:3.36.0.3' // for mac m1
|
|
kapt "androidx.room:room-compiler:$ext.roomVersion"
|
|
|
|
implementation 'com.github.wanglu1209:PhotoViewer:0.50'
|
|
|
|
// https://github.com/gyf-dev/ImmersionBar
|
|
// 基础依赖包,必须要依赖
|
|
implementation 'com.geyifeng.immersionbar:immersionbar:3.2.2'
|
|
|
|
// from 2022
|
|
// implementation 'com.alibaba:fastjson:2.0.57'
|
|
implementation 'com.alibaba:fastjson:1.1.71.android'
|
|
implementation 'com.google.code.gson:gson:2.13.1'
|
|
implementation libs.dagger
|
|
kapt libs.dagger.compiler
|
|
|
|
implementation("com.squareup.moshi:moshi:1.15.2") // 核心库
|
|
implementation("com.squareup.moshi:moshi-kotlin:1.15.2") // Kotlin 扩展(支持数据类)
|
|
kapt("com.squareup.moshi:moshi-kotlin-codegen:1.15.2") // 代码生成(替代反射)
|
|
|
|
// coroutines
|
|
// 👇 依赖协程核心库
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines"
|
|
// 👇 依赖当前平台所对应的平台库
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_android"
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0")
|
|
|
|
}
|
|
apply from: file("../gradle/report_apk_size_after_package.gradle")
|