Skip to content

Commit

Permalink
Update all dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLuckyCoder committed Nov 23, 2022
1 parent da3bdaa commit 5625a8c
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 54 deletions.
3 changes: 2 additions & 1 deletion ChessAndroid/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
}

android {
namespace = "net.theluckycoder.chess"
compileSdk = Versions.Sdk.compile

defaultConfig {
Expand Down Expand Up @@ -33,7 +34,7 @@ android {
buildFeatures.compose = true

composeOptions {
kotlinCompilerExtensionVersion = Versions.compose
kotlinCompilerExtensionVersion = Versions.composeCompiler
}
}

Expand Down
3 changes: 1 addition & 2 deletions ChessAndroid/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="net.theluckycoder.chess">
xmlns:tools="http://schemas.android.com/tools">

<application
android:name=".ChessApp"
Expand Down
6 changes: 2 additions & 4 deletions ChessAndroid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ buildscript {
repositories {
google()
mavenCentral()
maven { setUrl("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
}
dependencies {
classpath("com.android.tools.build:gradle:7.1.0")
classpath("com.android.tools.build:gradle:7.3.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}")
}
}
Expand All @@ -14,7 +13,6 @@ allprojects {
repositories {
google()
mavenCentral()
maven { setUrl("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
}
}

Expand All @@ -30,7 +28,7 @@ subprojects {
}

plugins {
id("com.github.ben-manes.versions") version "0.41.0"
id("com.github.ben-manes.versions") version "0.44.0"
}

tasks.named("dependencyUpdates", com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask::class.java).configure {
Expand Down
17 changes: 9 additions & 8 deletions ChessAndroid/buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
object Versions {
object App {
private const val major = 1
private const val minor = 2
private const val patch = 2
private const val build = 2
private const val minor = 3
private const val patch = 0
private const val build = 0

const val code = major * 1000 + minor * 100 + patch * 10 + build
const val name = "$major.$minor.$patch"
Expand All @@ -12,11 +12,12 @@ object Versions {
object Sdk {
const val min = 21
const val wearOsMin = 25
const val compile = 31
const val target = 31
const val compile = 33
const val target = 33
}

const val kotlin = "1.6.10"
const val kotlinCoroutines = "1.6.0"
const val compose = "1.1.0-rc03"
const val kotlin = "1.7.21"
const val kotlinCoroutines = "1.6.4"
const val compose = "1.3.1"
const val composeCompiler = "1.4.0-alpha02"
}
2 changes: 1 addition & 1 deletion ChessAndroid/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.20)
set(PROJECT_NAME "chess")
project(${PROJECT_NAME})

Expand Down
16 changes: 8 additions & 8 deletions ChessAndroid/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ plugins {
}

android {
namespace = "net.theluckycoder.chess.common"
compileSdk = Versions.Sdk.compile
ndkVersion = "23.1.7779620"
ndkVersion = "25.1.8937393"

defaultConfig {
minSdk = Versions.Sdk.min
Expand All @@ -19,7 +20,7 @@ android {
buildFeatures.compose = true

composeOptions {
kotlinCompilerExtensionVersion = Versions.compose
kotlinCompilerExtensionVersion = Versions.composeCompiler
}

buildTypes {
Expand All @@ -34,7 +35,7 @@ android {

externalNativeBuild {
cmake {
version = "3.18.1"
version = "3.22.1"
path("CMakeLists.txt")
}
}
Expand All @@ -57,18 +58,17 @@ dependencies {
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.kotlinCoroutines}")

// AndroidX
api("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0")
api("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1")
api("androidx.datastore:datastore-preferences:1.0.0")
api("androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0")
api("androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1")

// Compose
api("androidx.activity:activity-compose:1.4.0")
api("androidx.activity:activity-compose:1.6.1")
api("androidx.compose.ui:ui:$composeVersion")
api("androidx.compose.foundation:foundation:$composeVersion")
implementation("androidx.compose.material:material:$composeVersion")
api("androidx.compose.ui:ui-tooling-preview:$composeVersion")
debugApi("androidx.compose.ui:ui-tooling:$composeVersion")
api("androidx.compose.animation:animation-graphics:$composeVersion")
api("androidx.compose.compiler:compiler:$composeVersion")
api("androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0")
api("androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1")
}
2 changes: 1 addition & 1 deletion ChessAndroid/common/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="net.theluckycoder.chess.common" />
<manifest />
2 changes: 1 addition & 1 deletion ChessAndroid/common/src/main/cpp/chess/Move.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class SimpleMove
[[nodiscard]] constexpr bool isTactical() const noexcept
{
const auto f = flags();
return f.capture() | f.promotion();
return f.capture() || f.promotion();
}

[[nodiscard]] constexpr u16 getFromToBits() const noexcept
Expand Down
2 changes: 1 addition & 1 deletion ChessAndroid/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
7 changes: 4 additions & 3 deletions ChessAndroid/wearos/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
}

android {
namespace = "net.theluckycoder.chess.wearos"
compileSdk = Versions.Sdk.compile

defaultConfig {
Expand Down Expand Up @@ -33,7 +34,7 @@ android {
buildFeatures.compose = true

composeOptions {
kotlinCompilerExtensionVersion = Versions.compose
kotlinCompilerExtensionVersion = Versions.composeCompiler
}
}

Expand All @@ -48,6 +49,6 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class).configure
dependencies {
implementation(project(path = ":common"))

implementation("androidx.wear.compose:compose-foundation:1.0.0-alpha15")
implementation("androidx.wear.compose:compose-material:1.0.0-alpha15")
implementation("androidx.wear.compose:compose-foundation:1.1.0-rc01")
implementation("androidx.wear.compose:compose-material:1.1.0-rc01")
}
3 changes: 1 addition & 2 deletions ChessAndroid/wearos/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.theluckycoder.chess.wearos">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.WAKE_LOCK" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.wear.compose.foundation.CurvedRow
import androidx.wear.compose.foundation.CurvedLayout
import androidx.wear.compose.material.Button
import androidx.wear.compose.material.ButtonDefaults
import androidx.wear.compose.material.CurvedText
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.InlineSlider
import androidx.wear.compose.material.MaterialTheme
Expand All @@ -30,6 +28,7 @@ import androidx.wear.compose.material.ScalingLazyColumn
import androidx.wear.compose.material.Text
import androidx.wear.compose.material.Vignette
import androidx.wear.compose.material.VignettePosition
import androidx.wear.compose.material.curvedText
import androidx.wear.compose.material.rememberScalingLazyListState
import net.theluckycoder.chess.common.ui.ChooseSidesToggle
import net.theluckycoder.chess.common.viewmodel.HomeViewModel
Expand All @@ -40,7 +39,6 @@ import kotlin.random.Random

object NewGameScreen {

@OptIn(ExperimentalWearMaterialApi::class)
@Composable
fun Content(onDismissRequest: () -> Unit) {
val viewModel: HomeViewModel = viewModel()
Expand All @@ -49,12 +47,13 @@ object NewGameScreen {

Scaffold(
timeText = {
val newGameString = stringResource(R.string.new_game)
if (isScreenRound()) {
CurvedRow {
CurvedText(stringResource(R.string.new_game))
CurvedLayout {
curvedText(newGameString)
}
} else {
Text(stringResource(R.string.new_game))
Text(newGameString)
}
},
positionIndicator = {
Expand Down Expand Up @@ -104,6 +103,12 @@ object NewGameScreen {
onValueChange = { difficultyLevel = it },
valueRange = 1f..5f,
steps = 3,
decreaseIcon = {
Icon(painterResource(R.drawable.ic_remove), null)
},
increaseIcon = {
Icon(painterResource(R.drawable.ic_add), null)
}
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.wear.compose.material.Button
import androidx.wear.compose.material.ButtonDefaults
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.MaterialTheme
import androidx.wear.compose.material.Scaffold
Expand All @@ -41,6 +40,7 @@ import androidx.wear.compose.material.Vignette
import androidx.wear.compose.material.VignettePosition
import androidx.wear.compose.material.dialog.Alert
import androidx.wear.compose.material.dialog.Dialog
import androidx.wear.compose.material.itemsIndexed
import kotlinx.coroutines.delay
import net.theluckycoder.chess.common.cpp.Native
import net.theluckycoder.chess.common.model.Move
Expand All @@ -52,18 +52,15 @@ import net.theluckycoder.chess.wearos.ui.isScreenRound

object WatchScreen {

@OptIn(ExperimentalWearMaterialApi::class)
@Composable
fun Content() {
val viewModel: HomeViewModel = viewModel()
val listState = rememberLazyListState()

var showNewGameDialog by remember { mutableStateOf(false) }

if (showNewGameDialog) {
Dialog(onDismissRequest = { showNewGameDialog = false }) {
NewGameScreen.Content(onDismissRequest = { showNewGameDialog = false })
}
Dialog(onDismissRequest = { showNewGameDialog = false }, showDialog = showNewGameDialog) {
NewGameScreen.Content(onDismissRequest = { showNewGameDialog = false })
}

val isThinking by viewModel.isEngineBusy.collectAsState()
Expand Down Expand Up @@ -194,7 +191,7 @@ private fun PromotionDialog(showPromotionDialog: MutableState<List<Move>>) {
},
) {
// TODO()
piecesPainters.forEachIndexed { index, painter ->
itemsIndexed(piecesPainters) { index, painter ->
Button(
colors = ButtonDefaults.secondaryButtonColors(),
onClick = {
Expand All @@ -209,15 +206,17 @@ private fun PromotionDialog(showPromotionDialog: MutableState<List<Move>>) {
}
}

Button(
modifier = Modifier.fillMaxWidth(),
onClick = { showPromotionDialog.value = emptyList() }
) {
Icon(
item {
Button(
modifier = Modifier.fillMaxWidth(),
painter = painterResource(id = net.theluckycoder.chess.common.R.drawable.ic_close),
contentDescription = stringResource(id = android.R.string.cancel)
)
onClick = { showPromotionDialog.value = emptyList() }
) {
Icon(
modifier = Modifier.fillMaxWidth(),
painter = painterResource(id = net.theluckycoder.chess.common.R.drawable.ic_close),
contentDescription = stringResource(id = android.R.string.cancel)
)
}
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions ChessAndroid/wearos/src/main/res/drawable/ic_add.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
</vector>
9 changes: 9 additions & 0 deletions ChessAndroid/wearos/src/main/res/drawable/ic_remove.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19,13H5v-2h14v2z" />
</vector>

0 comments on commit 5625a8c

Please sign in to comment.