From 5d6c99581fe9da42d0e0e3fceb14cf310e855abf Mon Sep 17 00:00:00 2001 From: laoyuyu <511455842@qq.com> Date: Mon, 20 Feb 2023 21:47:11 +0800 Subject: [PATCH] dependency management --- AppFrame/build.gradle | 22 -------------------- Aria/build.gradle | 22 -------------------- AriaAnnotations/build.gradle | 9 -------- AriaCompiler/build.gradle | 8 -------- FtpComponent/build.gradle | 31 +--------------------------- Http/build.gradle | 31 +--------------------------- M3U8Component/build.gradle | 31 +--------------------------- PublicComponent/build.gradle | 30 --------------------------- Queue/build.gradle | 30 --------------------------- SFtpComponent/build.gradle | 31 +--------------------------- Schedulers/build.gradle | 30 --------------------------- androidComponent.gradle | 27 ++++++++++++++++++++++++ javaComponent.gradle | 26 +++++++++++++++++++++++ settings.gradle | 40 ++++++++++++++++++++++++++++-------- 14 files changed, 89 insertions(+), 279 deletions(-) create mode 100644 androidComponent.gradle create mode 100644 javaComponent.gradle diff --git a/AppFrame/build.gradle b/AppFrame/build.gradle index 8d36a58c..6b3709ad 100644 --- a/AppFrame/build.gradle +++ b/AppFrame/build.gradle @@ -1,30 +1,8 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' android { - compileSdkVersion libs.versions.compilesdk.get().toInteger() - buildToolsVersion libs.versions.buildToolsVersion.get() - - defaultConfig { - minSdkVersion libs.versions.minSdk.get().toInteger() - targetSdkVersion libs.versions.targetsdk.get().toInteger() - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } dataBinding { enabled = true } - lintOptions { - abortOnError false - } - } dependencies { diff --git a/Aria/build.gradle b/Aria/build.gradle index 2f668f67..bb80b6d6 100644 --- a/Aria/build.gradle +++ b/Aria/build.gradle @@ -1,26 +1,4 @@ -plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' -} - -android { - compileSdkVersion libs.versions.compilesdk.get().toInteger() - buildToolsVersion libs.versions.buildToolsVersion.get() - defaultConfig { - minSdkVersion libs.versions.minSdk.get().toInteger() - targetSdkVersion libs.versions.targetsdk.get().toInteger() - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - } -} dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') testImplementation(libs.bundles.android.test) diff --git a/AriaAnnotations/build.gradle b/AriaAnnotations/build.gradle index c65cb88b..59a74436 100644 --- a/AriaAnnotations/build.gradle +++ b/AriaAnnotations/build.gradle @@ -1,12 +1,3 @@ -apply plugin: 'java' - -tasks.withType(JavaCompile) { - options.encoding = "UTF-8" -} - -sourceCompatibility = JavaVersion.VERSION_1_7 -targetCompatibility = JavaVersion.VERSION_1_7 - dependencies { // compile fileTree(dir: 'libs', include: ['*.jar']) } diff --git a/AriaCompiler/build.gradle b/AriaCompiler/build.gradle index 3a3383d9..91ed05c9 100644 --- a/AriaCompiler/build.gradle +++ b/AriaCompiler/build.gradle @@ -1,11 +1,3 @@ -apply plugin: 'java' - -tasks.withType(JavaCompile) { - options.encoding = "UTF-8" -} -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 - dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.google.auto:auto-common:1.2' diff --git a/FtpComponent/build.gradle b/FtpComponent/build.gradle index ff723888..8db5d4f3 100644 --- a/FtpComponent/build.gradle +++ b/FtpComponent/build.gradle @@ -1,32 +1,3 @@ -plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' -} - -android { - compileSdkVersion libs.versions.compilesdk.get().toInteger() - buildToolsVersion libs.versions.buildToolsVersion.get() - - defaultConfig { - minSdkVersion libs.versions.minSdk.get().toInteger() - targetSdkVersion libs.versions.targetsdk.get().toInteger() - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - } - -} - dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -34,7 +5,7 @@ dependencies { } //apply from: 'bintray-release.gradle' -ext{ +ext { PUBLISH_ARTIFACT_ID = 'ftp' } apply from: '../gradle/mavenCentral-release.gradle' \ No newline at end of file diff --git a/Http/build.gradle b/Http/build.gradle index e72eb4ae..5498c42d 100644 --- a/Http/build.gradle +++ b/Http/build.gradle @@ -1,32 +1,3 @@ -plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' - id 'kotlin-kapt' -} - -android { - compileSdkVersion libs.versions.compilesdk.get().toInteger() - buildToolsVersion libs.versions.buildToolsVersion.get() - - defaultConfig { - minSdkVersion libs.versions.minSdk.get().toInteger() - targetSdkVersion libs.versions.targetsdk.get().toInteger() - - consumerProguardFiles 'consumer-rules.pro' - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - } - -} - dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -37,7 +8,7 @@ dependencies { } //apply from: 'bintray-release.gradle' -ext{ +ext { PUBLISH_ARTIFACT_ID = 'http' } apply from: '../gradle/mavenCentral-release.gradle' \ No newline at end of file diff --git a/M3U8Component/build.gradle b/M3U8Component/build.gradle index a3cd5f40..c79ff081 100644 --- a/M3U8Component/build.gradle +++ b/M3U8Component/build.gradle @@ -1,32 +1,3 @@ -plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' -} - -android { - compileSdkVersion libs.versions.compilesdk.get().toInteger() - buildToolsVersion libs.versions.buildToolsVersion.get() - - defaultConfig { - minSdkVersion libs.versions.minSdk.get().toInteger() - targetSdkVersion libs.versions.targetsdk.get().toInteger() - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - } - -} - dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -35,7 +6,7 @@ dependencies { } //apply from: 'bintray-release.gradle' -ext{ +ext { PUBLISH_ARTIFACT_ID = 'm3u8' } apply from: '../gradle/mavenCentral-release.gradle' \ No newline at end of file diff --git a/PublicComponent/build.gradle b/PublicComponent/build.gradle index b1d38c3b..18b4b40b 100644 --- a/PublicComponent/build.gradle +++ b/PublicComponent/build.gradle @@ -1,33 +1,3 @@ -plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' - id 'kotlin-kapt' -} - -android { - compileSdkVersion libs.versions.compilesdk.get().toInteger() - buildToolsVersion libs.versions.buildToolsVersion.get() - - defaultConfig { - minSdkVersion libs.versions.minSdk.get().toInteger() - targetSdkVersion libs.versions.targetsdk.get().toInteger() - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - lintOptions { - abortOnError false - } -} - dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) api project(path: ':AriaAnnotations') diff --git a/Queue/build.gradle b/Queue/build.gradle index 485d96a1..10f23559 100644 --- a/Queue/build.gradle +++ b/Queue/build.gradle @@ -1,33 +1,3 @@ -plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' -} - -android { - - compileSdkVersion libs.versions.compilesdk.get().toInteger() - buildToolsVersion libs.versions.buildToolsVersion.get() - - namespace 'com.arialyy.aria.queue' - - defaultConfig { - minSdkVersion libs.versions.minSdk.get().toInteger() - targetSdkVersion libs.versions.targetsdk.get().toInteger() - - consumerProguardFiles 'consumer-rules.pro' - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - } -} - dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) diff --git a/SFtpComponent/build.gradle b/SFtpComponent/build.gradle index e64691bb..d43c8986 100644 --- a/SFtpComponent/build.gradle +++ b/SFtpComponent/build.gradle @@ -1,32 +1,3 @@ -plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' -} - -android { - compileSdkVersion libs.versions.compilesdk.get().toInteger() - buildToolsVersion libs.versions.buildToolsVersion.get() - - defaultConfig { - minSdkVersion libs.versions.minSdk.get().toInteger() - targetSdkVersion libs.versions.targetsdk.get().toInteger() - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - } - -} - dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -36,7 +7,7 @@ dependencies { } //apply from: 'bintray-release.gradle' -ext{ +ext { PUBLISH_ARTIFACT_ID = 'sftp' } apply from: '../gradle/mavenCentral-release.gradle' \ No newline at end of file diff --git a/Schedulers/build.gradle b/Schedulers/build.gradle index 2e9ebd02..1f5188ae 100644 --- a/Schedulers/build.gradle +++ b/Schedulers/build.gradle @@ -1,33 +1,3 @@ -plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' -} - -android { - - compileSdkVersion libs.versions.compilesdk.get().toInteger() - buildToolsVersion libs.versions.buildToolsVersion.get() - - namespace 'com.arialyy.aria.schedulers' - - defaultConfig { - minSdkVersion libs.versions.minSdk.get().toInteger() - targetSdkVersion libs.versions.targetsdk.get().toInteger() - - consumerProguardFiles 'consumer-rules.pro' - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - } -} - dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) diff --git a/androidComponent.gradle b/androidComponent.gradle new file mode 100644 index 00000000..1bbc2373 --- /dev/null +++ b/androidComponent.gradle @@ -0,0 +1,27 @@ +apply { + plugin "com.android.library" + plugin "org.jetbrains.kotlin.android" + plugin "kotlin-kapt" +} + +android { + compileSdkVersion libs.versions.compilesdk.get().toInteger() + buildToolsVersion libs.versions.buildToolsVersion.get() + + defaultConfig { + minSdkVersion libs.versions.minSdk.get().toInteger() + targetSdkVersion libs.versions.targetsdk.get().toInteger() + + consumerProguardFiles 'consumer-rules.pro' + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + lintOptions { + abortOnError false + } +} \ No newline at end of file diff --git a/javaComponent.gradle b/javaComponent.gradle new file mode 100644 index 00000000..639442cf --- /dev/null +++ b/javaComponent.gradle @@ -0,0 +1,26 @@ +apply { + plugin "com.android.library" + plugin "org.jetbrains.kotlin.android" +} + +android { + compileSdkVersion libs.versions.compilesdk.get().toInteger() + buildToolsVersion libs.versions.buildToolsVersion.get() + + defaultConfig { + minSdkVersion libs.versions.minSdk.get().toInteger() + targetSdkVersion libs.versions.targetsdk.get().toInteger() + + consumerProguardFiles 'consumer-rules.pro' + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + lintOptions { + abortOnError false + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index e95f7ad5..3307b1fa 100644 --- a/settings.gradle +++ b/settings.gradle @@ -25,17 +25,41 @@ dependencyResolutionManagement { versionCatalogs { libs { - // from("com.lyy.kpa.version:catalog:0.0.1") from(files('libs.versions.toml')) - // 我们也可以重写覆盖catalog中的groovy版本 - // version("groovy", "3.0.6") } } +} +gradle.rootProject { + it.subprojects { sub -> + beforeEvaluate { + print(sub.name) + switch (sub.name) { + case "app": + break + case "AriaAnnotations": + case "AriaCompiler": + sub.apply { + from "${project.rootDir.path}/javaComponent.gradle" + } + break + default: + sub.apply { + from "${project.rootDir.path}/androidComponent.gradle" + } + sub.android.namespace = "com.lyy.dua.${sub.name}" + break + } + } + } } -include ':app', ':Aria', ':AriaAnnotations', ':AriaCompiler', ':AppFrame', ':Http', ':M3U8Component', ':SFtpComponent', - ':FtpComponent', ':PublicComponent' -rootProject.name='Aria' -include ':Queue' -include ':Schedulers' +def componentList = [':app', ':Aria', ':AriaAnnotations', ':AriaCompiler', + ':AppFrame', ':Http', ':M3U8Component', ':SFtpComponent', ':FtpComponent', ':PublicComponent', + ':Queue', ':Schedulers' +] + +componentList.forEach { + include(it) +} +rootProject.name = 'Aria'