Skip to content

Commit

Permalink
Updated libs
Browse files Browse the repository at this point in the history
  • Loading branch information
LachlanMcKee committed Aug 30, 2024
1 parent f169aec commit 9d61c45
Show file tree
Hide file tree
Showing 27 changed files with 99 additions and 95 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

---

Expand Down
13 changes: 13 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,15 @@ 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 {
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
27 changes: 14 additions & 13 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 @@ -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" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
41 changes: 28 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -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/.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -193,18 +198,28 @@ 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" \
-classpath "$CLASSPATH" \
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.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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%

Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,7 +19,7 @@ class LifecycleExtKtTest {
@Test
fun `asFlow follows lifecycle`() {
val lifecycle = TestLifecycle()
runBlockingTest {
runTest(UnconfinedTestDispatcher()) {
val events = ArrayList<Lifecycle.State>()
val task = launch { lifecycle.asFlow().collect { events += it } }

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
Loading

0 comments on commit 9d61c45

Please sign in to comment.