diff --git a/.github/workflows/build_1.x.yml b/.github/workflows/build_1.x.yml index bd3a823e9..744891b4b 100644 --- a/.github/workflows/build_1.x.yml +++ b/.github/workflows/build_1.x.yml @@ -5,6 +5,8 @@ on: branches: - 1.x pull_request: + branches: + - 1.x workflow_dispatch: env: diff --git a/.github/workflows/build_2.x.yml b/.github/workflows/build_2.x.yml index 5f6c92694..d253d18a2 100644 --- a/.github/workflows/build_2.x.yml +++ b/.github/workflows/build_2.x.yml @@ -5,6 +5,8 @@ on: branches: - 2.x pull_request: + branches: + - 2.x workflow_dispatch: env: diff --git a/.gitignore b/.gitignore index 202ee72a2..6cd6a1432 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.iml .gradle .idea +.kotlin /local.properties /.idea/caches /.idea/libraries diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d41e6480..7e8072a67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Pending changes - [#705](https://github.com/bumble-tech/appyx/pull/705) – **Fixed**: ChildAware extension functions now allow Any type as a parameter +- [#716](https://github.com/bumble-tech/appyx/pull/716) – **Updated**: Kotlin (2.0.20), Compose Compiler (now implicit from Kotlin), Coroutines (1.9.0-RC.2), AGP (8.5.2), numerous Androidx libs --- diff --git a/build.gradle.kts b/build.gradle.kts index b925251af..d51cbefc3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,8 @@ +import com.android.Version +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 { @@ -17,6 +21,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 { @@ -85,12 +90,30 @@ tasks.register("clean", Delete::class) { delete(rootProject.buildDir) } +// TODO: Enable K2 in a later PR +tasks.withType(KotlinJvmCompile::class.java).configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_11) + apiVersion.set(KotlinVersion.KOTLIN_1_9) + languageVersion.set(KotlinVersion.KOTLIN_1_9) + } +} + allprojects { configurations.all { - resolutionStrategy.dependencySubstitution { - substitute(module("com.bumble.appyx:customisations")) - .using(project(":libraries:customisations")) - .because("RIBs uses Appyx customisations as external dependency") + resolutionStrategy { + failOnNonReproducibleResolution() + dependencySubstitution { + substitute(module("com.bumble.appyx:customisations")) + .using(project(":libraries:customisations")) + .because("RIBs uses Appyx customisations as external dependency") + } + eachDependency { + when (requested.group) { + // Version 1.0 and 1.1 are included which cause ':libraries:core' espresso tests to fail + "androidx.tracing" -> useVersion(libs.versions.androidx.tracing.get()) + } + } } } } diff --git a/gradle.properties b/gradle.properties index dac2ecdb1..924b999b2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b08607b23..7063bbb4b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,30 +7,30 @@ androidTargetSdk = "34" accompanist = "0.28.0" androidx-lifecycle = "2.6.1" androidx-navigation-compose = "2.5.1" +androidx-tracing = "1.2.0" 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-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 @@ -74,10 +74,11 @@ junit-vintage = { module = "org.junit.vintage:junit-vintage-engine", version.ref plugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } plugin-detekt = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" } -plugin-android = "com.android.tools.build:gradle:8.2.2" +plugin-android = "com.android.tools.build:gradle:8.5.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" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 41d9927a4..7f93135c4 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fce403e45..09523c0e5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c78733..1aa94a426 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -205,6 +214,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index ac1b06f93..6689b85be 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/libraries/core/build.gradle.kts b/libraries/core/build.gradle.kts index 663f56662..c03ab1b3d 100644 --- a/libraries/core/build.gradle.kts +++ b/libraries/core/build.gradle.kts @@ -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") @@ -30,9 +31,6 @@ android { kotlinOptions { jvmTarget = JvmTarget.JVM_11.toString() } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } testOptions { unitTests.all { // interface method default implementation diff --git a/libraries/core/src/main/kotlin/com/bumble/appyx/core/children/ChildNodeCreationManager.kt b/libraries/core/src/main/kotlin/com/bumble/appyx/core/children/ChildNodeCreationManager.kt index 1b020aa96..29e9724fc 100644 --- a/libraries/core/src/main/kotlin/com/bumble/appyx/core/children/ChildNodeCreationManager.kt +++ b/libraries/core/src/main/kotlin/com/bumble/appyx/core/children/ChildNodeCreationManager.kt @@ -49,7 +49,8 @@ internal class ChildNodeCreationManager( 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 } diff --git a/libraries/core/src/main/kotlin/com/bumble/appyx/core/composable/Child.kt b/libraries/core/src/main/kotlin/com/bumble/appyx/core/composable/Child.kt index da743771f..56439c01e 100644 --- a/libraries/core/src/main/kotlin/com/bumble/appyx/core/composable/Child.kt +++ b/libraries/core/src/main/kotlin/com/bumble/appyx/core/composable/Child.kt @@ -38,8 +38,8 @@ fun ParentNode.Child( transitionParams: TransitionParams, transitionHandler: TransitionHandler, decorator: @Composable ChildTransitionScope.( - child: ChildRenderer, - transitionDescriptor: TransitionDescriptor + ChildRenderer, + TransitionDescriptor ) -> Unit ) { val childEntry = remember(navElement.key.id) { childOrCreate(navElement.key) } @@ -55,11 +55,11 @@ fun ParentNode.Child( ) transitionScope.decorator( - child = ChildRendererImpl( + ChildRendererImpl( node = childEntry.node, transitionModifier = transitionScope.transitionModifier ), - transitionDescriptor = descriptor, + descriptor, ) } } diff --git a/libraries/core/src/main/kotlin/com/bumble/appyx/core/composable/Children.kt b/libraries/core/src/main/kotlin/com/bumble/appyx/core/composable/Children.kt index 9b27ff37e..7bafa664c 100644 --- a/libraries/core/src/main/kotlin/com/bumble/appyx/core/composable/Children.kt +++ b/libraries/core/src/main/kotlin/com/bumble/appyx/core/composable/Children.kt @@ -91,12 +91,10 @@ class ChildrenTransitionScope( @Composable fun ParentNode.children( clazz: KClass, - block: @Composable ChildTransitionScope.(child: ChildRenderer) -> Unit, + block: @Composable ChildTransitionScope.(ChildRenderer) -> Unit, ) { _children(clazz) { scope, child, _ -> - scope.block( - child = child - ) + scope.block(child) } } @@ -104,14 +102,14 @@ class ChildrenTransitionScope( fun ParentNode.children( clazz: KClass, block: @Composable ChildTransitionScope.( - child: ChildRenderer, - transitionDescriptor: TransitionDescriptor + ChildRenderer, + TransitionDescriptor ) -> Unit, ) { _children(clazz) { scope, child, descriptor -> scope.block( - transitionDescriptor = descriptor, - child = child, + child, + descriptor, ) } } diff --git a/libraries/core/src/test/kotlin/com/bumble/appyx/core/lifecycle/LifecycleExtKtTest.kt b/libraries/core/src/test/kotlin/com/bumble/appyx/core/lifecycle/LifecycleExtKtTest.kt index 4e1fa631f..3b4c19fa7 100644 --- a/libraries/core/src/test/kotlin/com/bumble/appyx/core/lifecycle/LifecycleExtKtTest.kt +++ b/libraries/core/src/test/kotlin/com/bumble/appyx/core/lifecycle/LifecycleExtKtTest.kt @@ -4,7 +4,8 @@ import androidx.arch.core.executor.testing.InstantTaskExecutorRule import androidx.lifecycle.Lifecycle import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.launch -import kotlinx.coroutines.test.runBlockingTest +import kotlinx.coroutines.test.UnconfinedTestDispatcher +import kotlinx.coroutines.test.runTest import org.junit.Assert.assertEquals import org.junit.Rule import org.junit.Test @@ -18,7 +19,7 @@ class LifecycleExtKtTest { @Test fun `asFlow follows lifecycle`() { val lifecycle = TestLifecycle() - runBlockingTest { + runTest(UnconfinedTestDispatcher()) { val events = ArrayList() val task = launch { lifecycle.asFlow().collect { events += it } } diff --git a/libraries/interop-ribs/build.gradle.kts b/libraries/interop-ribs/build.gradle.kts index 3543839c1..a86e2c23f 100644 --- a/libraries/interop-ribs/build.gradle.kts +++ b/libraries/interop-ribs/build.gradle.kts @@ -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") @@ -22,9 +23,6 @@ android { buildFeatures { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 diff --git a/libraries/testing-junit4/build.gradle.kts b/libraries/testing-junit4/build.gradle.kts index f7d6969a5..06ccc4fda 100644 --- a/libraries/testing-junit4/build.gradle.kts +++ b/libraries/testing-junit4/build.gradle.kts @@ -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") @@ -21,9 +22,6 @@ android { buildFeatures { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 diff --git a/libraries/testing-junit5/build.gradle.kts b/libraries/testing-junit5/build.gradle.kts index a9f5b34dd..0ad856ea7 100644 --- a/libraries/testing-junit5/build.gradle.kts +++ b/libraries/testing-junit5/build.gradle.kts @@ -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") @@ -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") diff --git a/libraries/testing-ui-activity/build.gradle.kts b/libraries/testing-ui-activity/build.gradle.kts index 35cac02f3..844187df9 100644 --- a/libraries/testing-ui-activity/build.gradle.kts +++ b/libraries/testing-ui-activity/build.gradle.kts @@ -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") @@ -19,9 +20,6 @@ android { buildFeatures { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 diff --git a/libraries/testing-ui/build.gradle.kts b/libraries/testing-ui/build.gradle.kts index ef7d0021b..2897f9337 100644 --- a/libraries/testing-ui/build.gradle.kts +++ b/libraries/testing-ui/build.gradle.kts @@ -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") @@ -21,9 +22,6 @@ android { buildFeatures { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 diff --git a/libraries/testing-unit-common/build.gradle.kts b/libraries/testing-unit-common/build.gradle.kts index 2201965fa..2c4fae76d 100644 --- a/libraries/testing-unit-common/build.gradle.kts +++ b/libraries/testing-unit-common/build.gradle.kts @@ -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") @@ -21,9 +22,6 @@ android { buildFeatures { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 diff --git a/plugins/publish-plugin/build.gradle.kts b/plugins/publish-plugin/build.gradle.kts index 10728ff46..473ecef62 100644 --- a/plugins/publish-plugin/build.gradle.kts +++ b/plugins/publish-plugin/build.gradle.kts @@ -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() } diff --git a/plugins/verification-plugin/src/main/kotlin/LintPlugin.kt b/plugins/verification-plugin/src/main/kotlin/LintPlugin.kt index 439572cac..eb12c32a1 100644 --- a/plugins/verification-plugin/src/main/kotlin/LintPlugin.kt +++ b/plugins/verification-plugin/src/main/kotlin/LintPlugin.kt @@ -17,7 +17,7 @@ class LintPlugin : Plugin { } private fun collectLintSarif(target: Project) { - target.extensions.configure>("android") { + target.extensions.configure>("android") { lint { sarifReport = true baseline = target.file("lint-baseline.xml") diff --git a/samples/app/build.gradle.kts b/samples/app/build.gradle.kts index cdc902576..935cbd991 100644 --- a/samples/app/build.gradle.kts +++ b/samples/app/build.gradle.kts @@ -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") @@ -49,10 +50,6 @@ android { buildFeatures { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } - compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 @@ -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) } diff --git a/samples/common/build.gradle.kts b/samples/common/build.gradle.kts index 4d2ae1196..f1a82b85c 100644 --- a/samples/common/build.gradle.kts +++ b/samples/common/build.gradle.kts @@ -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") @@ -21,9 +22,6 @@ android { buildFeatures { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 diff --git a/samples/navigation-compose/build.gradle.kts b/samples/navigation-compose/build.gradle.kts index e056d1a2f..fc2a079f2 100644 --- a/samples/navigation-compose/build.gradle.kts +++ b/samples/navigation-compose/build.gradle.kts @@ -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") @@ -30,10 +31,6 @@ android { buildFeatures { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } - compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 diff --git a/samples/navmodel-samples/build.gradle.kts b/samples/navmodel-samples/build.gradle.kts index d2acb4772..735fd9b70 100644 --- a/samples/navmodel-samples/build.gradle.kts +++ b/samples/navmodel-samples/build.gradle.kts @@ -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") @@ -21,10 +22,6 @@ android { buildFeatures { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } - compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 diff --git a/samples/sandbox/build.gradle.kts b/samples/sandbox/build.gradle.kts index cff15557b..b83eddb24 100644 --- a/samples/sandbox/build.gradle.kts +++ b/samples/sandbox/build.gradle.kts @@ -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") @@ -33,9 +34,6 @@ android { buildFeatures { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() - } packagingOptions { resources { excludes += setOf("META-INF/AL2.0", "META-INF/LGPL2.1")