Fix some build warnings
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 7m36s
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 7m36s
This commit is contained in:
@@ -56,6 +56,11 @@ android {
|
|||||||
merges += "/META-INF/{AL2.0,LGPL2.1}"
|
merges += "/META-INF/{AL2.0,LGPL2.1}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lint {
|
||||||
|
baseline = file("lint-baseline.xml")
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
4
android/lint-baseline.xml
Normal file
4
android/lint-baseline.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<issues format="6" by="lint 8.13.2" type="baseline" client="gradle" dependencies="false" name="AGP (8.13.2)" variant="all" version="8.13.2">
|
||||||
|
|
||||||
|
</issues>
|
||||||
@@ -21,6 +21,7 @@ sonar {
|
|||||||
properties {
|
properties {
|
||||||
property("sonar.projectKey", "YAEP")
|
property("sonar.projectKey", "YAEP")
|
||||||
property("sonar.projectName", "YAEP")
|
property("sonar.projectName", "YAEP")
|
||||||
|
property("sonar.organization", "default")
|
||||||
|
|
||||||
property(
|
property(
|
||||||
"sonar.coverage.jacoco.xmlReportPaths",
|
"sonar.coverage.jacoco.xmlReportPaths",
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.kotlin.kover)
|
alias(libs.plugins.kotlin.kover)
|
||||||
alias(libs.plugins.kotlin.multiplatform)
|
alias(libs.plugins.kotlin.multiplatform)
|
||||||
@@ -13,9 +10,12 @@ kotlin {
|
|||||||
jvmToolchain(libs.versions.jdk.get().toInt())
|
jvmToolchain(libs.versions.jdk.get().toInt())
|
||||||
|
|
||||||
jvm()
|
jvm()
|
||||||
androidTarget {
|
androidLibrary {
|
||||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
namespace = "ch.dissem.yaep.common.ui"
|
||||||
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
|
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
||||||
|
minSdk = libs.versions.android.minSdk.get().toInt()
|
||||||
|
|
||||||
|
experimentalProperties["android.experimental.kmp.enableAndroidResources"] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -44,35 +44,9 @@ kotlin {
|
|||||||
jvmTest.dependencies {
|
jvmTest.dependencies {
|
||||||
implementation(compose.desktop.currentOs)
|
implementation(compose.desktop.currentOs)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
androidMain.dependencies {
|
||||||
namespace = "ch.dissem.yaep.common.ui"
|
implementation(libs.androidx.compose.foundation)
|
||||||
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation(libs.androidx.compose.foundation)
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
minSdk = libs.versions.android.minSdk.get().toInt()
|
|
||||||
}
|
|
||||||
|
|
||||||
buildFeatures {
|
|
||||||
compose = true
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
getByName("test") {
|
|
||||||
resources.srcDirs("src/commonTest/resources")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
debug {
|
|
||||||
enableAndroidTestCoverage = true
|
|
||||||
enableUnitTestCoverage = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,11 @@ kotlin {
|
|||||||
jvmToolchain(libs.versions.jdk.get().toInt())
|
jvmToolchain(libs.versions.jdk.get().toInt())
|
||||||
|
|
||||||
jvm()
|
jvm()
|
||||||
androidTarget()
|
androidLibrary {
|
||||||
|
namespace = "ch.dissem.yaep.domain"
|
||||||
|
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
||||||
|
minSdk = libs.versions.android.minSdk.get().toInt()
|
||||||
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
commonMain.dependencies {
|
commonMain.dependencies {
|
||||||
@@ -21,25 +25,3 @@ kotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
|
||||||
namespace = "ch.dissem.yaep.domain"
|
|
||||||
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
minSdk = libs.versions.android.minSdk.get().toInt()
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
getByName("test") {
|
|
||||||
resources.srcDirs("src/commonTest/resources")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
debug {
|
|
||||||
enableAndroidTestCoverage = true
|
|
||||||
enableUnitTestCoverage = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -14,8 +14,11 @@ class SameColumnClueTest : ClueTest() {
|
|||||||
val a = grid[ia][j]
|
val a = grid[ia][j]
|
||||||
val b = grid[ib][j]
|
val b = grid[ib][j]
|
||||||
|
|
||||||
expect(SameColumnClue(a.solution!!, b.solution!!).isValid(grid)).toEqual(true)
|
a.solution!!
|
||||||
expect(SameColumnClue(b.solution!!, a.solution!!).isValid(grid)).toEqual(true)
|
b.solution!!
|
||||||
|
|
||||||
|
expect(SameColumnClue(a.solution, b.solution).isValid(grid)).toEqual(true)
|
||||||
|
expect(SameColumnClue(b.solution, a.solution).isValid(grid)).toEqual(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,8 +35,11 @@ class SameColumnClueTest : ClueTest() {
|
|||||||
val a = grid[ia][ja]
|
val a = grid[ia][ja]
|
||||||
val b = grid[ib][jb]
|
val b = grid[ib][jb]
|
||||||
|
|
||||||
expect(SameColumnClue(a.solution!!, b.solution!!).isValid(grid)).toEqual(false)
|
a.solution!!
|
||||||
expect(SameColumnClue(b.solution!!, a.solution!!).isValid(grid)).toEqual(false)
|
b.solution!!
|
||||||
|
|
||||||
|
expect(SameColumnClue(a.solution, b.solution).isValid(grid)).toEqual(false)
|
||||||
|
expect(SameColumnClue(b.solution, a.solution).isValid(grid)).toEqual(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,11 +57,14 @@ class SameColumnClueTest : ClueTest() {
|
|||||||
val a = grid[ia][ja]
|
val a = grid[ia][ja]
|
||||||
val b = grid[ib][jb]
|
val b = grid[ib][jb]
|
||||||
|
|
||||||
|
a.solution!!
|
||||||
|
b.solution!!
|
||||||
|
|
||||||
a.selection = a.solution
|
a.selection = a.solution
|
||||||
b.selection = b.solution
|
b.selection = b.solution
|
||||||
|
|
||||||
expect(SameColumnClue(a.solution!!, b.solution!!).isValid(grid)).toEqual(false)
|
expect(SameColumnClue(a.solution, b.solution).isValid(grid)).toEqual(false)
|
||||||
expect(SameColumnClue(b.solution!!, a.solution!!).isValid(grid)).toEqual(false)
|
expect(SameColumnClue(b.solution, a.solution).isValid(grid)).toEqual(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,6 +81,10 @@ class SameColumnClueTest : ClueTest() {
|
|||||||
for (i in 0 until size) {
|
for (i in 0 until size) {
|
||||||
val a = rowA[i]
|
val a = rowA[i]
|
||||||
val b = rowB[i]
|
val b = rowB[i]
|
||||||
|
|
||||||
|
a.solution!!
|
||||||
|
b.solution!!
|
||||||
|
|
||||||
rowA.forEachIndexed { index, gameCell ->
|
rowA.forEachIndexed { index, gameCell ->
|
||||||
if (index < i) {
|
if (index < i) {
|
||||||
gameCell.selection = rowA.options.filter { it != a.solution }.random()
|
gameCell.selection = rowA.options.filter { it != a.solution }.random()
|
||||||
@@ -87,8 +100,8 @@ class SameColumnClueTest : ClueTest() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(SameColumnClue(a.solution!!, b.solution!!).isValid(grid)).toEqual(false)
|
expect(SameColumnClue(a.solution, b.solution).isValid(grid)).toEqual(false)
|
||||||
expect(SameColumnClue(b.solution!!, a.solution!!).isValid(grid)).toEqual(false)
|
expect(SameColumnClue(b.solution, a.solution).isValid(grid)).toEqual(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,12 @@ class TripletClueTest : ClueTest() {
|
|||||||
val b = grid[ib][j - 1]
|
val b = grid[ib][j - 1]
|
||||||
val c = grid[ic][j]
|
val c = grid[ic][j]
|
||||||
|
|
||||||
expect(TripletClue(a.solution!!, b.solution!!, c.solution!!).isValid(grid)).toEqual(true)
|
a.solution!!
|
||||||
expect(TripletClue(c.solution!!, b.solution!!, a.solution!!).isValid(grid)).toEqual(true)
|
b.solution!!
|
||||||
|
c.solution!!
|
||||||
|
|
||||||
|
expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(true)
|
||||||
|
expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,16 +40,20 @@ class TripletClueTest : ClueTest() {
|
|||||||
val b = rowB[2]
|
val b = rowB[2]
|
||||||
val c = rowC[3]
|
val c = rowC[3]
|
||||||
|
|
||||||
|
a.solution!!
|
||||||
|
b.solution!!
|
||||||
|
c.solution!!
|
||||||
|
|
||||||
rowB[0].selection = b.solution
|
rowB[0].selection = b.solution
|
||||||
|
|
||||||
expect(TripletClue(a.solution!!, b.solution!!, c.solution!!).isValid(grid)).toEqual(false)
|
expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(false)
|
||||||
expect(TripletClue(c.solution!!, b.solution!!, a.solution!!).isValid(grid)).toEqual(false)
|
expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(false)
|
||||||
|
|
||||||
rowB[0].selection = null
|
rowB[0].selection = null
|
||||||
rowB[grid.size - 1].selection = b.solution
|
rowB[grid.size - 1].selection = b.solution
|
||||||
|
|
||||||
expect(TripletClue(a.solution!!, b.solution!!, c.solution!!).isValid(grid)).toEqual(false)
|
expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(false)
|
||||||
expect(TripletClue(c.solution!!, b.solution!!, a.solution!!).isValid(grid)).toEqual(false)
|
expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -61,10 +69,14 @@ class TripletClueTest : ClueTest() {
|
|||||||
val rowC = grid[1]
|
val rowC = grid[1]
|
||||||
val c = rowC[ic]
|
val c = rowC[ic]
|
||||||
|
|
||||||
val clue = TripletClue(a.solution!!, b.solution!!, c.solution!!)
|
a.solution!!
|
||||||
|
b.solution!!
|
||||||
|
c.solution!!
|
||||||
|
|
||||||
|
val clue = TripletClue(a.solution, b.solution, c.solution)
|
||||||
|
|
||||||
b.selection = b.solution
|
b.selection = b.solution
|
||||||
c.options.add(c.solution!!)
|
c.options.add(c.solution)
|
||||||
|
|
||||||
|
|
||||||
rowA.forEachIndexed { index, notA ->
|
rowA.forEachIndexed { index, notA ->
|
||||||
@@ -75,7 +87,7 @@ class TripletClueTest : ClueTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
index == ic -> {
|
index == ic -> {
|
||||||
rowC[ia].options.add(c.solution!!)
|
rowC[ia].options.add(c.solution)
|
||||||
expect(clue.isValid(grid)).toEqual(true)
|
expect(clue.isValid(grid)).toEqual(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,11 +106,15 @@ class TripletClueTest : ClueTest() {
|
|||||||
val b = grid[0][2]
|
val b = grid[0][2]
|
||||||
val c = grid[1][3]
|
val c = grid[1][3]
|
||||||
|
|
||||||
|
a.solution!!
|
||||||
|
b.solution!!
|
||||||
|
c.solution!!
|
||||||
|
|
||||||
a.selection = a.solution
|
a.selection = a.solution
|
||||||
grid[1][4].selection = c.solution
|
grid[1][4].selection = c.solution
|
||||||
|
|
||||||
expect(TripletClue(a.solution!!, b.solution!!, c.solution!!).isValid(grid)).toEqual(false)
|
expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(false)
|
||||||
expect(TripletClue(c.solution!!, b.solution!!, a.solution!!).isValid(grid)).toEqual(false)
|
expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -111,15 +127,19 @@ class TripletClueTest : ClueTest() {
|
|||||||
val b = rowB[2]
|
val b = rowB[2]
|
||||||
val c = rowC[1]
|
val c = rowC[1]
|
||||||
|
|
||||||
|
a.solution!!
|
||||||
|
b.solution!!
|
||||||
|
c.solution!!
|
||||||
|
|
||||||
a.selection = a.solution
|
a.selection = a.solution
|
||||||
b.options.clear()
|
b.options.clear()
|
||||||
c.options.clear()
|
c.options.clear()
|
||||||
|
|
||||||
rowB[4].options.add(b.solution!!)
|
rowB[4].options.add(b.solution)
|
||||||
rowC[5].options.add(c.solution!!)
|
rowC[5].options.add(c.solution)
|
||||||
|
|
||||||
expect(TripletClue(a.solution!!, b.solution!!, c.solution!!).isValid(grid)).toEqual(true)
|
expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(true)
|
||||||
expect(TripletClue(c.solution!!, b.solution!!, a.solution!!).isValid(grid)).toEqual(true)
|
expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -132,11 +152,15 @@ class TripletClueTest : ClueTest() {
|
|||||||
val b = rowB[2]
|
val b = rowB[2]
|
||||||
val c = rowC[1]
|
val c = rowC[1]
|
||||||
|
|
||||||
|
a.solution!!
|
||||||
|
b.solution!!
|
||||||
|
c.solution!!
|
||||||
|
|
||||||
a.selection = a.solution
|
a.selection = a.solution
|
||||||
rowB[4].selection = rowC[3].solution
|
rowB[4].selection = rowC[3].solution
|
||||||
c.selection = rowC[3].solution
|
c.selection = rowC[3].solution
|
||||||
|
|
||||||
expect(TripletClue(a.solution!!, b.solution!!, c.solution!!).isValid(grid)).toEqual(false)
|
expect(TripletClue(a.solution, b.solution, c.solution).isValid(grid)).toEqual(false)
|
||||||
expect(TripletClue(c.solution!!, b.solution!!, a.solution!!).isValid(grid)).toEqual(false)
|
expect(TripletClue(c.solution, b.solution, a.solution).isValid(grid)).toEqual(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
[versions]
|
[versions]
|
||||||
app-version-code = "1"
|
app-version-code = "1"
|
||||||
app-version-name = "1.0.0"
|
app-version-name = "1.0.0"
|
||||||
agp = "8.13.1"
|
agp = "8.13.2"
|
||||||
jdk = "21"
|
jdk = "21"
|
||||||
android-compileSdk = "36"
|
android-compileSdk = "36"
|
||||||
android-minSdk = "26"
|
android-minSdk = "26"
|
||||||
android-targetSdk = "36"
|
android-targetSdk = "36"
|
||||||
androidx-activityCompose = "1.11.0"
|
androidx-activityCompose = "1.12.2"
|
||||||
androidx-compose = "1.9.4"
|
androidx-compose = "1.10.0"
|
||||||
compose-plugin = "1.9.3"
|
compose-plugin = "1.9.3"
|
||||||
kotlin = "2.2.21"
|
kotlin = "2.3.0"
|
||||||
coreKtx = "1.17.0"
|
coreKtx = "1.17.0"
|
||||||
atrium = "1.2.0"
|
atrium = "1.2.0"
|
||||||
|
|
||||||
@@ -19,14 +19,12 @@ androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx"
|
|||||||
androidx-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "androidx-compose" }
|
androidx-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "androidx-compose" }
|
||||||
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" }
|
||||||
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-compose" }
|
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-compose" }
|
||||||
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "androidx-compose" }
|
|
||||||
androidx-compose-ui-test-android = { module = "androidx.compose.ui:ui-test-junit4-android", version.ref = "androidx-compose" }
|
|
||||||
|
|
||||||
atrium = { module = "ch.tutteli.atrium:atrium-fluent", version.ref = "atrium" }
|
atrium = { module = "ch.tutteli.atrium:atrium-fluent", version.ref = "atrium" }
|
||||||
|
|
||||||
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
|
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
|
||||||
|
|
||||||
logging-jvm = { module = "io.github.oshai:kotlin-logging-jvm", version = "7.0.13" }
|
logging-jvm = { module = "io.github.oshai:kotlin-logging-jvm", version = "7.0.14" }
|
||||||
logging-slf4j = { module = "org.slf4j:slf4j-simple", version = "2.0.17" }
|
logging-slf4j = { module = "org.slf4j:slf4j-simple", version = "2.0.17" }
|
||||||
|
|
||||||
[bundles]
|
[bundles]
|
||||||
@@ -35,11 +33,11 @@ logging = ["logging-jvm", "logging-slf4j"]
|
|||||||
[plugins]
|
[plugins]
|
||||||
versions = { id = "com.github.ben-manes.versions", version = "0.53.0" }
|
versions = { id = "com.github.ben-manes.versions", version = "0.53.0" }
|
||||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||||
android-library = { id = "com.android.library", version.ref = "agp" }
|
android-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" }
|
||||||
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
||||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||||
compose-compiler = { 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" }
|
compose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
|
||||||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||||
sonarqube = { id = "org.sonarqube", version = "7.0.1.6134" }
|
sonarqube = { id = "org.sonarqube", version = "7.2.2.6593" }
|
||||||
kotlin-kover = { id = "org.jetbrains.kotlinx.kover", version = "0.9.3" }
|
kotlin-kover = { id = "org.jetbrains.kotlinx.kover", version = "0.9.4" }
|
||||||
Reference in New Issue
Block a user