From 72a0e1938f9b0dc8bc727ef1f5d7104ae78f1fee Mon Sep 17 00:00:00 2001 From: workspace Date: Fri, 26 Jan 2024 16:50:41 +0900 Subject: [PATCH] Release 1.4.1 - migrate from groovy to kts - bump gradle to 8.5 - bump kotlin to 1.9.21 - bump androidx activity to 1.8.2 - bump androidx core to 1.12.0 - bump compose compiler to 1.5.7 - bump material to 1.11.0 - bump color picker compose to 1.0.7 --- .github/workflows/publish.yml | 4 +- app/build.gradle | 59 ------------------ app/build.gradle.kts | 59 ++++++++++++++++++ app/proguard-rules.pro | 2 +- bottomsheetdialog-compose/build.gradle | 62 ------------------- bottomsheetdialog-compose/build.gradle.kts | 60 ++++++++++++++++++ bottomsheetdialog-compose/proguard-rules.pro | 2 +- build.gradle | 22 ------- build.gradle.kts | 24 +++++++ .../compose/Configuration.kt | 7 +-- .../bottomsheetdialog/compose/Versions.kt | 38 ------------ gradle/libs.versions.toml | 37 +++++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- scripts/publish-module.gradle | 26 +++----- scripts/publish-root.gradle | 7 +-- settings.gradle => settings.gradle.kts | 5 +- 16 files changed, 203 insertions(+), 213 deletions(-) delete mode 100644 app/build.gradle create mode 100644 app/build.gradle.kts delete mode 100644 bottomsheetdialog-compose/build.gradle create mode 100644 bottomsheetdialog-compose/build.gradle.kts delete mode 100644 build.gradle create mode 100644 build.gradle.kts delete mode 100644 buildSrc/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/Versions.kt create mode 100644 gradle/libs.versions.toml rename settings.gradle => settings.gradle.kts (75%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4b31b5e..c96f1a1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3.1.0 - name: Set up JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3.6.0 with: distribution: adopt java-version: 17 diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index ebe3844..0000000 --- a/app/build.gradle +++ /dev/null @@ -1,59 +0,0 @@ -import com.holix.android.bottomsheetdialog.compose.Configuration -import com.holix.android.bottomsheetdialog.compose.Versions -import com.holix.android.bottomsheetdialog.compose.Dependencies - -plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' -} - -android { - namespace "com.holix.android.bottomsheetdialogcomposedemo" - compileSdk Configuration.compileSdk - - defaultConfig { - applicationId "com.holix.android.bottomsheetdialog" - minSdk Configuration.minSdk - targetSdk Configuration.targetSdk - versionCode Configuration.versionCode - versionName Configuration.versionName - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - 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' - } - buildFeatures { - compose = true - } - composeOptions { - kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER - } - -} - -dependencies { - implementation project(":bottomsheetdialog-compose") - implementation platform(Dependencies.composeBom) - implementation Dependencies.composeUI - implementation Dependencies.composeFoundation - implementation Dependencies.composeMaterial - implementation Dependencies.composeActivity - implementation Dependencies.androidxCoreKtx - implementation Dependencies.material - implementation Dependencies.colorPicker - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' -} diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..58be432 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,59 @@ +import com.holix.android.bottomsheetdialog.compose.Configuration + +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) +} + +android { + namespace = "com.holix.android.bottomsheetdialogcomposedemo" + compileSdk = Configuration.compileSdk + + defaultConfig { + applicationId = "com.holix.android.bottomsheetdialog" + minSdk = Configuration.minSdk + targetSdk = Configuration.targetSdk + versionCode = 1 + versionName = "demo-app" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = libs.versions.jvmTarget.get() + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = libs.versions.androidxComposeCompiler.get() + } + +} + +dependencies { + implementation(project(":bottomsheetdialog-compose")) + implementation(libs.androidx.core) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.compose.ui) + debugImplementation(libs.androidx.compose.ui.tooling) + implementation(libs.androidx.compose.ui.tooling.preview) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material) + implementation(libs.androidx.activity.compose) + implementation(libs.material) + implementation(libs.colorPicker.compose) +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 481bb43..ff59496 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,6 +1,6 @@ # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. +# proguardFiles setting in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/bottomsheetdialog-compose/build.gradle b/bottomsheetdialog-compose/build.gradle deleted file mode 100644 index d830f5d..0000000 --- a/bottomsheetdialog-compose/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -import com.holix.android.bottomsheetdialog.compose.Configuration -import com.holix.android.bottomsheetdialog.compose.Versions -import com.holix.android.bottomsheetdialog.compose.Dependencies - -plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' -} - -ext { - PUBLISH_GROUP_ID = Configuration.artifactGroup - PUBLISH_ARTIFACT_ID = 'bottomsheetdialog-compose' - PUBLISH_VERSION = rootVersionName -} - -apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" - -android { - namespace "com.holix.android.bottomsheetdialog.compose" - compileSdk Configuration.compileSdk - - defaultConfig { - minSdk Configuration.minSdk - targetSdk Configuration.targetSdk - - 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' - } - buildFeatures { - buildConfig = false - compose = true - } - composeOptions { - kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER - } -} - -dependencies { - implementation platform(Dependencies.composeBom) - implementation Dependencies.composeUI - implementation Dependencies.composeFoundation - implementation Dependencies.androidxActivityKtx - implementation Dependencies.androidxCoreKtx - implementation Dependencies.material - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' -} diff --git a/bottomsheetdialog-compose/build.gradle.kts b/bottomsheetdialog-compose/build.gradle.kts new file mode 100644 index 0000000..f25a16b --- /dev/null +++ b/bottomsheetdialog-compose/build.gradle.kts @@ -0,0 +1,60 @@ +import com.holix.android.bottomsheetdialog.compose.Configuration + +plugins { + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) +} + +rootProject.extra.apply { + set("PUBLISH_GROUP_ID", Configuration.artifactGroup) + set("PUBLISH_ARTIFACT_ID", "bottomsheetdialog-compose") + set("PUBLISH_VERSION", rootProject.extra.get("rootVersionName")) +} + +apply(from = "${rootProject.projectDir}/scripts/publish-module.gradle") + +android { + namespace = "com.holix.android.bottomsheetdialog.compose" + compileSdk = Configuration.compileSdk + + defaultConfig { + minSdk = Configuration.minSdk + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = libs.versions.jvmTarget.get() + } + buildFeatures { + buildConfig = false + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = libs.versions.androidxComposeCompiler.get() + } +} + +dependencies { + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.compose.ui) + debugImplementation(libs.androidx.compose.ui.tooling) + implementation(libs.androidx.compose.ui.tooling.preview) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.activity) + implementation(libs.androidx.core) + implementation(libs.material) +} diff --git a/bottomsheetdialog-compose/proguard-rules.pro b/bottomsheetdialog-compose/proguard-rules.pro index 481bb43..ff59496 100644 --- a/bottomsheetdialog-compose/proguard-rules.pro +++ b/bottomsheetdialog-compose/proguard-rules.pro @@ -1,6 +1,6 @@ # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. +# proguardFiles setting in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/build.gradle b/build.gradle deleted file mode 100644 index d1dc5ec..0000000 --- a/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -import com.holix.android.bottomsheetdialog.compose.Dependencies - -apply plugin: 'io.github.gradle-nexus.publish-plugin' - -buildscript { - repositories { - google() - mavenCentral() - maven { url "https://plugins.gradle.org/m2/" } - } - dependencies { - classpath Dependencies.androidGradlePlugin - classpath Dependencies.kotlinGradlePlugin - classpath Dependencies.gradleNexusPublishPlugin - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} - -apply from: "${rootDir}/scripts/publish-root.gradle" diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..7d25d3f --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,24 @@ +apply(plugin = "io.github.gradle-nexus.publish-plugin") + +buildscript { + repositories { + google() + mavenCentral() + maven("https://plugins.gradle.org/m2/") + } +} + +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.nexus) apply false + alias(libs.plugins.spotless) apply false +} + +tasks.register("clean") + .configure { + delete(rootProject.layout.buildDirectory) + } + +apply(from = "${rootDir}/scripts/publish-root.gradle") diff --git a/buildSrc/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/Configuration.kt b/buildSrc/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/Configuration.kt index 9a98985..89b689d 100644 --- a/buildSrc/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/Configuration.kt +++ b/buildSrc/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/Configuration.kt @@ -2,13 +2,12 @@ package com.holix.android.bottomsheetdialog.compose object Configuration { const val compileSdk = 34 - const val targetSdk = 33 + const val targetSdk = 34 const val minSdk = 21 const val majorVersion = 1 const val minorVersion = 4 - const val patchVersion = 0 + const val patchVersion = 1 const val versionName = "$majorVersion.$minorVersion.$patchVersion" - const val versionCode = 140 - const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT" + const val versionCode = 141 const val artifactGroup = "com.holix.android" } diff --git a/buildSrc/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/Versions.kt b/buildSrc/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/Versions.kt deleted file mode 100644 index f719e31..0000000 --- a/buildSrc/src/main/kotlin/com/holix/android/bottomsheetdialog/compose/Versions.kt +++ /dev/null @@ -1,38 +0,0 @@ -package com.holix.android.bottomsheetdialog.compose - -object Versions { - internal const val ANDROID_GRADLE_PLUGIN = "7.4.2" - internal const val GRADLE_NEXUS_PUBLISH_PLUGIN = "1.1.0" - internal const val KOTLIN = "1.9.0" - - internal const val MATERIAL = "1.9.0" - internal const val ANDROIDX_CORE_KTX = "1.10.1" - - internal const val COMPOSE_BOM = "2023.09.00-alpha01" - const val COMPOSE_COMPILER = "1.5.1" - internal const val ANDROIDX_ACTIVITY = "1.7.2" - - internal const val COLOR_PICKER = "1.0.0" -} - -object Dependencies { - const val androidGradlePlugin = - "com.android.tools.build:gradle:${Versions.ANDROID_GRADLE_PLUGIN}" - const val gradleNexusPublishPlugin = - "io.github.gradle-nexus:publish-plugin:${Versions.GRADLE_NEXUS_PUBLISH_PLUGIN}" - const val kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.KOTLIN}" - - const val material = "com.google.android.material:material:${Versions.MATERIAL}" - const val androidxActivityKtx = "androidx.activity:activity-ktx:${Versions.ANDROIDX_ACTIVITY}" - const val androidxCoreKtx = "androidx.core:core-ktx:${Versions.ANDROIDX_CORE_KTX}" - - const val composeBom = "dev.chrisbanes.compose:compose-bom:${Versions.COMPOSE_BOM}" - const val composeUI = "androidx.compose.ui:ui" - const val composeRuntime = "androidx.compose.runtime:runtime" - const val composeMaterial = "androidx.compose.material:material" - const val composeFoundation = "androidx.compose.foundation:foundation" - const val composeTooling = "androidx.compose.ui:ui-tooling" - const val composeActivity = "androidx.activity:activity-compose:${Versions.ANDROIDX_ACTIVITY}" - - const val colorPicker = "com.github.skydoves:colorpicker-compose:${Versions.COLOR_PICKER}" -} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..a05110d --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,37 @@ +[versions] +androidGradlePlugin = "8.2.2" +nexusPlugin = "1.3.0" +kotlin = "1.9.21" +jvmTarget = "11" +spotless = "6.25.0" + +androidxActivity = "1.8.2" +androidxCore = "1.12.0" +androidxComposeBom = "2024.01.00" +androidxComposeCompiler = "1.5.7" + +material = "1.11.0" +colorPickerCompose = "1.0.7" + +[libraries] +androidx-activity = { group = "androidx.activity", name = "activity-ktx", version.ref = "androidxActivity" } +androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "androidxActivity" } +androidx-core = { group = "androidx.core", name = "core-ktx", version.ref = "androidxCore" } + +androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidxComposeBom" } +androidx-compose-runtime = { group = "androidx.compose.runtime", name = "runtime" } +androidx-compose-material = { group = "androidx.compose.material", name = "material" } +androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation" } +androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" } +androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" } +androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" } + +material = { group = "com.google.android.material", name = "material", version.ref = "material" } +colorPicker-compose = { group = "com.github.skydoves", name = "colorpicker-compose", version.ref = "colorPickerCompose" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } +android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } +nexus = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPlugin" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9942d83..7f30365 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Aug 11 17:13:17 KST 2023 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/scripts/publish-module.gradle b/scripts/publish-module.gradle index 9e12cc7..cb8b2b9 100644 --- a/scripts/publish-module.gradle +++ b/scripts/publish-module.gradle @@ -1,14 +1,12 @@ apply plugin: 'maven-publish' apply plugin: 'signing' -task androidSourcesJar(type: Jar) { +tasks.register('androidSourcesJar', Jar) { archiveClassifier.set('sources') if (project.plugins.findPlugin("com.android.library")) { - // For Android libraries from android.sourceSets.main.java.srcDirs from android.sourceSets.main.kotlin.srcDirs } else { - // For pure Kotlin libraries, in case you have them from sourceSets.main.java.srcDirs from sourceSets.main.kotlin.srcDirs } @@ -25,6 +23,7 @@ afterEvaluate { publishing { publications { release(MavenPublication) { + tasks.named("generateMetadataFileForReleasePublication").configure { dependsOn("androidSourcesJar") } // The coordinates of the library, being set from variables that // we'll set up later groupId PUBLISH_GROUP_ID @@ -38,35 +37,28 @@ afterEvaluate { from components.java } - artifact androidSourcesJar - // Mostly self-explanatory metadata pom { name = PUBLISH_ARTIFACT_ID description = 'BottomSheetDialog wrapper for Jetpack Compose' - url = 'https://github.com/holixfactory/bottomsheetdialog-compose' + url = 'https://github.com/workspace/bottomsheetdialog-compose' licenses { license { - name = 'MIT License' - url = 'https://github.com/holixfactory/bottomsheetdialog-compose/blob/main/LICENSE' + name = 'Apache-2.0 license' + url = 'https://github.com/workspace/bottomsheetdialog-compose/blob/main/LICENSE' } } developers { developer { id = 'workspace' name = 'Kimin Ryu' - email = 'ryu@holix.com' - } - developer { - id = 'Heyday7' - name = 'Taehyup Ko' - email = 'thko@holix.com' + email = 'ryukimin.workspace@gmail.com' } } scm { - connection = 'scm:git:github.com/holixfactory/bottomsheetdialog-compose.git' - developerConnection = 'scm:git:ssh://github.com/holixfactory/bottomsheetdialog-compose.git' - url = 'https://github.com/holixfactory/bottomsheetdialog-compose/tree/main' + connection = 'scm:git:github.com/workspace/bottomsheetdialog-compose.git' + developerConnection = 'scm:git:ssh://github.com/workspace/bottomsheetdialog-compose.git' + url = 'https://github.com/workspace/bottomsheetdialog-compose/tree/main' } } } diff --git a/scripts/publish-root.gradle b/scripts/publish-root.gradle index b9c39ef..ad29a0c 100644 --- a/scripts/publish-root.gradle +++ b/scripts/publish-root.gradle @@ -1,12 +1,12 @@ import com.holix.android.bottomsheetdialog.compose.Configuration // Create variables with empty default values -ext["signing.keyId"] = '' -ext["signing.password"] = '' -ext["signing.key"] = '' ext["ossrhUsername"] = '' ext["ossrhPassword"] = '' ext["sonatypeStagingProfileId"] = '' +ext["signing.keyId"] = '' +ext["signing.password"] = '' +ext["signing.key"] = '' ext["rootVersionName"] = Configuration.versionName File secretPropsFile = project.rootProject.file('local.properties') @@ -34,7 +34,6 @@ nexusPublishing { password = ossrhPassword version = rootVersionName nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) } } } diff --git a/settings.gradle b/settings.gradle.kts similarity index 75% rename from settings.gradle rename to settings.gradle.kts index 45b6a48..faf30f5 100644 --- a/settings.gradle +++ b/settings.gradle.kts @@ -10,8 +10,9 @@ dependencyResolutionManagement { repositories { google() mavenCentral() + maven(url = "https://plugins.gradle.org/m2/") } } rootProject.name = "bottomsheetdialog-compose" -include ':bottomsheetdialog-compose' -include ':app' +include(":bottomsheetdialog-compose") +include(":app")