Skip to content

Commit

Permalink
Bump dependencies.
Browse files Browse the repository at this point in the history
Migrate to version catalog.
Increase version for next release.
  • Loading branch information
pablichjenkov committed Oct 26, 2024
1 parent 662d7e6 commit b22a289
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 99 deletions.
13 changes: 7 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
plugins {
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
kotlin("multiplatform") apply false
id("org.jetbrains.kotlin.plugin.compose") apply false
id("org.jetbrains.compose") apply false
id("com.android.application") apply false
id("com.android.library") apply false
id("org.jetbrains.dokka") apply false
alias(libs.plugins.kotlin.multiplatform).apply(false)
alias(libs.plugins.compose.compiler).apply(false)
alias(libs.plugins.compose).apply(false)
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.kotlinx.serialization).apply(false)
alias(libs.plugins.dokka).apply(false)
}

allprojects {
Expand Down
36 changes: 19 additions & 17 deletions component-toolkit/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
kotlin("multiplatform")
id("com.android.library")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.compose")
id("org.jetbrains.dokka")
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.library)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.compose)
alias(libs.plugins.dokka)
id("maven-publish")
id("signing")
}

group = "io.github.pablichjenkov"
version = (findProperty("component-toolkit.version") as? String).orEmpty()
version = libs.versions.macaoComponentToolkit.get()
val mavenCentralUser = (findProperty("mavenCentral.user") as? String).orEmpty()
val mavenCentralPass = (findProperty("mavenCentral.pass") as? String).orEmpty()

Expand Down Expand Up @@ -146,7 +144,7 @@ kotlin {
browser()
}

@OptIn(ExperimentalWasmDsl::class)
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs {
moduleName = "ComponentToolkitKt"
browser()
Expand All @@ -164,24 +162,28 @@ kotlin {
implementation(compose.ui)
implementation(compose.material3)
implementation(compose.animation)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
// implementation("org.jetbrains.compose.ui:ui-util:1.5.10")
// implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
implementation("org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose:2.8.0-rc03")

// Coroutines
implementation(libs.kotlinx.coroutines.core)

// Lifecycle, used for components lifecycle
implementation(libs.lifecycle.viewmodel.compose)

}
commonTest.dependencies {
implementation(kotlin("test"))
}

// ANDROID
androidMain.dependencies {
implementation("androidx.activity:activity-compose:1.9.0")
implementation(libs.activity.compose)
api(compose.uiTooling)
api(compose.preview)
}
val androidUnitTest by getting {
dependencies {
implementation("junit:junit:4.13.2")
// Android Junit
implementation(libs.junit)
}
}
val androidInstrumentedTest by getting
Expand All @@ -206,15 +208,15 @@ kotlin {

android {
namespace = "com.macaosoftware.component"
compileSdk = (findProperty("android.compileSdk") as String).toInt()
sourceSets {
named("main") {
manifest.srcFile("src/androidMain/AndroidManifest.xml")
res.srcDirs("src/androidMain/res", "src/commonMain/resources")
}
}
defaultConfig {
minSdk = (findProperty("android.minSdk") as String).toInt()
minSdk = libs.versions.androidMinSdk.get().toInt()
compileSdk = libs.versions.androidCompileSdk.get().toInt()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand Down
41 changes: 21 additions & 20 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig

plugins {
kotlin("multiplatform")
id("com.android.application")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.compose")
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.application)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.compose)
}

version = (findProperty("component-toolkit.version") as? String).orEmpty()

/*compose {
// Sets a specific JetBrains Compose Compiler version
kotlinCompilerPlugin.set("1.4.7")
Expand Down Expand Up @@ -44,7 +41,7 @@ kotlin {
binaries.executable()
}

@OptIn(ExperimentalWasmDsl::class)
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs {
moduleName = "composeApp"
browser {
Expand All @@ -68,14 +65,14 @@ kotlin {

sourceSets {
commonMain.dependencies {
// Compose
implementation(compose.runtime)
implementation(compose.ui)
implementation(compose.foundation)
implementation(compose.material3)
implementation("org.jetbrains.compose.components:components-resources:1.6.11")

// Coroutines core
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
implementation(libs.kotlinx.coroutines.core)

// Macao Libs
api(project(":component-toolkit"))
Expand All @@ -85,32 +82,36 @@ kotlin {
implementation(kotlin("test"))
}
androidMain.dependencies {
//implementation(project(":macao-sdk-di-manual"))
implementation("androidx.activity:activity-compose:1.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
// AndroidX
implementation(libs.activity.compose)

// Coroutines
implementation(libs.kotlinx.coroutines.android)
}
jvmMain.dependencies {
//implementation(project(":macao-sdk-di-manual"))
// Compose Desktop Ecosystem
implementation(compose.desktop.common)
implementation(compose.desktop.currentOs)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.8.1")

// Coroutines core
implementation(libs.kotlinx.coroutines.swing)
}
jsMain.dependencies {
//implementation(project(":macao-sdk-di-manual"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.8.1")
// Coroutines core
implementation(libs.kotlinx.coroutines.core.js)
}
}

}

android {
namespace = "com.macaosoftware.component.demo"
compileSdk = (findProperty("android.compileSdk") as String).toInt()
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
applicationId = "com.macaosoftware.component.demo"
minSdk = (findProperty("android.minSdk") as String).toInt()
targetSdk = (findProperty("android.targetSdk") as String).toInt()
minSdk = libs.versions.androidMinSdk.get().toInt()
compileSdk = libs.versions.androidCompileSdk.get().toInt()
targetSdk = libs.versions.androidTargetSdk.get().toInt()
versionCode = 1
versionName = "1.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material3.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand Down Expand Up @@ -192,7 +193,7 @@ fun SignUpForm(
Modifier
.fillMaxWidth()
.clickable(interactionSource,
indication = rememberRipple(),
indication = ripple(),
onClick = {
acceptedTerms = acceptedTerms.not()
})
Expand Down
17 changes: 2 additions & 15 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,7 @@ org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.wasm.enabled=true

# Android
agp.version=8.3.1
android.useAndroidX=true
android.compileSdk=34
android.targetSdk=34
android.minSdk=26

# dokka version
dokkaVersion=1.8.10

# kotlin version #2.0.0-RC1
kotlin.version=2.0.0

# compose version
compose.version=1.6.11

# component-toolkit version
component-toolkit.version=0.6.11
# Bug: https://youtrack.jetbrains.com/issue/KT-66919/Inconsistent-JVM-target-compatibility-detected-for-tasks-error-still-shown-when-Kotlin-auto-selected-a-lower-target
kotlin.jvm.target.validation.mode=IGNORE
55 changes: 55 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[versions]

## Kotlin Ecosystem
kotlinVersion = "2.0.21"
kotlinxCoroutines = "1.9.0"
dokka = "1.9.10"

## Compose
composeAndroidCompiler = "1.7.4"
composeVersion = "1.7.0"

## Android Gradle Plugin
agp = "8.5.2"
androidCompileSdk = "34"
androidTargetSdk = "34"
androidMinSdk = "26"

## Macao Libs
macaoComponentToolkit = "0.7.0"

## AndroidX
androidxActivityCompose = "1.9.3"
lifecycleViewmodelCompose = "2.8.3"

## Unit Test
junit = "4.13.2"

[libraries]

## AndroidX
activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidxActivityCompose" }
lifecycle-viewmodel-compose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycleViewmodelCompose" }

## Coroutines
kotlinx-coroutines-core-js = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core-js", version.ref = "kotlinxCoroutines" }
kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinxCoroutines" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinxCoroutines" }

## Android Preview
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "composeAndroidCompiler" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "composeAndroidCompiler" }

## Test
junit = { module = "junit:junit", version.ref = "junit" }

[plugins]

kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlinVersion" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlinVersion" }
compose = { id = "org.jetbrains.compose", version.ref = "composeVersion" }
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlinVersion" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
39 changes: 13 additions & 26 deletions macao-sdk-app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
kotlin("multiplatform")
id("com.android.library")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.compose")
id("org.jetbrains.dokka")
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.library)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.compose)
alias(libs.plugins.dokka)
id("maven-publish")
id("signing")
}

group = "io.github.pablichjenkov"
version = (findProperty("component-toolkit.version") as? String).orEmpty()
version = libs.versions.macaoComponentToolkit.get()
val mavenCentralUser = (findProperty("mavenCentral.user") as? String).orEmpty()
val mavenCentralPass = (findProperty("mavenCentral.pass") as? String).orEmpty()

Expand Down Expand Up @@ -114,7 +112,7 @@ kotlin {
browser()
}

@OptIn(ExperimentalWasmDsl::class)
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs {
moduleName = "MacaoSdkApp"
browser()
Expand All @@ -128,35 +126,24 @@ kotlin {
implementation(compose.runtime)
implementation(compose.ui)
implementation(compose.foundation)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")

// Coroutines
implementation(libs.kotlinx.coroutines.core)

// Macao Libs
implementation(project(":component-toolkit"))

// Koin
// api("io.insert-koin:koin-core:3.5.3")
api("io.insert-koin:koin-core:3.6.0-wasm-alpha2")
}
commonTest.dependencies {
// implementation(libs.kotlin.test)
}
androidMain.dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
}
jvmMain.dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.8.1")
}
jsMain.dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.8.1")
implementation(kotlin("test"))
}
}
}

android {
namespace = "com.macaosoftware.app"
compileSdk = (findProperty("android.compileSdk") as String).toInt()
defaultConfig {
minSdk = (findProperty("android.minSdk") as String).toInt()
minSdk = libs.versions.androidMinSdk.get().toInt()
compileSdk = libs.versions.androidCompileSdk.get().toInt()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand Down
13 changes: 0 additions & 13 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,6 @@ pluginManagement {
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
plugins {
val kotlinVersion = extra["kotlin.version"] as String
val agpVersion = extra["agp.version"] as String
val composeVersion = extra["compose.version"] as String
val dokkaVersion = extra["dokkaVersion"] as String

kotlin("multiplatform").version(kotlinVersion)
id("org.jetbrains.kotlin.plugin.compose").version(kotlinVersion)
id("org.jetbrains.compose").version(composeVersion)
id("com.android.application").version(agpVersion)
id("com.android.library").version(agpVersion)
id("org.jetbrains.dokka").version(dokkaVersion)
}
}

dependencyResolutionManagement {
Expand Down

0 comments on commit b22a289

Please sign in to comment.