Skip to content

Commit

Permalink
优化版本管理
Browse files Browse the repository at this point in the history
  • Loading branch information
keepactive committed Nov 8, 2024
1 parent b71a663 commit c1d5705
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 90 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ dependencies {

implementation fileTree(dir: "libs", include: ["*.jar"])
implementation libs.kotlin.stdlib
implementation libs.appcompat
implementation libs.constraintlayout
implementation libs.android.core.ktx
implementation libs.fragment.ktx
implementation libs.androidx.appcompat
implementation libs.androidx.constraintlayout
implementation libs.androidx.core.ktx
implementation libs.androidx.fragment.ktx
implementation libs.kotlinx.coroutines.rx

// 组件化的库
Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ buildscript {
}

plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.kotlin.ksp) apply false
alias(libs.plugins.compose.compiler) apply false
}
Expand Down
10 changes: 5 additions & 5 deletions common_lib.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
android {
compileSdkVersion libs.versions.compileSdkVersion.get().toInteger()
compileSdkVersion libs.versions.compileSdk.get().toInteger()

defaultConfig {
minSdkVersion libs.versions.minSdkVersion.get().toInteger()
targetSdkVersion libs.versions.targetSdkVersion.get().toInteger()
minSdkVersion libs.versions.minSdk.get().toInteger()
targetSdkVersion libs.versions.targetSdk.get().toInteger()
}

compileOptions {
Expand Down Expand Up @@ -34,8 +34,8 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
api libs.kotlin.stdlib
api libs.kotlin.android
api libs.android.core.ktx
api libs.appcompat
api libs.androidx.core.ktx
api libs.androidx.appcompat
}

task androidSourcesJar(type: Jar) {
Expand Down
109 changes: 59 additions & 50 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,71 +1,80 @@
[versions]
compileSdkVersion = "35"
gradleVersion = "8.7.2"
minSdkVersion = "21"
targetSdkVersion = "35"
gradle = "8.7.2"
compileSdk = "35"
minSdk = "21"
targetSdk = "35"
component = "8c968cf766"
compose = "1.7.5"
compose_kotlin_compiler_extension = "1.5.15"
compose_material_version = "1.7.5"
compose_material3_version = "1.3.1"
accompanist_version = "0.36.0"
compose-kotlin-compiler-extension = "1.5.15"
compose-material-version = "1.7.5"
compose-material3-version = "1.3.1"
accompanist-version = "0.36.0"
# kotlin = "1.9.25"
kotlin = "2.0.21"
# kotlin_ksp = "1.9.25-1.0.20"
kotlin_ksp = "2.0.21-1.0.26"
kotlin_coroutines = "1.9.0"
# kotlin-ksp = "1.9.25-1.0.20"
kotlin-ksp = "2.0.21-1.0.26"
kotlin-coroutines = "1.9.0"

[libraries]
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradleVersion" }
kotlin_stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
kotlin_android = { group = "org.jetbrains.kotlin", name = "kotlin-android-extensions-runtime", version.ref = "kotlin" }
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version = "2.2.0" }
appcompat = { group = "androidx.appcompat", name = "appcompat", version = "1.7.0" }
android_core_ktx = { group = "androidx.core", name = "core-ktx", version = "1.15.0" }
activity = { group = "androidx.activity", name = "activity", version = "1.9.3" }
acrivity_ktx = { group = "androidx.activity", name = "activity-ktx", version = "1.9.3" }
fragment_ktx = { group = "androidx.fragment", name = "fragment-ktx", version = "1.8.5" }
recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version = "1.3.2" }
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
kotlin-android = { group = "org.jetbrains.kotlin", name = "kotlin-android-extensions-runtime", version.ref = "kotlin" }

androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version = "2.2.0" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version = "1.7.0" }
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version = "1.15.0" }
androidx-activity = { group = "androidx.activity", name = "activity", version = "1.9.3" }
androidx-acrivity-ktx = { group = "androidx.activity", name = "activity-ktx", version = "1.9.3" }
androidx-fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version = "1.8.5" }
androidx-recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version = "1.3.2" }
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version = "2.8.7" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version = "2.8.7" }

rxandroid = { group = "io.reactivex.rxjava2", name = "rxandroid", version = "2.1.1" }
rxjava = { group = "io.reactivex.rxjava2", name = "rxjava", version = "2.2.21" }
rxkotlin = { group = "io.reactivex.rxjava2", name = "rxkotlin", version = "2.4.0" }
lifecycle_viewmodel_ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version = "2.8.7" }
lifecycle_runtime_ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version = "2.8.7" }
android_networking = { group = "com.amitshekhar.android", name = "android-networking", version = "1.0.2" }

android-networking = { group = "com.amitshekhar.android", name = "android-networking", version = "1.0.2" }
gson = { group = "com.google.code.gson", name = "gson", version = "2.11.0" }
retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version = "2.11.0" }
kotlinx_coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core-jvm", version.ref = "kotlin_coroutines" }
kotlinx_coroutines_rx = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-rx2", version.ref = "kotlin_coroutines" }
kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core-jvm", version.ref = "kotlin-coroutines" }
kotlinx-coroutines-rx = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-rx2", version.ref = "kotlin-coroutines" }

# Compose dependencies
compose_bom = { group = "androidx.compose", name = "compose-bom", version = "2024.10.01" }
compose_ui = { group = "androidx.compose.ui", name = "ui", version.ref = "compose" }
compose_ui_tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "compose" }
compose_ui_tooling_preview = { group = "androidx.compose.ui", name = "ui-tooling-preview", version.ref = "compose" }
compose_viewmodel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version = "2.8.7" }
activity_compose = { group = "androidx.activity", name = "activity-compose", version = "1.9.3" }
compose_material = { group = "androidx.compose.material", name = "material", version.ref = "compose_material_version" }
compose_material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "compose_material3_version" }
compose_constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout-compose", version = "1.1.0" }
compose_ui_foundation = { group = "androidx.ui", name = "ui-foundation", version = "0.1.0-dev14" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version = "2024.10.01" }
compose-ui = { group = "androidx.compose.ui", name = "ui", version.ref = "compose" }
compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "compose" }
compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview", version.ref = "compose" }
compose-viewmodel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version = "2.8.7" }
activity-compose = { group = "androidx.activity", name = "activity-compose", version = "1.9.3" }
compose-material = { group = "androidx.compose.material", name = "material", version.ref = "compose-material-version" }
compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "compose-material3-version" }
compose-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout-compose", version = "1.1.0" }
compose-ui-foundation = { group = "androidx.ui", name = "ui-foundation", version = "0.1.0-dev14" }

# Compose support libraries
accompanist_pager = { group = "com.google.accompanist", name = "accompanist-pager", version.ref = "accompanist_version" }
accompanist_swiperefresh = { group = "com.google.accompanist", name = "accompanist-swiperefresh", version.ref = "accompanist_version" }
accompanist_insets = { group = "com.google.accompanist", name = "accompanist-insets", version.ref = "accompanist_version" }
accompanist_sysuicontrol = { group = "com.google.accompanist", name = "accompanist-systemuicontroller", version.ref = "accompanist_version" }
accompanist_flowlayout = { group = "com.google.accompanist", name = "accompanist-flowlayout", version.ref = "accompanist_version" }
accompanist_placeholder = { group = "com.google.accompanist", name = "accompanist-placeholder", version.ref = "accompanist_version" }
accompanist_permissions = { group = "com.google.accompanist", name = "accompanist-permissions", version.ref = "accompanist_version" }
accompanist_webview = { group = "com.google.accompanist", name = "accompanist-webview", version.ref = "accompanist_version" }
accompanist-pager = { group = "com.google.accompanist", name = "accompanist-pager", version.ref = "accompanist-version" }
accompanist-swiperefresh = { group = "com.google.accompanist", name = "accompanist-swiperefresh", version.ref = "accompanist-version" }
accompanist-insets = { group = "com.google.accompanist", name = "accompanist-insets", version.ref = "accompanist-version" }
accompanist-sysuicontrol = { group = "com.google.accompanist", name = "accompanist-systemuicontroller", version.ref = "accompanist-version" }
accompanist-flowlayout = { group = "com.google.accompanist", name = "accompanist-flowlayout", version.ref = "accompanist-version" }
accompanist-placeholder = { group = "com.google.accompanist", name = "accompanist-placeholder", version.ref = "accompanist-version" }
accompanist-permissions = { group = "com.google.accompanist", name = "accompanist-permissions", version.ref = "accompanist-version" }
accompanist-webview = { group = "com.google.accompanist", name = "accompanist-webview", version.ref = "accompanist-version" }

# Component dependencies
component_annotation = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent-annotation", version.ref = "component" }
component_compiler = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent-compiler", version.ref = "component" }
component_impl = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent", version.ref = "component" }
component_impl_rx = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent-rx", version.ref = "component" }
component_plugin = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent-plugin", version.ref = "component" }
component-annotation = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent-annotation", version.ref = "component" }
component-compiler = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent-compiler", version.ref = "component" }
component-impl = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent", version.ref = "component" }
component-impl-rx = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent-rx", version.ref = "component" }
component-plugin = { group = "com.github.xiaojinzi123.KComponent", name = "kcomponent-plugin", version.ref = "component" }

[plugins]
kotlin-ksp = {id = "com.google.devtools.ksp", version.ref = "kotlin_ksp"}
# com.android.library
android-application = {id = "com.android.application", version.ref = "gradle" }
android-library = {id = "com.android.library", version.ref = "gradle" }
kotlin-android = {id = "org.jetbrains.kotlin.android", version.ref = "kotlin"}
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
kotlin-kapt = {id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin"}
kotlin-ksp = {id = "com.google.devtools.ksp", version.ref = "kotlin-ksp"}
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
9 changes: 6 additions & 3 deletions lib-activity-stack/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
id "maven-publish"
}

apply from: "../common_lib.gradle"

Expand Down
9 changes: 6 additions & 3 deletions lib-annotation/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
id "maven-publish"
}

apply from: "../common_lib.gradle"

Expand Down
11 changes: 7 additions & 4 deletions lib-architecture/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
id "maven-publish"
}

apply from: "../common_lib.gradle"

Expand All @@ -15,7 +18,7 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
api project(':lib-annotation')
api project(':lib-ktx')
api libs.activity
api libs.androidx.activity
api libs.rxjava
api libs.rxkotlin
}
Expand Down
9 changes: 6 additions & 3 deletions lib-download/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
id "maven-publish"
}

apply from: "../common_lib.gradle"

Expand Down
9 changes: 6 additions & 3 deletions lib-init/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
id "maven-publish"
}

apply from: "../common_lib.gradle"

Expand Down
9 changes: 6 additions & 3 deletions lib-ktx-retrofit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
id "maven-publish"
}

apply from: "../common_lib.gradle"

Expand Down
21 changes: 12 additions & 9 deletions lib-ktx/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
id "maven-publish"
}

apply from: "../common_lib.gradle"

Expand All @@ -20,16 +23,16 @@ dependencies {
api project(':lib-init')
api project(':lib-annotation')

api libs.appcompat
api libs.androidx.appcompat
api libs.kotlin.stdlib
api libs.kotlinx.coroutines
api libs.rxjava
api libs.rxandroid
api libs.recyclerview
api libs.acrivity.ktx
api libs.lifecycle.viewmodel.ktx
api libs.lifecycle.runtime.ktx
api libs.lifecycle.runtime.ktx
api libs.androidx.recyclerview
api libs.androidx.acrivity.ktx
api libs.androidx.lifecycle.viewmodel.ktx
api libs.androidx.lifecycle.runtime.ktx
api libs.androidx.lifecycle.runtime.ktx
api libs.gson

}
Expand Down
9 changes: 6 additions & 3 deletions lib-logger/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
id "maven-publish"
}

apply from: "../common_lib.gradle"

Expand Down
8 changes: 8 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
pluginManagement {
repositories {
maven { url 'https://jitpack.io' }
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
Expand Down

0 comments on commit c1d5705

Please sign in to comment.