From b75049da98d8740e897797a0689c28466b46e31f Mon Sep 17 00:00:00 2001 From: xuweiyu Date: Fri, 7 Jan 2022 10:56:48 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8A=BD=E5=8F=96=E5=B7=A5=E7=A8=8B=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E6=A8=A1=E5=BC=8F=202.minSdkVersion=E9=99=8D=E7=BA=A7?= =?UTF-8?q?=E5=88=B016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGE_LOG.md | 8 +++- app/build.gradle | 35 +---------------- .../github/fast_startup/startup/demo/App.kt | 14 +++---- build-common.gradle | 38 +++++++++++++++++++ build.gradle | 32 ++++++++++------ fast-startup-api/build.gradle | 26 +------------ fast-startup-api/publish.gradle | 2 +- fast-startup/build.gradle | 28 +------------- fast-startup/publish.gradle | 2 +- gradle.properties | 5 ++- 10 files changed, 83 insertions(+), 107 deletions(-) create mode 100644 build-common.gradle diff --git a/CHANGE_LOG.md b/CHANGE_LOG.md index 97b8b64..6eac5b0 100644 --- a/CHANGE_LOG.md +++ b/CHANGE_LOG.md @@ -2,15 +2,19 @@ | 组件 | 最新版本 | | --- | --- | -| io.github.wizzxu:fast-startup |0.0.2 | -| io.github.wizzxu:fast-startup-api |0.0.2 | +| io.github.wizzxu:fast-startup |0.0.5 | +| io.github.wizzxu:fast-startup-api |0.0.5 | | io.github.wizzxu:fast-startup-transformer |0.0.1 | # fast-startup +### 0.0.5 +降级minSdkVersion至16 ### 0.0.2 新增隐私初始化支持 新增依赖关系打印 # fast-startup-api +### 0.0.5 +无内容变化 ### 0.0.2 新增隐私初始化支持 \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 4cfba7b..7ab6da0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,36 +3,11 @@ plugins { id 'kotlin-android' //id 'com.didiglobal.booster' } +apply from: '../build-common.gradle' android { - compileSdk 30 - defaultConfig { applicationId "io.github.fast.startup.demo" - minSdk 21 - targetSdk 30 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - debug { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' } } @@ -42,12 +17,6 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'com.google.android.material:material:1.3.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - //implementation project(path: ':fast-startup') - api "io.github.wizzxu:fast-startup:0.0.2" - //implementation "io.github.wizzxu:fast-startup:0.0.1-SNAPSHOT" - //implementation project(path: ':fast-startup-api') - testImplementation 'junit:junit:4.+' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation "io.github.wizzxu:fast-startup:${rootProject.ext.fast_startup}" } \ No newline at end of file diff --git a/app/src/main/java/io/github/fast_startup/startup/demo/App.kt b/app/src/main/java/io/github/fast_startup/startup/demo/App.kt index 2311c4a..183fe85 100644 --- a/app/src/main/java/io/github/fast_startup/startup/demo/App.kt +++ b/app/src/main/java/io/github/fast_startup/startup/demo/App.kt @@ -76,18 +76,18 @@ class App : Application() { ).start()*/ // 测试环 - //TestTask.addTask(TestCircle()) + TestTask.addTask(TestCircle()) // // //测试依缺失 - //TestTask.addTask(TestMissing()) -// -// //测试依赖接口方式 - //TestTask.addTask(TestInterfaceImp()) + TestTask.addTask(TestMissing()) + + //测试依赖接口方式 + TestTask.addTask(TestInterfaceImp()) // // //测试多次添加 - //TestTask.addTask(TestMultiAdd()) + TestTask.addTask(TestMultiAdd()) - //TestTask.addTask(TestGetResult()) + TestTask.addTask(TestGetResult()) //TestTask.addTask(TestAop()) diff --git a/build-common.gradle b/build-common.gradle new file mode 100644 index 0000000..f8300f3 --- /dev/null +++ b/build-common.gradle @@ -0,0 +1,38 @@ +android { + compileSdkVersion 30 + buildToolsVersion "30.0.3" + + defaultConfig { + minSdkVersion 16 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles "consumer-rules.pro" + } + + buildTypes { + debug { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 996a622..ba4a3d2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.5.31" - ext.booster_version = '4.0.0' - ext.dokka_version = '1.5.30' - ext.fast_startup_transformer = '0.0.1' + ext { + kotlin_version = "1.5.31" + booster_version = '4.0.0' + dokka_version = '1.5.30' + + fast_startup = '0.0.5' + fast_startup_api = '0.0.5' + fast_startup_transformer = '0.0.1' + } configurations.all { resolutionStrategy { @@ -12,9 +17,8 @@ buildscript { } } repositories { - maven { - url "https://s01.oss.sonatype.org/content/repositories/snapshots/" - } + maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" } + maven { url "https://s01.oss.sonatype.org/content/repositories/releases/" } google() mavenCentral() } @@ -30,19 +34,25 @@ buildscript { } allprojects { - configurations.all { resolutionStrategy { cacheChangingModulesFor 1, 'minutes' cacheDynamicVersionsFor 1, 'minutes' } } + if ("true" == rootProject.isDebugModule) { + configurations.all { + resolutionStrategy.dependencySubstitution { + substitute module("io.github.wizzxu:fast-startup-api") using project(":fast-startup-api") + substitute module("io.github.wizzxu:fast-startup") using project(":fast-startup") + } + } + } repositories { google() mavenCentral() - maven { - url "https://s01.oss.sonatype.org/content/repositories/snapshots/" - } + maven { url "https://s01.oss.sonatype.org/content/repositories/iogithubwizzxu-1018/" } + maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" } jcenter() // Warning: this repository is going to shut down soon } } diff --git a/fast-startup-api/build.gradle b/fast-startup-api/build.gradle index b963ff6..96bb6bb 100644 --- a/fast-startup-api/build.gradle +++ b/fast-startup-api/build.gradle @@ -4,37 +4,13 @@ plugins { } apply from: 'publish.gradle' +apply from: '../build-common.gradle' android { - compileSdkVersion 30 - buildToolsVersion "30.0.3" - - defaultConfig { - minSdkVersion 16 - targetSdkVersion 30 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles "consumer-rules.pro" - } - buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } -} - -dependencies { - - //implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" } \ No newline at end of file diff --git a/fast-startup-api/publish.gradle b/fast-startup-api/publish.gradle index 119490c..2ee7df4 100644 --- a/fast-startup-api/publish.gradle +++ b/fast-startup-api/publish.gradle @@ -20,7 +20,7 @@ task androidSourcesJar(type: Jar) { ext { PUBLISH_GROUP_ID = 'io.github.wizzxu' PUBLISH_ARTIFACT_ID = 'fast-startup-api' - PUBLISH_VERSION = '0.0.2' + PUBLISH_VERSION = '0.0.5' } // leave them empty to allow compilation diff --git a/fast-startup/build.gradle b/fast-startup/build.gradle index aaff974..cb7fb8e 100644 --- a/fast-startup/build.gradle +++ b/fast-startup/build.gradle @@ -4,43 +4,19 @@ plugins { } apply from: 'publish.gradle' - +apply from: '../build-common.gradle' android { - compileSdkVersion 30 - buildToolsVersion "30.0.3" - - defaultConfig { - minSdkVersion 21 - targetSdkVersion 30 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles "consumer-rules.pro" - } - buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } } - dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" //api project(path: ':fast-startup-api') //api "io.github.wizzxu:fast-startup-api:0.0.1-SNAPSHOT" - api "io.github.wizzxu:fast-startup-api:0.0.2" - testImplementation 'junit:junit:4.+' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + api "io.github.wizzxu:fast-startup-api:${rootProject.ext.fast_startup_api}" } \ No newline at end of file diff --git a/fast-startup/publish.gradle b/fast-startup/publish.gradle index bbe99a9..d36875e 100644 --- a/fast-startup/publish.gradle +++ b/fast-startup/publish.gradle @@ -20,7 +20,7 @@ task androidSourcesJar(type: Jar) { ext { PUBLISH_GROUP_ID = 'io.github.wizzxu' PUBLISH_ARTIFACT_ID = 'fast-startup' - PUBLISH_VERSION = '0.0.2' + PUBLISH_VERSION = '0.0.5' } // leave them empty to allow compilation diff --git a/gradle.properties b/gradle.properties index 98bed16..444b816 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,4 +18,7 @@ android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": -kotlin.code.style=official \ No newline at end of file +kotlin.code.style=official + +# 是否是调试模式 +isDebugModule=false \ No newline at end of file