Skip to content

Commit

Permalink
Update Freeletics Gradle Plugin to v0.7.0 (#578)
Browse files Browse the repository at this point in the history
* Update Freeletics Gradle Plugin to v0.7.0

* update build config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Ittner <[email protected]>
  • Loading branch information
renovate[bot] and gabrielittner authored Sep 28, 2023
1 parent a77e818 commit a274a9c
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 76 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
alias(libs.plugins.kotlin.multiplatform).apply(false)
alias(libs.plugins.android.app).apply(false)
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.jetbrains.compose).apply(false)
alias(libs.plugins.dependency.analysis).apply(false)
alias(libs.plugins.dokka).apply(false)
alias(libs.plugins.publish).apply(false)
Expand Down
13 changes: 5 additions & 8 deletions compose/compose.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
plugins {
alias(libs.plugins.fgp.multiplatform)
alias(libs.plugins.fgp.publish)
alias(libs.plugins.compose.multiplatform)
}

freeletics {
explicitApi()
useCompose()

// TODO https://github.com/JetBrains/compose-multiplatform/issues/3344
// addCommonTargets(androidNativeTargets = false)
}

compose {
kotlinCompilerPlugin.set(libs.versions.compose.multiplatform.compiler)
// multiplatform {
// addCommonTargets()
// }
}

kotlin {
Expand Down Expand Up @@ -47,6 +44,6 @@ kotlin {

dependencies {
commonMainApi(projects.flowredux)
commonMainApi(libs.compose.multiplatform.runtime)
commonMainApi(libs.jetbrains.compose.runtime)
commonMainImplementation(libs.coroutines.core)
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public fun <S : Any, A : Any> FlowReduxStateMachine<S, A>.rememberStateAndDispat

val state = stateMachine.rememberState()
val dispatchAction = remember(scope, stateMachine) {
{ action: A ->
{
action: A ->
scope.launch {
stateMachine.dispatch(action)
}
Expand Down
2 changes: 0 additions & 2 deletions flowredux/flowredux.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ plugins {
}

freeletics {
explicitApi()

multiplatform {
addCommonTargets()
}
Expand Down
41 changes: 21 additions & 20 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[versions]
kotlin = "1.9.10"
coroutines = "1.7.3"
compose-multiplatform = "1.5.2"
compose-multiplatform-compiler = "1.5.2"

java-target = "1.8"
java-toolchain = "19"
Expand All @@ -11,15 +9,19 @@ android-gradle = "8.1.1"
android-min = "21"
android-target = "34"
android-compile = "34"
androidx-activity = "1.7.2"
androidx-annotation = "1.7.0"
androidx-appcompat = "1.6.1"

androidx-compose-compiler = "1.5.3"
androidx-compose-runtime = "1.5.2"
androidx-compose-ui = "1.5.2"
androidx-compose-foundation = "1.5.2"
androidx-compose-material = "1.5.2"
androidx-compose-material3 = "1.1.2"
jetbrains-compose = "1.5.2"
jetbrains-compose-compiler = "1.5.2"

androidx-activity = "1.7.2"
androidx-annotation = "1.7.0"
androidx-appcompat = "1.6.1"
androidx-constraintlayout = "2.1.4"
androidx-core = "1.12.0"
androidx-lifecycle = "2.6.2"
Expand All @@ -34,9 +36,8 @@ mad = "0.15.0"

turbine = "1.0.0"
kotlinx-collections-immutable= "0.3.5"
jetbrains-compose-runtime = "1.5.2"

fgp = "0.6.1"
fgp = "0.7.0"
publish = "0.25.3"
dokka = "1.9.0"
binarycompatibility = "0.13.2"
Expand All @@ -46,22 +47,23 @@ dependency-analysis = "1.22.0"
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-test-annotations = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
compose-multiplatform-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose-multiplatform" }
compose-multiplatform-compiler = { module = "org.jetbrains.compose.compiler:compiler", version.ref = "compose-multiplatform-compiler" }

coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }

androidx-activity = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity" }
androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "androidx-compose-compiler" }
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "androidx-compose-runtime" }
androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "androidx-compose-ui" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-compose-foundation" }
androidx-compose-material = { module = "androidx.compose.material:material", version.ref = "androidx-compose-material" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "androidx-compose-material3" }
jetbrains-compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "jetbrains-compose" }
jetbrains-compose-compiler = { module = "org.jetbrains.compose.compiler:compiler", version.ref = "jetbrains-compose-compiler" }

androidx-activity = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity" }
androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidx-constraintlayout" }
androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidx-core" }
androidx-lifecycle = { module = "androidx.lifecycle:lifecycle-common", version.ref = "androidx-lifecycle" }
Expand All @@ -78,22 +80,21 @@ mad-statemachine = { module = "com.freeletics.mad:state-machine", version.ref =

turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" }
kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "kotlinx-collections-immutable" }
jetbrains-compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "jetbrains-compose-runtime" }

[plugins]
fgp-android = { id = "com.freeletics.gradle.common.android", version.ref = "fgp" }
fgp-android-app = { id = "com.freeletics.gradle.common.android.app", version.ref = "fgp" }
fgp-jvm = { id = "com.freeletics.gradle.common.jvm", version.ref = "fgp" }
fgp-multiplatform = { id = "com.freeletics.gradle.common.multiplatform", version.ref = "fgp" }
fgp-publish = { id = "com.freeletics.gradle.common.publish.oss", version.ref = "fgp" }
fgp-android = { id = "com.freeletics.gradle.android", version.ref = "fgp" }
fgp-android-app = { id = "com.freeletics.gradle.android.app", version.ref = "fgp" }
fgp-jvm = { id = "com.freeletics.gradle.jvm", version.ref = "fgp" }
fgp-multiplatform = { id = "com.freeletics.gradle.multiplatform", version.ref = "fgp" }
fgp-publish = { id = "com.freeletics.gradle.publish.oss", version.ref = "fgp" }
fgp-root = { id = "com.freeletics.gradle.root", version.ref = "fgp" }
fgp-settings = { id = "com.freeletics.gradle.settings", version.ref = "fgp" }

android-app = { id = "com.android.application", version.ref = "android-gradle" }
android-library = { id = "com.android.library", version.ref = "android-gradle" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
compose-multiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "jetbrains-compose" }
publish = { id = "com.vanniktech.maven.publish", version.ref = "publish" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
binarycompatibility = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binarycompatibility" }
Expand Down
38 changes: 1 addition & 37 deletions sample/android/sample-android.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@ plugins {

freeletics {
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
useCompose()

android {
enableCompose()
enableViewBinding()
}
}

android {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + buildComposeMetricsParameters()
}
}

dependencies {
implementation(libs.androidx.core)
implementation(libs.androidx.annotation)
Expand All @@ -44,33 +38,3 @@ dependencies {
implementation(projects.flowredux)
implementation(projects.compose)
}

fun Project.buildComposeMetricsParameters(): List<String> = buildList(4) {
val enableMetricsProvider = project.providers.gradleProperty("enableComposeCompilerMetrics")
val enableMetrics = enableMetricsProvider.orNull == "true"
if (enableMetrics) {
val metricsFolderAbsolutePath = project.layout.buildDirectory
.file("compose-metrics")
.map { it.asFile.absolutePath }
.get()

add("-P")
add(
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=$metricsFolderAbsolutePath",
)
}

val enableReportsProvider = project.providers.gradleProperty("enableComposeCompilerReports")
val enableReports = enableReportsProvider.orNull == "true"
if (enableReports) {
val reportsFolderAbsolutePath = project.layout.buildDirectory
.file("compose-reports")
.map { it.asFile.absolutePath }
.get()

add("-P")
add(
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=$reportsFolderAbsolutePath",
)
}
}
2 changes: 1 addition & 1 deletion sample/shared_code/sample-shared_code.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ freeletics {
dependencies {
commonMainApi(projects.flowredux)
commonMainApi(libs.kotlinx.collections.immutable)
commonMainCompileOnly(libs.jetbrains.compose.runtime)
commonMainApi(libs.jetbrains.compose.runtime)
}
8 changes: 1 addition & 7 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@ pluginManagement {
}
}

dependencyResolutionManagement {
repositories {
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
}

plugins {
id("com.freeletics.gradle.settings").version("0.6.1")
id("com.freeletics.gradle.settings").version("0.7.0")
}

rootProject.name = "flowredux-library"

0 comments on commit a274a9c

Please sign in to comment.