diff --git a/.tool-versions b/.tool-versions index 2063182..bc2afb2 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -java temurin-17.0.11+9 +java temurin-17.0.12+7 diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 798a266..e54ae29 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -1,6 +1,6 @@ plugins { alias(libs.plugins.android.application) - alias(libs.plugins.kotlin.compose) + alias(libs.plugins.compose.compiler) alias(libs.plugins.compose) alias(libs.plugins.jetbrains.kotlin.android) } @@ -20,7 +20,7 @@ android { dependencies { implementation(compose.components.resources) implementation(compose.runtime) - implementation(compose.foundation) +// implementation(compose.foundation) implementation(compose.material3) implementation(compose.ui) implementation(compose.components.resources) @@ -35,8 +35,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } buildTypes { @@ -51,7 +51,7 @@ android { } } kotlinOptions { - jvmTarget = "17" + jvmTarget = "11" } } dependencies { diff --git a/android/src/main/kotlin/ch/dissem/android/MainActivity.kt b/android/src/main/kotlin/ch/dissem/android/MainActivity.kt index ad2ed08..c82e371 100644 --- a/android/src/main/kotlin/ch/dissem/android/MainActivity.kt +++ b/android/src/main/kotlin/ch/dissem/android/MainActivity.kt @@ -3,7 +3,10 @@ package ch.dissem.android import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import ch.dissem.yaep.ui.common.App @@ -12,7 +15,13 @@ class MainActivity : ComponentActivity() { super.onCreate(savedInstanceState) setContent { - App() + Scaffold( + topBar = { + + } + ) {insets -> + App(modifier = Modifier.padding(insets)) + } } } } diff --git a/build.gradle.kts b/build.gradle.kts index d2e692b..6806e39 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,13 +1,15 @@ +import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile plugins { // this is necessary to avoid the plugins to be loaded multiple times // in each subproject's classloader + alias(libs.plugins.versions) alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false alias(libs.plugins.compose) apply false - alias(libs.plugins.kotlin.compose) apply false + alias(libs.plugins.compose.compiler) apply false alias(libs.plugins.kotlin.multiplatform) apply false alias(libs.plugins.kotlin.jvm) apply false alias(libs.plugins.jetbrains.kotlin.android) apply false @@ -18,3 +20,16 @@ tasks.withType().configureEach { jvmTarget.set(JvmTarget.JVM_11) } } + +tasks.withType { + rejectVersionIf { + isNonStable(candidate.version) && !isNonStable(currentVersion) + } +} + +fun isNonStable(version: String): Boolean { + return version.contains("dev", ignoreCase = true) + || version.contains("alpha", ignoreCase = true) + || version.contains("beta", ignoreCase = true) + || version.contains("RC", ignoreCase = true) +} diff --git a/commonUI/build.gradle.kts b/commonUI/build.gradle.kts index e09ab41..09ad0af 100644 --- a/commonUI/build.gradle.kts +++ b/commonUI/build.gradle.kts @@ -1,6 +1,6 @@ plugins { alias(libs.plugins.kotlin.jvm) - alias(libs.plugins.kotlin.compose) + alias(libs.plugins.compose.compiler) alias(libs.plugins.compose) } diff --git a/commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/App.kt b/commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/App.kt index 5040319..66c0d75 100644 --- a/commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/App.kt +++ b/commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/App.kt @@ -19,6 +19,7 @@ import androidx.compose.material3.CardDefaults import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedCard +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -29,6 +30,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.alpha import androidx.compose.ui.draw.shadow import androidx.compose.ui.input.pointer.PointerButton.Companion.Secondary +import androidx.compose.ui.unit.TextUnit +import androidx.compose.ui.unit.TextUnitType import androidx.compose.ui.unit.dp import ch.dissem.yaep.domain.Clue import ch.dissem.yaep.domain.Game @@ -62,6 +65,7 @@ class DisplayClue(val clue: C) { fun App(modifier: Modifier = Modifier, game: Game = remember { generateGame() }) { val horizontalClues = remember { game.horizontalClues.map { DisplayClue(it) } } val verticalClues = remember { game.verticalClues.map { DisplayClue(it) } } + val time = "00:00:00" // TODO Row(modifier = modifier) { PuzzleGrid( modifier = Modifier.aspectRatio(1f).weight(0.6f).fillMaxHeight(), @@ -71,11 +75,17 @@ fun App(modifier: Modifier = Modifier, game: Game = remember { generateGame() }) verticalClues.forEach { it.update(game.grid) } } ) - PuzzleClues( - modifier = Modifier.padding(start = 16.dp).weight(0.4f).fillMaxHeight(), - horizontalClues, - verticalClues - ) + Column( + modifier = Modifier.padding(start = 16.dp).weight(0.4f).fillMaxHeight() + ) { + PuzzleClues( + modifier = Modifier, + horizontalClues, + verticalClues + ) + + Text(time, fontSize = TextUnit(4f, TextUnitType.Em)) + } } } diff --git a/desktop/build.gradle.kts b/desktop/build.gradle.kts index 5579324..63a8477 100644 --- a/desktop/build.gradle.kts +++ b/desktop/build.gradle.kts @@ -2,7 +2,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat plugins { alias(libs.plugins.kotlin.jvm) - alias(libs.plugins.kotlin.compose) + alias(libs.plugins.compose.compiler) alias(libs.plugins.compose) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ef04ac3..e5b446b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ agp = "8.5.1" android-compileSdk = "34" android-minSdk = "24" android-targetSdk = "34" -androidx-activityCompose = "1.9.0" +androidx-activityCompose = "1.9.1" androidx-compose = "1.6.8" compose-plugin = "1.6.11" kotlin = "2.0.0" @@ -12,16 +12,17 @@ coreKtx = "1.13.1" [libraries] androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" } -androidx-tooling-preview = {module="androidx.compose.ui:ui-tooling-preview", version.ref="androidx-compose"} +androidx-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "androidx-compose" } kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } atrium = { module = "ch.tutteli.atrium:atrium-fluent", version = "1.2.0" } androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } [plugins] +versions = { id = "com.github.ben-manes.versions", version = "0.51.0" } android-application = { id = "com.android.application", version.ref = "agp" } android-library = { id = "com.android.library", version.ref = "agp" } kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } compose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" } jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinVersion" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135..e644113 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 b82aa23..dedd5d1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew.bat b/gradlew.bat index 93e3f59..25da30d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail