diff --git a/arch-annotation/build.gradle b/arch-annotation/build.gradle deleted file mode 100644 index 108fa7ab..00000000 --- a/arch-annotation/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -apply plugin: 'java-library' - -version = QMUI_ARCH_VERSION - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) -} - -sourceCompatibility = "1.7" -targetCompatibility = "1.7" - -// deploy -File deployConfig = rootProject.file('gradle/deploy.properties') -if (deployConfig.exists()) { - apply from: rootProject.file('gradle/deploy.gradle') -} diff --git a/arch-annotation/build.gradle.kts b/arch-annotation/build.gradle.kts new file mode 100644 index 00000000..d928a9d9 --- /dev/null +++ b/arch-annotation/build.gradle.kts @@ -0,0 +1,18 @@ +import com.qmuiteam.plugin.Dep + +plugins { + `java-library` + kotlin("jvm") +} + +version = Dep.QMUI.archVer + +java { + sourceCompatibility = Dep.javaVersion + targetCompatibility = Dep.javaVersion +} + +// deploy +if(rootProject.file("gradle/deploy.properties").exists()){ + apply(from = rootProject.file("gradle/deploy.gradle")) +} diff --git a/arch-compiler/build.gradle b/arch-compiler/build.gradle deleted file mode 100644 index 8d414a9e..00000000 --- a/arch-compiler/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -apply plugin: 'java-library' - -version = QMUI_ARCH_VERSION - -dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - implementation project(':arch-annotation') - implementation 'com.squareup:javapoet:1.10.0' - implementation 'com.google.auto.service:auto-service:1.0-rc2' - annotationProcessor 'com.google.auto.service:auto-service:1.0-rc2' -} - -sourceCompatibility = "1.7" -targetCompatibility = "1.7" - -// deploy -File deployConfig = rootProject.file('gradle/deploy.properties') -if (deployConfig.exists()) { - apply from: rootProject.file('gradle/deploy.gradle') -} diff --git a/arch-compiler/build.gradle.kts b/arch-compiler/build.gradle.kts new file mode 100644 index 00000000..31e9d6eb --- /dev/null +++ b/arch-compiler/build.gradle.kts @@ -0,0 +1,23 @@ +import com.qmuiteam.plugin.Dep + +plugins { + `java-library` +} + +version = Dep.QMUI.archVer + +dependencies { + implementation(project(":arch-annotation")) + implementation(Dep.CodeGen.javapoet) + annotationProcessor(Dep.CodeGen.autoService) +} + +java { + sourceCompatibility = Dep.javaVersion + targetCompatibility = Dep.javaVersion +} + +// deploy +if(rootProject.file("gradle/deploy.properties").exists()){ + apply(from = rootProject.file("gradle/deploy.gradle")) +} diff --git a/arch/build.gradle b/arch/build.gradle deleted file mode 100644 index 081abf70..00000000 --- a/arch/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -apply plugin: 'com.android.library' - -version = QMUI_ARCH_VERSION - -android { - - compileSdkVersion parent.ext.compileSdkVersion - lintOptions { - abortOnError false - } - - defaultConfig { - minSdkVersion parent.ext.minSdkVersion - targetSdkVersion parent.ext.targetSdkVersion - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - -} - -dependencies { - api "androidx.appcompat:appcompat:$appcompatVersion" - api "androidx.fragment:fragment:1.3.6" - api project(':arch-annotation') - compileOnly project(':qmui') - testImplementation "junit:junit:$junitVersion" -} - -// deploy -File deployConfig = rootProject.file('gradle/deploy.properties') -if (deployConfig.exists()) { - apply from: rootProject.file('gradle/deploy.gradle') -} diff --git a/arch/build.gradle.kts b/arch/build.gradle.kts new file mode 100644 index 00000000..7501ab82 --- /dev/null +++ b/arch/build.gradle.kts @@ -0,0 +1,44 @@ +import com.qmuiteam.plugin.Dep + +plugins { + id("com.android.library") + kotlin("android") +} + +version = Dep.QMUI.archVer + +android { + compileSdk = Dep.compileSdk + + defaultConfig { + minSdk = Dep.minSdk + targetSdk = Dep.targetSdk + } + + buildTypes { + getByName("release"){ + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + compileOptions { + sourceCompatibility = Dep.javaVersion + targetCompatibility = Dep.javaVersion + } + kotlinOptions { + jvmTarget = Dep.kotlinJvmTarget + } +} + +dependencies { + api(Dep.AndroidX.appcompat) + api(Dep.AndroidX.fragment) + api(project(":arch-annotation")) + compileOnly(project(":qmui")) +} + +// deploy +if(rootProject.file("gradle/deploy.properties").exists()){ + apply(from = rootProject.file("gradle/deploy.gradle")) +} \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 4bfe4ba2..00000000 --- a/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - ext.kotlin_version = '1.5.21' - repositories { - mavenLocal() - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:4.1.3' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" -// classpath 'com.qmuiteam:skin-maker-plugin:0.0.1' - } -} - -subprojects { project -> - group = GROUP -} - -allprojects { - repositories { - mavenCentral() - mavenLocal() - google() - } - - ext { - minSdkVersion = 21 - targetSdkVersion = 30 - compileSdkVersion = 30 - coreVersion='1.6.0' - appcompatVersion= '1.3.1' - materialVersion='1.4.0' - annotationVersion='1.2.0' - butterknifeVersion = '10.1.0' - constraintLayoutVersion = "2.1.0" - mmkvVersion = '1.0.23' - junitVersion='4.13.2' - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..24af2b4e --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,43 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +import com.qmuiteam.plugin.Dep +buildscript { + repositories { + mavenCentral() + google() + mavenLocal() + } + dependencies { + classpath("com.android.tools.build:gradle:7.0.3") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31") + } +} + +plugins { + id("qmui-dep") +} + +subprojects { + group = Dep.QMUI.group +} + +allprojects { + repositories { + mavenCentral() + google() + mavenLocal() + } + +// ext { +// minSdkVersion = 21 +// targetSdkVersion = 30 +// compileSdkVersion = 30 +// coreVersion='1.6.0' +// appcompatVersion= '1.3.1' +// materialVersion='1.4.0' +// annotationVersion='1.2.0' +// butterknifeVersion = '10.1.0' +// constraintLayoutVersion = "2.1.0" +// mmkvVersion = '1.0.23' +// junitVersion='4.13.2' +// } +} diff --git a/compiler/build.gradle b/compiler/build.gradle deleted file mode 100644 index 3a34fabb..00000000 --- a/compiler/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -apply plugin: 'java-library' - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation project(':lib') - implementation 'com.squareup:javapoet:1.10.0' - implementation 'com.google.auto.service:auto-service:1.0-rc2' - annotationProcessor 'com.google.auto.service:auto-service:1.0-rc2' -} - -sourceCompatibility = "1.7" -targetCompatibility = "1.7" diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts new file mode 100644 index 00000000..465ec344 --- /dev/null +++ b/compiler/build.gradle.kts @@ -0,0 +1,15 @@ +import com.qmuiteam.plugin.Dep + +plugins { + `java-library` +} + +java { + sourceCompatibility = Dep.javaVersion + targetCompatibility = Dep.javaVersion +} +dependencies { + implementation(project(":lib")) + implementation(Dep.CodeGen.javapoet) + annotationProcessor(Dep.CodeGen.autoService) +} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index cb36a642..41143ebe 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip diff --git a/lib/build.gradle b/lib/build.gradle deleted file mode 100644 index b2b6bbae..00000000 --- a/lib/build.gradle +++ /dev/null @@ -1,8 +0,0 @@ -apply plugin: 'java-library' - -dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) -} - -sourceCompatibility = "1.7" -targetCompatibility = "1.7" diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts new file mode 100644 index 00000000..c0a76997 --- /dev/null +++ b/lib/build.gradle.kts @@ -0,0 +1,10 @@ +import com.qmuiteam.plugin.Dep + +plugins { + `java-library` +} + +java { + sourceCompatibility = Dep.javaVersion + targetCompatibility = Dep.javaVersion +} diff --git a/plugin/.gitignore b/plugin/.gitignore new file mode 100644 index 00000000..6b3b8782 --- /dev/null +++ b/plugin/.gitignore @@ -0,0 +1,6 @@ +/build +*.iml +.DS_Store +.gradle +.gradletasknamecache +.idea \ No newline at end of file diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts new file mode 100644 index 00000000..250fe576 --- /dev/null +++ b/plugin/build.gradle.kts @@ -0,0 +1,33 @@ +plugins { + `java-gradle-plugin` + idea + kotlin("jvm") version "1.5.31" +} + + +group = "com.qmuiteam.qmui.plugin" +version = "0.0.1" + + +gradlePlugin { + plugins { + create("qmui-dep"){ + id = "qmui-dep" + implementationClass = "com.qmuiteam.plugin.QMUIDepPlugin" + } + } +} + +repositories { + mavenCentral() + google() +} + +dependencies { + api(gradleApi()) +} + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} \ No newline at end of file diff --git a/plugin/src/main/java/com/qmuiteam/plugin/Dep.kt b/plugin/src/main/java/com/qmuiteam/plugin/Dep.kt new file mode 100644 index 00000000..797e7160 --- /dev/null +++ b/plugin/src/main/java/com/qmuiteam/plugin/Dep.kt @@ -0,0 +1,45 @@ +package com.qmuiteam.plugin + +import org.gradle.api.JavaVersion + +object Dep { + + val javaVersion = JavaVersion.VERSION_11 + const val kotlinJvmTarget = "11" + const val kotlinVer = "1.5.31" + const val compileSdk = 30 + const val minSdk = 21 + const val targetSdk = 30 + + + object QMUI { + const val group = "com.qmuiteam" + const val qmuiVer = "2.0.1" + const val archVer = "2.0.1" + const val typeVer = "0.0.14" + } + + object AndroidX { + val appcompat = "androidx.appcompat:appcompat:1.4.0" + val annotation = "androidx.annotation:annotation:1.3.0" + val coreKtx = "androidx.core:core-ktx:1.7.1" + val constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.2" + val swiperefreshlayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" + val fragment = "androidx.fragment:fragment:1.4.0" + } + + object MaterialDesign { + const val material = "com.google.android.material:material:1.4.0" + } + + object CodeGen { + const val javapoet = "com.squareup:javapoet:1.13.0" + const val autoService = "com.google.auto.service:auto-service:1.0-rc2" + } + + object ButterKnife { + private const val ver = "10.1.0" + const val butterknife = "com.jakewharton:butterknife:$ver" + const val compiler = "com.jakewharton:butterknife-compiler:$ver" + } +} \ No newline at end of file diff --git a/plugin/src/main/java/com/qmuiteam/plugin/QMUIDepPlugin.kt b/plugin/src/main/java/com/qmuiteam/plugin/QMUIDepPlugin.kt new file mode 100644 index 00000000..90c98278 --- /dev/null +++ b/plugin/src/main/java/com/qmuiteam/plugin/QMUIDepPlugin.kt @@ -0,0 +1,10 @@ +package com.qmuiteam.plugin + +import org.gradle.api.Plugin +import org.gradle.api.Project + +class QMUIDepPlugin: Plugin{ + override fun apply(project: Project) { + + } +} \ No newline at end of file diff --git a/qmui/build.gradle b/qmui/build.gradle deleted file mode 100644 index 60042f22..00000000 --- a/qmui/build.gradle +++ /dev/null @@ -1,63 +0,0 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - -version = QMUI_VERSION - -//noinspection GroovyMissingReturnStatement -android { - compileSdkVersion parent.ext.compileSdkVersion - lintOptions { - abortOnError false - } - - defaultConfig { - minSdkVersion parent.ext.minSdkVersion - targetSdkVersion parent.ext.targetSdkVersion -// vectorDrawables.useSupportLibrary = true // 与 com.android.support:support-vector-drawable 搭配使用,禁掉 Android Studio 自动生成 png 的功能 - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - -// libraryVariants.all{ variant -> -// variant.mergeResources.doLast { -// replaceTheme variant -// } -// } -// testVariants.all { variant -> -// variant.mergeResources.doLast { -// replaceTheme variant -// } -// } -} - -//def replaceTheme(variant){ -// println "dirName::${variant.dirName}" -// def output = "AppConfigTheme" -// -// File valuesFile = file("${buildDir}/intermediates/res/merged/${variant.dirName}/values/values.xml") -// String content = valuesFile.getText('UTF-8') -// content = content.replaceAll(/\$\{QMUI_PARENT_THEME\}/, output) -// valuesFile.write(content, 'UTF-8') -//} - -dependencies { - api "androidx.appcompat:appcompat:$appcompatVersion" - api "androidx.annotation:annotation:$annotationVersion" - api "com.google.android.material:material:$materialVersion" - api "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion" - - //test - testImplementation "junit:junit:$junitVersion" - api 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" -} - -// deploy -File deployConfig = rootProject.file('gradle/deploy.properties') -if (deployConfig.exists()) { - apply from: rootProject.file('gradle/deploy.gradle') -} \ No newline at end of file diff --git a/qmui/build.gradle.kts b/qmui/build.gradle.kts new file mode 100644 index 00000000..d8bb33e3 --- /dev/null +++ b/qmui/build.gradle.kts @@ -0,0 +1,47 @@ +import com.qmuiteam.plugin.Dep + +plugins { + id("com.android.library") + kotlin("android") +} + +version = Dep.QMUI.qmuiVer + +android { + compileSdk = Dep.compileSdk + + defaultConfig { + minSdk = Dep.minSdk + targetSdk = Dep.targetSdk + } + + buildTypes { + getByName("release"){ + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + compileOptions { + sourceCompatibility = Dep.javaVersion + targetCompatibility = Dep.javaVersion + } + kotlinOptions { + jvmTarget = Dep.kotlinJvmTarget + } +} + + +dependencies { + api(Dep.AndroidX.appcompat) + api(Dep.AndroidX.annotation) + api(Dep.AndroidX.constraintLayout) + api(Dep.AndroidX.swiperefreshlayout) + + api(Dep.MaterialDesign.material) +} + +// deploy +if(rootProject.file("gradle/deploy.properties").exists()){ + apply(from = rootProject.file("gradle/deploy.gradle")) +} \ No newline at end of file diff --git a/qmui/lint.xml b/qmui/lint.xml deleted file mode 100644 index 0e8bde68..00000000 --- a/qmui/lint.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - diff --git a/qmuidemo/build.gradle b/qmuidemo/build.gradle deleted file mode 100644 index f6445dc1..00000000 --- a/qmuidemo/build.gradle +++ /dev/null @@ -1,93 +0,0 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' - - -def getVersion() { - def gitVersion - try { - def cmd = 'git rev-list HEAD --count' - gitVersion = cmd.execute().text.trim().toInteger() - } catch (Exception e) { - gitVersion = 1 - } - return gitVersion -} - -def gitVersion = getVersion() -def javaVersion = JavaVersion.VERSION_1_8 - -android { - signingConfigs { - Properties properties = new Properties() - File propFile = project.file('release.properties') - if (propFile.exists()) { - properties.load(propFile.newDataInputStream()) - } - release { - keyAlias properties.getProperty("RELEASE_KEY_ALIAS") - keyPassword properties.getProperty("RELEASE_KEY_PASSWORD") - storeFile file('qmuidemo.keystore') - storePassword properties.getProperty("RELEASE_STORE_PASSWORD") - v2SigningEnabled false - } - } - compileSdkVersion parent.ext.compileSdkVersion - - // for butterknife, see https://github.com/JakeWharton/butterknife/blob/master/CHANGELOG.md#version-900-rc2-2018-11-19 - compileOptions { - sourceCompatibility javaVersion - targetCompatibility javaVersion - } - - defaultConfig { - applicationId "com.qmuiteam.qmuidemo" - minSdkVersion parent.ext.minSdkVersion - targetSdkVersion parent.ext.targetSdkVersion - versionCode gitVersion - versionName QMUI_VERSION - } - buildTypes { - debug { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - release { - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - signingConfig signingConfigs.release - } - } - // 避免 lint 检测出错时停止构建 - lintOptions { - abortOnError false - } -} - -// 加@aar与不加@aar的区别: -// http://stackoverflow.com/questions/30157575/why-should-i-include-a-gradle-dependency-as-aar -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "androidx.appcompat:appcompat:$appcompatVersion" - implementation "androidx.annotation:annotation:$annotationVersion" - implementation "com.google.android.material:material:$materialVersion" - implementation "com.jakewharton:butterknife:$butterknifeVersion" - kapt "com.jakewharton:butterknife-compiler:$butterknifeVersion" - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" -// implementation 'com.qmuiteam:arch:2.0.1' -// implementation 'com.qmuiteam:qmui:2.0.1' - implementation project(':lib') - implementation project(':qmui') - implementation project(':arch') - implementation project(':type') - kapt project(':compiler') - kapt project(':arch-compiler') - - //leak - debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4' - //test - testImplementation 'junit:junit:4.13.2' - // androidTestImplementation 'com.android.support.test:runner:1.0.2' - // androidTestImplementation 'com.android.support.test:rules:1.0.2' // Set this dependency to use JUnit 4 rules - // androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' // Set this dependency to build and run Espresso tests -} diff --git a/qmuidemo/build.gradle.kts b/qmuidemo/build.gradle.kts new file mode 100644 index 00000000..c7abd081 --- /dev/null +++ b/qmuidemo/build.gradle.kts @@ -0,0 +1,75 @@ +import com.qmuiteam.plugin.Dep +import java.io.ByteArrayOutputStream +import java.util.* + +plugins { + id("com.android.application") + kotlin("android") + kotlin("kapt") +} + +fun runCommand(project: Project, command: String): String { + val stdout = ByteArrayOutputStream() + project.exec { + commandLine = command.split(" ") + standardOutput = stdout + } + return stdout.toString().trim() +} + + +val gitVersion = runCommand(project, "git rev-list HEAD --count").toIntOrNull() ?: 1 + + +android { + signingConfigs { + val properties = Properties() + val propFile = project.file("release.properties") + if (propFile.exists()) { + properties.load(propFile.inputStream()) + } + getByName("release"){ + keyAlias = properties.getProperty("RELEASE_KEY_ALIAS") + keyPassword = properties.getProperty("RELEASE_KEY_PASSWORD") + storeFile = file("qmuidemo.keystore") + storePassword = properties.getProperty("RELEASE_STORE_PASSWORD") + enableV2Signing = false + } + } + + compileSdk = Dep.compileSdk + compileOptions { + sourceCompatibility = Dep.javaVersion + targetCompatibility = Dep.javaVersion + } + + defaultConfig { + applicationId = "com.qmuiteam.qmuidemo" + minSdk = Dep.minSdk + targetSdk = Dep.targetSdk + versionCode = gitVersion + versionName = Dep.QMUI.qmuiVer + } + buildTypes { + getByName("release") { + isMinifyEnabled = true + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + signingConfig = signingConfigs.getByName("release") + } + } +} + +dependencies { + implementation(Dep.AndroidX.appcompat) + implementation(Dep.AndroidX.annotation) + implementation(Dep.MaterialDesign.material) + + implementation(Dep.ButterKnife.butterknife) + kapt(Dep.ButterKnife.compiler) + implementation(project(":lib")) + implementation(project(":qmui")) + implementation(project(":arch")) + implementation(project(":type")) + kapt(project(":compiler")) + kapt(project(":arch-compiler")) +} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 819c57e3..00000000 --- a/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -include ':qmuidemo', ':qmui', ':lib', ':compiler', ':arch', ':arch-compiler', - ':arch-annotation' -include ':type' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..5f942fd4 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,16 @@ +include(":qmuidemo") +include(":qmui") +include(":lib") +include(":compiler") +include(":arch") +include(":arch-compiler") +include(":arch-annotation") +include(":type") + +includeBuild("./plugin") + +pluginManagement { + repositories { + mavenCentral() + } +} diff --git a/type/build.gradle b/type/build.gradle deleted file mode 100644 index 74a026eb..00000000 --- a/type/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - -version = QMUI_TYPE_VERSION - -android { - - compileSdkVersion parent.ext.compileSdkVersion - lintOptions { - abortOnError false - } - - defaultConfig { - minSdkVersion parent.ext.minSdkVersion - targetSdkVersion parent.ext.targetSdkVersion - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - -} - -dependencies { - api "androidx.annotation:annotation:$annotationVersion" - api "androidx.core:core-ktx:$appcompatVersion" - api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} - -// deploy -File deployConfig = rootProject.file('gradle/deploy.properties') -if (deployConfig.exists()) { - apply from: rootProject.file('gradle/deploy.gradle') -} \ No newline at end of file diff --git a/type/build.gradle.kts b/type/build.gradle.kts new file mode 100644 index 00000000..a932ef3e --- /dev/null +++ b/type/build.gradle.kts @@ -0,0 +1,44 @@ +import com.qmuiteam.plugin.Dep + +plugins { + id("com.android.library") + kotlin("android") +} + +version = Dep.QMUI.typeVer + + + +android { + compileSdk = Dep.compileSdk + + defaultConfig { + minSdk = Dep.minSdk + targetSdk = Dep.targetSdk + } + + buildTypes { + getByName("release"){ + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + compileOptions { + sourceCompatibility = Dep.javaVersion + targetCompatibility = Dep.javaVersion + } + kotlinOptions { + jvmTarget = Dep.kotlinJvmTarget + } +} + +dependencies { + api(Dep.AndroidX.annotation) + api(Dep.AndroidX.coreKtx) +} + +// deploy +if(rootProject.file("gradle/deploy.properties").exists()){ + apply(from = rootProject.file("gradle/deploy.gradle")) +} \ No newline at end of file diff --git a/update_from_1_to_2.md b/update_from_1_to_2.md deleted file mode 100644 index 3d2ace38..00000000 --- a/update_from_1_to_2.md +++ /dev/null @@ -1,43 +0,0 @@ -# QMUI 2.x 重要变更 - -## 概述 - -1. 升级到 Androidx -2. minSdkVersion 升级到 API 19 -3. 提供换肤(Dark Mode)支持 -4. `QMUI.Compat` 主题改名为 `QMUI`,并移除旧的 `QMUI` 主题 -5. 移除 lint 模块,不再维护 - -## 组件变更 - -### QMUITopBar - -- 使用 `QMUIQQFaceView` 来承载标题和副标题 -- 更改父类为 `QMUIRelativeLayout`,使用 QMUILayout 的分割线实现,移除配置项:`qmui_topbar_need_separator`,`qmui_topbar_separator_height`, `qmui_topbar_separator_color`。 -- 移除配置项 `qmui_topbar_bg_color`, 使用官方实现`android:background` 替代。 - -### QMUIQQFaceView - -- 可以通过 `QMUIQQFaceCompiler.setDefaultQQFaceManager()` 设置 QQFaceManager, App 不再需要定义一个子类。 - -### QMUITabSegment - -- 完全重构,与旧版本完全不兼容 - -### QMUIPopup - -- 完全重构,与旧版本完全不兼容 - -### QMUIEmptyView - -- 父类更改为 ConstraintLayout -- theme 中 添加间距、颜色、字号 - -### QMUIGroupListView - -- 配置项改名: - - qmui_commonList_titleColor -> qmui_common_list_title_color - - qmui_commonList_detailColor -> qmui_common_list_detail_color -- QMUICommonListItemView 父类更换为 ConstraintLayout, 布局重写 -- 移除 separatorStyle 的配置,使用 QMUILayout 相关的设置 -