Skip to content

Commit

Permalink
Updated libs
Browse files Browse the repository at this point in the history
  • Loading branch information
LachlanMcKee committed Aug 29, 2024
1 parent f169aec commit 8374a59
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 71 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.iml
.gradle
.idea
.kotlin
/local.properties
/.idea/caches
/.idea/libraries
Expand Down
14 changes: 14 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile

buildscript {
repositories {
Expand All @@ -17,6 +20,7 @@ plugins {
id("com.autonomousapps.dependency-analysis") version libs.versions.dependencyAnalysis.get()
id("release-dependencies-diff-compare")
id("release-dependencies-diff-create") apply false
alias(libs.plugins.compose.compiler) apply false
}

dependencyAnalysis {
Expand Down Expand Up @@ -85,6 +89,16 @@ tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}

tasks.withType(KotlinJvmCompile::class.java).configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
apiVersion.set(KotlinVersion.KOTLIN_1_9)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
// Generate default methods for implementations in interfaces. This is required for KAPT4.
freeCompilerArgs.add("-Xjvm-default=all")
}
}

allprojects {
configurations.all {
resolutionStrategy.dependencySubstitution {
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ org.gradle.parallel=true
android.useAndroidX=true
kotlin.code.style=official
library.version=1.5.0
android.experimental.lint.version=8.3.0
25 changes: 13 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ androidx-lifecycle = "2.6.1"
androidx-navigation-compose = "2.5.1"
coil = "2.2.1"
composeBom = "2024.04.00"
composeCompiler = "1.5.11"
ribs = "0.39.0"
mvicore = "1.2.6"
coroutines = "1.6.4"
kotlin = "1.9.23"
coroutines = "1.9.0-RC.2"
kotlin = "2.0.20"
junit5 = "5.8.2"
detekt = "1.22.0"
detekt = "1.23.6"
dependencyAnalysis = "1.31.0"

[libraries]
androidx-activity-compose = "androidx.activity:activity-compose:1.7.2"
androidx-appcompat = "androidx.appcompat:appcompat:1.3.1"
androidx-arch-core-testing = "androidx.arch.core:core-testing:2.1.0"
androidx-core = "androidx.core:core-ktx:1.9.0"
androidx-core-splashscreen = "androidx.core:core-splashscreen:1.0.0"
androidx-appcompat = "androidx.appcompat:appcompat:1.6.1"
androidx-arch-core-testing = "androidx.arch.core:core-testing:2.2.0"
androidx-core = "androidx.core:core-ktx:1.12.0"
androidx-core-splashscreen = "androidx.core:core-splashscreen:1.0.1"
androidx-lifecycle-common = { module = "androidx.lifecycle:lifecycle-common", version.ref = "androidx-lifecycle" }
androidx-lifecycle-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidx-lifecycle" }
androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation-compose" }
androidx-test-espresso-core = "androidx.test.espresso:espresso-core:3.5.0"
androidx-test-junit = "androidx.test.ext:junit:1.1.3"
androidx-test-rules = "androidx.test:rules:1.4.0"
androidx-tracing = "androidx.tracing:tracing:1.2.0"
androidx-test-espresso-core = "androidx.test.espresso:espresso-core:3.6.0"
androidx-test-junit = "androidx.test.ext:junit:1.2.0"
androidx-test-rules = "androidx.test:rules:1.6.0"
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
# compose versions are resolved by BOM
Expand Down Expand Up @@ -76,8 +76,9 @@ plugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.
plugin-detekt = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }
plugin-android = "com.android.tools.build:gradle:8.2.2"

detekt-compose = "io.nlopez.compose.rules:detekt:0.1.5"
detekt-compose = "io.nlopez.compose.rules:detekt:0.1.6"
toolargetool = "com.gu.android:toolargetool:0.3.0"

[plugins]
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
5 changes: 2 additions & 3 deletions libraries/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.config.JvmTarget

plugins {
id("com.android.library")
alias(libs.plugins.compose.compiler)
id("kotlin-android")
id("kotlin-parcelize")
id("appyx-publish-android")
Expand Down Expand Up @@ -30,9 +31,6 @@ android {
kotlinOptions {
jvmTarget = JvmTarget.JVM_11.toString()
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
testOptions {
unitTests.all {
// interface method default implementation
Expand All @@ -52,6 +50,7 @@ dependencies {
api(libs.androidx.appcompat)
api(libs.kotlin.coroutines.android)

debugImplementation(libs.androidx.tracing) // Espresso fails without this
implementation(composeBom)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.java8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ internal class ChildNodeCreationManager<NavTarget : Any>(
when (keepMode) {
ChildEntry.KeepMode.KEEP -> {
navModelKeepKeys =
(state.onScreen + state.offScreen).mapNotNullToSet { element -> element.key }
state.onScreen.mapNotNullToSet { element -> element.key } +
state.offScreen.mapNotNullToSet { element -> element.key }
navModelSuspendKeys = emptySet()
navModelKeys = navModelKeepKeys
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ fun <NavTarget : Any, State> ParentNode<NavTarget>.Child(
transitionParams: TransitionParams,
transitionHandler: TransitionHandler<NavTarget, State>,
decorator: @Composable ChildTransitionScope<State>.(
child: ChildRenderer,
transitionDescriptor: TransitionDescriptor<NavTarget, State>
ChildRenderer,
TransitionDescriptor<NavTarget, State>
) -> Unit
) {
val childEntry = remember(navElement.key.id) { childOrCreate(navElement.key) }
Expand All @@ -55,11 +55,11 @@ fun <NavTarget : Any, State> ParentNode<NavTarget>.Child(
)

transitionScope.decorator(
child = ChildRendererImpl(
ChildRendererImpl(
node = childEntry.node,
transitionModifier = transitionScope.transitionModifier
),
transitionDescriptor = descriptor,
descriptor,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,25 @@ class ChildrenTransitionScope<T : Any, S>(
@Composable
fun ParentNode<T>.children(
clazz: KClass<out T>,
block: @Composable ChildTransitionScope<S>.(child: ChildRenderer) -> Unit,
block: @Composable ChildTransitionScope<S>.(ChildRenderer) -> Unit,
) {
_children(clazz) { scope, child, _ ->
scope.block(
child = child
)
scope.block(child)
}
}

@Composable
fun ParentNode<T>.children(
clazz: KClass<out T>,
block: @Composable ChildTransitionScope<S>.(
child: ChildRenderer,
transitionDescriptor: TransitionDescriptor<T, S>
ChildRenderer,
TransitionDescriptor<T, S>
) -> Unit,
) {
_children(clazz) { scope, child, descriptor ->
scope.block(
transitionDescriptor = descriptor,
child = child,
child,
descriptor,
)
}
}
Expand Down
4 changes: 1 addition & 3 deletions libraries/interop-ribs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.config.JvmTarget

plugins {
id("com.android.library")
alias(libs.plugins.compose.compiler)
id("kotlin-android")
id("kotlin-parcelize")
id("appyx-publish-android")
Expand All @@ -22,9 +23,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down
4 changes: 1 addition & 3 deletions libraries/testing-junit4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.config.JvmTarget

plugins {
id("com.android.library")
alias(libs.plugins.compose.compiler)
id("kotlin-android")
id("appyx-publish-android")
id("appyx-lint")
Expand All @@ -21,9 +22,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down
4 changes: 1 addition & 3 deletions libraries/testing-junit5/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.config.JvmTarget

plugins {
id("com.android.library")
alias(libs.plugins.compose.compiler)
id("kotlin-android")
id("appyx-publish-android")
id("appyx-lint")
Expand All @@ -21,9 +22,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
packagingOptions {
resources {
excludes += setOf("META-INF/LICENSE.md", "META-INF/LICENSE-notice.md")
Expand Down
4 changes: 1 addition & 3 deletions libraries/testing-ui-activity/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.config.JvmTarget

plugins {
id("com.android.library")
alias(libs.plugins.compose.compiler)
id("kotlin-android")
id("appyx-publish-android")
id("appyx-lint")
Expand All @@ -19,9 +20,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down
4 changes: 1 addition & 3 deletions libraries/testing-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.config.JvmTarget

plugins {
id("com.android.library")
alias(libs.plugins.compose.compiler)
id("kotlin-android")
id("appyx-publish-android")
id("appyx-lint")
Expand All @@ -21,9 +22,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down
4 changes: 1 addition & 3 deletions libraries/testing-unit-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.config.JvmTarget

plugins {
id("com.android.library")
alias(libs.plugins.compose.compiler)
id("kotlin-android")
id("appyx-publish-android")
id("appyx-lint")
Expand All @@ -21,9 +22,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down
2 changes: 1 addition & 1 deletion plugins/publish-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ java {
targetCompatibility = JavaVersion.VERSION_11
}

tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile::class.java).configureEach {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile::class.java).configureEach {
kotlinOptions.jvmTarget = JvmTarget.JVM_11.toString()
}

Expand Down
10 changes: 1 addition & 9 deletions samples/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.config.JvmTarget

plugins {
id("com.android.application")
alias(libs.plugins.compose.compiler)
id("kotlin-android")
id("kotlin-parcelize")
id("appyx-lint")
Expand Down Expand Up @@ -49,10 +50,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand All @@ -79,9 +76,4 @@ dependencies {
implementation(libs.compose.ui.tooling)
implementation(libs.compose.ui.ui)
implementation(libs.google.material)

androidTestImplementation(composeBom)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.androidx.test.junit)
androidTestImplementation(libs.compose.ui.test.junit4)
}
4 changes: 1 addition & 3 deletions samples/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.config.JvmTarget

plugins {
id("com.android.library")
alias(libs.plugins.compose.compiler)
id("kotlin-android")
id("kotlin-parcelize")
id("appyx-lint")
Expand All @@ -21,9 +22,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down
5 changes: 1 addition & 4 deletions samples/navigation-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.config.JvmTarget

plugins {
id("com.android.library")
alias(libs.plugins.compose.compiler)
id("kotlin-android")
id("kotlin-parcelize")
id("appyx-lint")
Expand Down Expand Up @@ -30,10 +31,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down
5 changes: 1 addition & 4 deletions samples/navmodel-samples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.config.JvmTarget

plugins {
id("com.android.library")
alias(libs.plugins.compose.compiler)
id("kotlin-android")
id("kotlin-parcelize")
id("appyx-lint")
Expand All @@ -21,10 +22,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand Down
Loading

0 comments on commit 8374a59

Please sign in to comment.