diff options
-rw-r--r-- | about/build.gradle | 2 | ||||
-rw-r--r-- | adapter/build.gradle | 6 | ||||
-rw-r--r-- | android-lib.gradle | 20 | ||||
-rw-r--r-- | build.gradle | 20 | ||||
-rw-r--r-- | buildSrc/README.md | 4 | ||||
-rw-r--r-- | buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy | 57 | ||||
-rw-r--r-- | buildSrc/src/main/kotlin/ChangelogGenerator.kt (renamed from buildSrc/src/main/kotlin/ca/allanwang/kau/ChangelogGenerator.kt) | 4 | ||||
-rw-r--r-- | buildSrc/src/main/kotlin/Dependencies.kt (renamed from buildSrc/src/main/kotlin/ca/allanwang/kau/Dependencies.kt) | 2 | ||||
-rw-r--r-- | buildSrc/src/main/kotlin/Plugins.kt (renamed from buildSrc/src/main/kotlin/ca/allanwang/kau/Plugins.kt) | 2 | ||||
-rw-r--r-- | buildSrc/src/main/kotlin/Versions.kt (renamed from buildSrc/src/main/kotlin/ca/allanwang/kau/Versions.kt) | 2 | ||||
-rw-r--r-- | colorpicker/build.gradle | 4 | ||||
-rw-r--r-- | core-ui/build.gradle | 2 | ||||
-rw-r--r-- | core/build.gradle | 22 | ||||
-rw-r--r-- | kpref-activity/build.gradle | 2 | ||||
-rw-r--r-- | mediapicker/build.gradle | 6 | ||||
-rw-r--r-- | sample/build.gradle | 26 |
16 files changed, 57 insertions, 124 deletions
diff --git a/about/build.gradle b/about/build.gradle index 29f77c0..3aa9ef2 100644 --- a/about/build.gradle +++ b/about/build.gradle @@ -10,7 +10,7 @@ dependencies { implementation project(':core-ui') implementation project(':adapter') - api("com.mikepenz:aboutlibraries:${kau.aboutLibraries}@aar") { + api("com.mikepenz:aboutlibraries:${Versions.aboutLibraries}@aar") { transitive = false } } diff --git a/adapter/build.gradle b/adapter/build.gradle index a4f2583..8826c7d 100644 --- a/adapter/build.gradle +++ b/adapter/build.gradle @@ -1,12 +1,12 @@ -ext.kauSubModuleMinSdk = kau.coreMinSdk +ext.kauSubModuleMinSdk = Versions.coreMinSdk apply from: '../android-lib.gradle' dependencies { implementation project(':core') - api "com.mikepenz:fastadapter-commons:${kau.fastAdapterCommons}@aar" - api "com.mikepenz:fastadapter:${kau.fastAdapter}@aar" + api "com.mikepenz:fastadapter-commons:${Versions.fastAdapterCommons}@aar" + api "com.mikepenz:fastadapter:${Versions.fastAdapter}@aar" } apply from: '../artifacts.gradle' diff --git a/android-lib.gradle b/android-lib.gradle index e8a4c6d..fd691b2 100644 --- a/android-lib.gradle +++ b/android-lib.gradle @@ -6,15 +6,15 @@ apply plugin: 'com.getkeepsafe.dexcount' group = "ca.allanwang" android { - compileSdkVersion kau.targetSdk - buildToolsVersion kau.buildTools + compileSdkVersion Versions.targetSdk + buildToolsVersion Versions.buildTools androidGitVersion { codeFormat = 'MMNNPPXX' format = '%tag%%.count%%-commit%' } - def kauMinSdk = kau.minSdk + def kauMinSdk = Versions.minSdk if (project.hasProperty('kauSubModuleMinSdk')) kauMinSdk = kauSubModuleMinSdk @@ -26,7 +26,7 @@ android { defaultConfig { minSdkVersion kauMinSdk - targetSdkVersion kau.targetSdk + targetSdkVersion Versions.targetSdk versionName androidGitVersion.name() versionCode androidGitVersion.code() consumerProguardFiles 'progress-proguard.txt' @@ -82,11 +82,11 @@ android { } dependencies { - testImplementation kauDependency.kotlinTest - testImplementation kauDependency.junit + testImplementation Dependencies.kotlinTest + testImplementation Dependencies.junit - androidTestImplementation kauDependency.kotlinTest - androidTestImplementation kauDependency.espresso - androidTestImplementation kauDependency.testRules - androidTestImplementation kauDependency.testRunner + androidTestImplementation Dependencies.kotlinTest + androidTestImplementation Dependencies.espresso + androidTestImplementation Dependencies.testRules + androidTestImplementation Dependencies.testRunner }
\ No newline at end of file diff --git a/build.gradle b/build.gradle index 39aba6f..bcdff15 100644 --- a/build.gradle +++ b/build.gradle @@ -6,29 +6,25 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } } - apply plugin: "ca.allanwang.kau" - dependencies { - classpath kauPlugin.android - classpath kauPlugin.kotlin - classpath kauPlugin.androidMaven - classpath kauPlugin.playPublisher - classpath kauPlugin.dexCount - classpath kauPlugin.gitVersion - classpath kauPlugin.spotless + classpath Plugins.android + classpath Plugins.kotlin + classpath Plugins.androidMaven + classpath Plugins.playPublisher + classpath Plugins.dexCount + classpath Plugins.gitVersion + classpath Plugins.spotless } wrapper.setDistributionType(Wrapper.DistributionType.ALL) } -apply plugin: "ca.allanwang.kau" - task clean(type: Delete) { delete rootProject.buildDir } task generateChangelogMd { - kauChangelog.generate("${project.rootDir}/sample/src/main/res/xml/kau_changelog.xml") + ChangelogGenerator.generate("${project.rootDir}/sample/src/main/res/xml/kau_changelog.xml", "${project.rootDir}/docs/Changelog.md") } subprojects { diff --git a/buildSrc/README.md b/buildSrc/README.md index 91a60ac..abb6b41 100644 --- a/buildSrc/README.md +++ b/buildSrc/README.md @@ -65,12 +65,12 @@ The versions are taken from `Versions.groovy`, so it is always in sync. > [Dependencies.groovy](/buildSrc/src/main/groovy/ca/allanwang/kau/Dependencies.groovy) Contains the dependency string for common libraries. -You are free to use the values through `kauDependency.[tagName]`. +You are free to use the values through `Dependencies..[tagName]`. As an example, adding junit can be done through ```gradle -testImplementation kauDependency.junit +testImplementation Dependencies..junit ``` # Changelog Generator diff --git a/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy b/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy deleted file mode 100644 index d767a8a..0000000 --- a/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy +++ /dev/null @@ -1,57 +0,0 @@ -package ca.allanwang.kau - -class Versions { - static def coreMinSdk = 19 - static def minSdk = 21 - static def targetSdk = 28 - - // https://developer.android.com/studio/releases/build-tools - static def buildTools = '28.0.3' - - // https://developer.android.com/topic/libraries/support-library/revisions - static def supportLibs = '28.0.0' - - // https://kotlinlang.org/docs/reference/using-gradle.html - static def kotlin = '1.2.71' - - // https://github.com/mikepenz/AboutLibraries/releases - static def aboutLibraries = '6.1.1' - - // https://github.com/Kotlin/anko/releases - static def anko = '0.10.5' - - // https://github.com/wasabeef/Blurry/releases - static def blurry = '2.1.1' - - // https://dl.google.com/dl/android/maven2/com/android/support/constraint/group-index.xml - static def constraintLayout = '1.1.3' - - // https://github.com/mikepenz/FastAdapter#using-maven - static def fastAdapter = '3.2.9' - static def fastAdapterCommons = fastAdapter - - // https://github.com/bumptech/glide/releases - static def glide = '4.8.0' - - // https://github.com/mikepenz/Android-Iconics#1-provide-the-gradle-dependency - static def iconics = '3.0.4' - static def iconicsGoogle = '3.0.1.2' - static def iconicsMaterial = '2.2.0.4' - static def iconicsCommunity = '2.0.46.1' - - // https://github.com/afollestad/material-dialogs/releases - static def materialDialog = '0.9.6.0' - - static def espresso = '3.0.1' - static def junit = '4.12' - static def testRunner = '1.0.1' - - static def gradlePlugin = '3.2.1' - static def mavenPlugin = '2.1' - static def playPublishPlugin = '1.2.2' - - // https://github.com/KeepSafe/dexcount-gradle-plugin/releases - static def dexCountPlugin = '0.8.4' - // https://github.com/gladed/gradle-android-git-version/releases - static def gitVersionPlugin = '0.4.5' -}
\ No newline at end of file diff --git a/buildSrc/src/main/kotlin/ca/allanwang/kau/ChangelogGenerator.kt b/buildSrc/src/main/kotlin/ChangelogGenerator.kt index 66f28f9..4be3ecf 100644 --- a/buildSrc/src/main/kotlin/ca/allanwang/kau/ChangelogGenerator.kt +++ b/buildSrc/src/main/kotlin/ChangelogGenerator.kt @@ -1,5 +1,3 @@ -package ca.allanwang.kau - import groovy.util.Node import groovy.util.XmlParser import org.gradle.api.GradleException @@ -34,6 +32,7 @@ object ChangelogGenerator { } } + @JvmStatic fun read(inputUri: String): List<ChangelogEntry> { val input = File(inputUri) if (!input.exists()) { @@ -70,6 +69,7 @@ object ChangelogGenerator { return entries } + @JvmStatic fun generate(inputUri: String, outputUri: String): List<ChangelogEntry> { val entries = read(inputUri) val output = File(outputUri) diff --git a/buildSrc/src/main/kotlin/ca/allanwang/kau/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 74f482f..3fd40ed 100644 --- a/buildSrc/src/main/kotlin/ca/allanwang/kau/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -1,5 +1,3 @@ -package ca.allanwang.kau - /** * Some common dependencies, backed by the supplied versions */ diff --git a/buildSrc/src/main/kotlin/ca/allanwang/kau/Plugins.kt b/buildSrc/src/main/kotlin/Plugins.kt index 2be0a59..e321628 100644 --- a/buildSrc/src/main/kotlin/ca/allanwang/kau/Plugins.kt +++ b/buildSrc/src/main/kotlin/Plugins.kt @@ -1,5 +1,3 @@ -package ca.allanwang.kau - /** * Some common buildscript plugins, backed by the supplied versions */ diff --git a/buildSrc/src/main/kotlin/ca/allanwang/kau/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 93cb25e..7f4cdca 100644 --- a/buildSrc/src/main/kotlin/ca/allanwang/kau/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,5 +1,3 @@ -package ca.allanwang.kau - object Versions { const val coreMinSdk = 19 const val minSdk = 21 diff --git a/colorpicker/build.gradle b/colorpicker/build.gradle index 4b89e10..33e73cc 100644 --- a/colorpicker/build.gradle +++ b/colorpicker/build.gradle @@ -1,13 +1,13 @@ ext.kauSubModuleResourcePrefix = "kau_color_" -ext.kauSubModuleMinSdk = kau.coreMinSdk +ext.kauSubModuleMinSdk = Versions.coreMinSdk apply from: '../android-lib.gradle' dependencies { implementation project(':core') - implementation "com.afollestad.material-dialogs:color:${kau.materialDialog}" + implementation "com.afollestad.material-dialogs:color:${Versions.materialDialog}" } apply from: '../artifacts.gradle' diff --git a/core-ui/build.gradle b/core-ui/build.gradle index 397d4ab..816e53a 100644 --- a/core-ui/build.gradle +++ b/core-ui/build.gradle @@ -1,4 +1,4 @@ -ext.kauSubModuleMinSdk = kau.coreMinSdk +ext.kauSubModuleMinSdk = Versions.coreMinSdk apply from: '../android-lib.gradle' diff --git a/core/build.gradle b/core/build.gradle index 3ac4f36..7ffd789 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,22 +1,22 @@ -ext.kauSubModuleMinSdk = kau.coreMinSdk +ext.kauSubModuleMinSdk = Versions.coreMinSdk apply from: '../android-lib.gradle' dependencies { - api kauDependency.kotlin + api Dependencies..kotlin - api "androidx.appcompat:appcompat:${kau.appcompat}" - api "androidx.recyclerview:recyclerview:${kau.recyclerView}" - api "androidx.cardview:cardview:${kau.cardView}" - api "androidx.constraintlayout:constraintlayout:${kau.constraintLayout}" - api "com.google.android.material:material:${kau.googleMaterial}" + api "androidx.appcompat:appcompat:${Versions.appcompat}" + api "androidx.recyclerview:recyclerview:${Versions.recyclerView}" + api "androidx.cardview:cardview:${Versions.cardView}" + api "androidx.constraintlayout:constraintlayout:${Versions.constraintLayout}" + api "com.google.android.material:material:${Versions.googleMaterial}" - api "org.jetbrains.kotlinx:kotlinx-coroutines-android:${kau.coroutines}" + api "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.coroutines}" - api "com.mikepenz:iconics-core:${kau.iconics}@aar" - api "com.mikepenz:google-material-typeface:${kau.iconicsGoogle}.original@aar" + api "com.mikepenz:iconics-core:${Versions.iconics}@aar" + api "com.mikepenz:google-material-typeface:${Versions.iconicsGoogle}.original@aar" - api "com.afollestad.material-dialogs:core:${kau.materialDialog}" + api "com.afollestad.material-dialogs:core:${Versions.materialDialog}" } apply from: '../artifacts.gradle' diff --git a/kpref-activity/build.gradle b/kpref-activity/build.gradle index ef91e2b..f22a4a0 100644 --- a/kpref-activity/build.gradle +++ b/kpref-activity/build.gradle @@ -1,4 +1,4 @@ -ext.kauSubModuleMinSdk = kau.coreMinSdk +ext.kauSubModuleMinSdk = Versions.coreMinSdk ext.kauSubModuleResourcePrefix = "kau_pref_" diff --git a/mediapicker/build.gradle b/mediapicker/build.gradle index 20d7750..3d4819a 100644 --- a/mediapicker/build.gradle +++ b/mediapicker/build.gradle @@ -1,4 +1,4 @@ -ext.kauSubModuleMinSdk = kau.coreMinSdk +ext.kauSubModuleMinSdk = Versions.coreMinSdk apply from: '../android-lib.gradle' apply plugin: 'kotlin-kapt' @@ -8,8 +8,8 @@ dependencies { implementation project(':adapter') //noinspection GradleDependency - api "com.github.bumptech.glide:glide:${kau.glide}" - implementation "jp.wasabeef:blurry:${kau.blurry}" + api "com.github.bumptech.glide:glide:${Versions.glide}" + implementation "jp.wasabeef:blurry:${Versions.blurry}" } apply from: '../artifacts.gradle' diff --git a/sample/build.gradle b/sample/build.gradle index bb7cab0..b443f51 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -9,8 +9,8 @@ play { } android { - compileSdkVersion kau.targetSdk - buildToolsVersion kau.buildTools + compileSdkVersion Versions.targetSdk + buildToolsVersion Versions.buildTools androidGitVersion { codeFormat = 'MMNNPPXX' @@ -19,8 +19,8 @@ android { defaultConfig { applicationId "ca.allanwang.kau.sample" - minSdkVersion kau.minSdk - targetSdkVersion kau.targetSdk + minSdkVersion Versions.minSdk + targetSdkVersion Versions.targetSdk versionName androidGitVersion.name() versionCode androidGitVersion.code() multiDexEnabled true @@ -122,15 +122,15 @@ dependencies { implementation project(':searchview') implementation project(':mediapicker') - implementation "com.afollestad.material-dialogs:input:${kau.materialDialog}" + implementation "com.afollestad.material-dialogs:input:${Versions.materialDialog}" - testImplementation kauDependency.kotlinTest - testImplementation kauDependency.junit + testImplementation Dependencies..kotlinTest + testImplementation Dependencies..junit - androidTestImplementation kauDependency.kotlinTest - androidTestImplementation kauDependency.espresso - androidTestImplementation "androidx.test.espresso:espresso-intents:${kau.espresso}" - androidTestImplementation "androidx.test.espresso:espresso-contrib:${kau.espresso}" - androidTestImplementation kauDependency.testRules - androidTestImplementation kauDependency.testRunner + androidTestImplementation Dependencies..kotlinTest + androidTestImplementation Dependencies..espresso + androidTestImplementation "androidx.test.espresso:espresso-intents:${Versions.espresso}" + androidTestImplementation "androidx.test.espresso:espresso-contrib:${Versions.espresso}" + androidTestImplementation Dependencies..testRules + androidTestImplementation Dependencies..testRunner } |