Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin 2.x | Compose Compiler Update | Dependency upgrades #982

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ docs

/.bundle/
/vendor/*
/.kotlin/
21 changes: 6 additions & 15 deletions aboutlibraries-compose-m2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
kotlin("multiplatform")
id("com.android.library")
id("org.jetbrains.compose")
id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish")
alias(libs.plugins.androidLibrary)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.composeCompiler)
alias(libs.plugins.dokka)
alias(libs.plugins.mavenPublish)
}

android {
Expand Down Expand Up @@ -36,7 +37,7 @@ android {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "11"

if (project.findProperty("composeCompilerReports") == "true") {
freeCompilerArgs += listOf(
"-P",
Expand All @@ -62,21 +63,11 @@ android {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}

lint {
abortOnError = false
}
}


compose {
//kotlinCompilerPlugin.set("androidx.compose.compiler:compiler")
//kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=${libs.versions.kotlinCore.get()}")
}

kotlin {
applyDefaultHierarchyTemplate()

Expand Down
19 changes: 5 additions & 14 deletions aboutlibraries-compose-m3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
kotlin("multiplatform")
id("com.android.library")
id("org.jetbrains.compose")
id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish")
alias(libs.plugins.androidLibrary)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.composeCompiler)
alias(libs.plugins.dokka)
alias(libs.plugins.mavenPublish)
}

android {
Expand Down Expand Up @@ -61,21 +62,11 @@ android {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}

lint {
abortOnError = false
}
}


compose {
//kotlinCompilerPlugin.set("androidx.compose.compiler:compiler")
//kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=${libs.versions.kotlinCore.get()}")
}

kotlin {
applyDefaultHierarchyTemplate()

Expand Down
8 changes: 4 additions & 4 deletions aboutlibraries-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("multiplatform")
// kotlin("native.cocoapods")
id("com.android.library")
id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish")
alias(libs.plugins.androidLibrary)
alias(libs.plugins.dokka)
alias(libs.plugins.mavenPublish)
kotlin("plugin.serialization") version libs.versions.kotlinCore.get()
}

Expand Down Expand Up @@ -35,7 +35,7 @@ android {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=" +
"${project.path}/compose_compiler_config.conf"
"${project.path}/compose_compiler_config.conf"
)
}
}
Expand Down
10 changes: 3 additions & 7 deletions app-desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
id("org.jetbrains.compose")
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.composeCompiler)
id("com.mikepenz.aboutlibraries.plugin")
application
}
Expand All @@ -24,15 +25,10 @@ dependencies {
// Coroutines
implementation(libs.kotlin.coroutines.core)

// example for parent via a prent
// example for parent via a parent
// implementation("org.apache.commons:commons-csv:1.9.0")
}

compose {
kotlinCompilerPlugin.set(libs.versions.composeCompilerJb.get())
//kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=${libs.versions.kotlinCore.get()}")
}

tasks.withType<JavaCompile> {
sourceCompatibility = "11"
targetCompatibility = "11"
Expand Down
7 changes: 2 additions & 5 deletions app-wasm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.composeCompiler)
id("com.mikepenz.aboutlibraries.plugin")
}

Expand Down Expand Up @@ -43,8 +44,4 @@ kotlin {

compose.experimental {
web.application {}
}

compose {
kotlinCompilerPlugin.set(libs.versions.composeCompilerJb.get())
}
8 changes: 3 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import com.mikepenz.aboutlibraries.plugin.DuplicateRule
import com.mikepenz.aboutlibraries.plugin.StrictMode

plugins {
id 'com.android.application'
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.composeCompiler)
}
apply plugin: 'kotlin-android'
apply plugin: 'com.mikepenz.aboutlibraries.plugin' // has to be applied AFTER android
Expand Down Expand Up @@ -75,10 +77,6 @@ android {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}

packagingOptions {
exclude 'META-INF/library-core_release.kotlin_module'
exclude 'META-INF/library_release.kotlin_module'
Expand Down
43 changes: 0 additions & 43 deletions build.gradle

This file was deleted.

39 changes: 39 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask

buildscript {
apply(from = "configurations.gradle")

dependencies {
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin")
}
}

plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.composeCompiler) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.navSafeArgs) apply false
alias(libs.plugins.dokka)
alias(libs.plugins.mavenPublish) apply false
}

allprojects {
group = properties["GROUP"]!!
version = properties["VERSION_NAME"]!!

repositories {
mavenLocal()
mavenCentral()
google()
maven { setUrl("https://androidx.dev/storage/compose-compiler/repository") }
maven { setUrl("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
maven { setUrl("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental") }
}
}

tasks.withType<DokkaMultiModuleTask>().configureEach {
dependsOn(gradle.includedBuild("plugin-build").task(":plugin:dokkaHtmlPartial"))
addSubprojectChildTasks(":plugin-build:build:dokkaHtmlPartial")
}
32 changes: 19 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
[versions]
# android sdk versions
compileSdk = "34"
coreMinSdk = "19"
minSdk = "21"
targetSdk = "34"
# build
gradleBuild = "8.3.1"
gradleBuild = "8.4.0"
# kotlin
dokka = "1.9.20"
kotlinCore = { require = "1.9.23" }
kotlinCore = { require = "2.0.0-RC2" }
kotlinCoroutines = { require = "1.8.0" }
kotlinxSerialization = "1.6.3"
kotlinxCollections = "0.3.7"
# compose
compose = "1.6.4"
composeUi = "1.6.4" # foundation / material
composeCompiler = "1.5.11"
composejb = "1.6.1"
composeCompilerJb = "1.5.10"
compose = "1.6.7"
compose-plugin = "1.6.10-rc01"
composeUi = "1.6.7" # foundation / material
# androidx
activity = "1.8.2"
activity = "1.9.0"
cardview = "1.0.0"
constraintLayout = "2.1.4"
core = "1.12.0"
core = "1.13.1"
lifecycle = { require = "2.7.0" }
navigation = "2.7.7"
recyclerView = "1.3.2"
# google
material = "1.11.0"
material = "1.12.0"
# other
accompanist = "0.34.0"
fastAdapter = "5.7.0"
gradleMvnPublish = "0.25.3"
gradleMvnPublish = "0.28.0"
iconics = "5.4.0"
itemAnimators = "1.1.0"
ivy = "2.5.2"
materialDrawer = "9.0.2"
okhttp = "4.12.0"

[plugins]
androidApplication = { id = "com.android.application", version.ref = "gradleBuild" }
androidLibrary = { id = "com.android.library", version.ref = "gradleBuild" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlinCore" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlinCore" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
navSafeArgs = { id = "androidx.navigation.safeargs", version.ref = "navigation" }
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "gradleMvnPublish" }

[libraries]
# build
gradle-build = { module = "com.android.tools.build:gradle", version.ref = "gradleBuild" }
Expand All @@ -57,7 +64,6 @@ compose-androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling", versi
compose-androidx-foundation-core = { module = "androidx.compose.foundation:foundation", version.ref = "composeUi" }
compose-androidx-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "composeUi" }
compose-androidx-material = { module = "androidx.compose.material:material", version.ref = "composeUi" }
compose-jb-plug = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "composejb" }
# androidx
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity" }
androidx-cardView = { module = "androidx.cardview:cardview", version.ref = "cardview" }
Expand Down
10 changes: 10 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
pluginManagement {
repositories {
maven { setUrl("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
maven { setUrl("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental") }
google()
gradlePluginPortal()
mavenCentral()
}
}

rootProject.name = "AboutLibraries"

include ':aboutlibraries-core'
Expand Down
Loading