Remove TOML catagog file & clean warning.

Expect that fucking rootProject.exec in gradle.
This commit is contained in:
Thomas Andres Gomez 2025-10-08 22:55:55 +02:00
parent 1a73795615
commit 4944f06e91
16 changed files with 78 additions and 253 deletions

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
<SelectionState runConfigName="EventFactoryText">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
<SelectionState runConfigName="EventEditPreview">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
<SelectionState runConfigName="YearPreview">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
<SelectionState runConfigName="ReportBoxPreview">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

1
.idea/misc.xml generated
View file

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">

View file

@ -1,12 +1,15 @@
import com.android.build.api.dsl.SigningConfig
import org.apache.commons.io.output.ByteArrayOutputStream
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.nio.charset.Charset
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.jetbrains.kotlin.serialization)
alias(libs.plugins.hilt)
alias(libs.plugins.ksp)
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.kotlin.plugin.serialization")
id("com.google.dagger.hilt.android")
id("com.google.devtools.ksp")
}
android {
@ -14,13 +17,7 @@ android {
compileSdk = 36
signingConfigs {
create("pixelized") {
storeFile =
(project.properties["PIXELIZED_RELEASE_STORE_FILE"] as? String)?.let { file(it) }
storePassword = project.properties["PIXELIZED_RELEASE_STORE_PASSWORD"] as? String
keyAlias = project.properties["PIXELIZED_RELEASE_KEY_ALIAS"] as? String
keyPassword = project.properties["PIXELIZED_RELEASE_KEY_PASSWORD"] as? String
}
create("pixelized") { populatePixelizedSigningConfig() }
}
defaultConfig {
@ -59,14 +56,18 @@ android {
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = listOf("-XXLanguage:+PropertyParamAnnotationDefaultTargetMode")
kotlin {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
compilerOptions {
jvmTarget = JvmTarget.JVM_11
freeCompilerArgs = listOf("-XXLanguage:+PropertyParamAnnotationDefaultTargetMode")
}
}
buildFeatures {
compose = true
}
@ -74,50 +75,56 @@ android {
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.material3.windowsizeclass)
implementation(libs.androidx.adaptive.layout)
implementation(libs.androidx.material3.navigation3)
// Android
implementation("androidx.core:core-ktx:1.17.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.9.4")
implementation("androidx.activity:activity-compose:1.11.0")
implementation("androidx.compose.ui:ui:1.9.3")
implementation("androidx.compose.ui:ui-graphics:1.9.3")
implementation("androidx.compose.ui:ui-tooling:1.9.3")
implementation("androidx.compose.ui:ui-tooling-preview:1.9.3")
implementation(libs.androidx.datastore)
implementation(libs.kotlinx.serialization.core)
implementation(libs.kotlinx.serialization.json)
implementation(libs.androidx.navigation3.runtime)
implementation(libs.androidx.navigation3.ui)
implementation(libs.androidx.hilt.navigation.compose)
implementation(libs.androidx.lifecycle.viewmodel.navigation3)
implementation(libs.androidx.material.icons.extended)
// Material
implementation("androidx.compose.material3:material3:1.4.0")
implementation("androidx.compose.material:material-icons-extended:1.7.8")
implementation("androidx.compose.material3:material3-window-size-class:1.4.0")
implementation("androidx.compose.material3.adaptive:adaptive-layout:1.1.0")
implementation(libs.hilt.android)
ksp(libs.hilt.compiler)
// Navigation
implementation("androidx.navigation3:navigation3-runtime:1.0.0-alpha11")
implementation("androidx.navigation3:navigation3-ui:1.0.0-alpha11")
implementation("androidx.compose.material3.adaptive:adaptive-navigation3:1.0.0-SNAPSHOT")
implementation("androidx.lifecycle:lifecycle-viewmodel-navigation3:1.0.0-SNAPSHOT")
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
// Preferences
implementation("androidx.datastore:datastore-preferences:1.1.7")
// Json
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0")
// Injection
implementation("androidx.hilt:hilt-navigation-compose:1.3.0")
implementation("com.google.dagger:hilt-android:2.57.2")
ksp("com.google.dagger:hilt-compiler:2.57.2")
}
@Suppress("DEPRECATION")
private fun getGitBuildNumber(
charset: Charset = Charset.defaultCharset(),
): Int {
return try {
val stdout = org.apache.commons.io.output.ByteArrayOutputStream()
return ByteArrayOutputStream().use { stream ->
rootProject.exec {
commandLine("git", "rev-list", "--count", "HEAD")
standardOutput = stdout
standardOutput = stream
}
stdout.toString(charset).trim().toInt()
} catch (_: Exception) {
1
stream.toString(charset).trim().toIntOrNull() ?: 1
}
}
fun SigningConfig.populatePixelizedSigningConfig() {
storeFile = (project.properties["PIXELIZED_RELEASE_STORE_FILE"] as? String)?.let { file(it) }
storePassword = project.properties["PIXELIZED_RELEASE_STORE_PASSWORD"] as? String
keyAlias = project.properties["PIXELIZED_RELEASE_KEY_ALIAS"] as? String
keyPassword = project.properties["PIXELIZED_RELEASE_KEY_PASSWORD"] as? String
}

View file

@ -14,6 +14,7 @@ import androidx.core.content.ContextCompat
import com.pixelized.headache.ui.navigation.home.HomeNavigator
import com.pixelized.headache.ui.navigation.main.MainNavigator
import com.pixelized.headache.ui.page.MainPage
import com.pixelized.headache.ui.page.calendar.CalendarChooserPage
import com.pixelized.headache.ui.theme.HeadacheTheme
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
@ -50,6 +51,7 @@ class MainActivity : ComponentActivity() {
setContent {
HeadacheTheme {
Surface {
// CalendarChooserPage()
MainPage(
mainNavigator = mainNavigator,
homeNavigator = homeNavigator,

View file

@ -1,7 +1,7 @@
package com.pixelized.headache.ui.navigation.destination
import android.icu.util.Calendar
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.navigation3.runtime.EntryProviderBuilder
import androidx.navigation3.runtime.entry
import com.pixelized.headache.repository.event.Event

View file

@ -19,7 +19,7 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.pixelized.headache.R
import com.pixelized.headache.ui.common.toolbar.Toolbar

View file

@ -37,7 +37,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import com.pixelized.headache.R
import com.pixelized.headache.ui.common.error.HandleErrorMessage
import com.pixelized.headache.ui.theme.HeadacheTheme

View file

@ -35,7 +35,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.pixelized.headache.R
import com.pixelized.headache.ui.common.toolbar.Toolbar

View file

@ -41,7 +41,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.pixelized.headache.R
import com.pixelized.headache.ui.common.toolbar.Toolbar

View file

@ -28,7 +28,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.pixelized.headache.ui.navigation.destination.navigateToEventPage
import com.pixelized.headache.ui.navigation.main.LocalMainNavigator

View file

@ -29,7 +29,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.pixelized.headache.ui.navigation.destination.navigateToEventPage
import com.pixelized.headache.ui.navigation.main.LocalMainNavigator

View file

@ -31,7 +31,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.pixelized.headache.ui.navigation.destination.navigateToEventPage
import com.pixelized.headache.ui.navigation.main.LocalMainNavigator

View file

@ -1,92 +0,0 @@
package com.pixelized.headache
import com.pixelized.headache.repository.event.factory.PillFactory
import org.junit.Test
class EventFactoryTest {
private val factory = PillFactory()
@Test
fun testPill() {
test(
pill = "Spifen 400",
expectedLabel = "Spifen 400",
expectedAmount = 1,
expectedIsValid = true,
expectedIsMisspelled = false,
)
}
@Test
fun testMisspelledPill() {
test(
pill = "Spifen",
expectedLabel = "Spifen 400",
expectedAmount = 1,
expectedIsValid = true,
expectedIsMisspelled = true,
)
}
@Test
fun testUnknownPill() {
test(
pill = "Spife",
expectedLabel = "?",
expectedAmount = 1,
expectedIsValid = false,
expectedIsMisspelled = false,
)
}
@Test
fun test2Pills_1() {
test(
pill = "Spifen 400 x2",
expectedLabel = "Spifen 400",
expectedAmount = 2,
expectedIsValid = true,
expectedIsMisspelled = false,
)
}
@Test
fun test2Pills_2() {
test(
pill = "Spifen 400 x 2",
expectedLabel = "Spifen 400",
expectedAmount = 2,
expectedIsValid = true,
expectedIsMisspelled = false,
)
}
@Test
fun text2Pills_3() {
test(
pill = "Ibuprofene 400 Extra x2",
expectedLabel = "Ibuprofène 400",
expectedAmount = 2,
expectedIsValid = true,
expectedIsMisspelled = true,
)
}
fun test(
pill: String,
expectedLabel: String,
expectedAmount: Int,
expectedIsValid: Boolean,
expectedIsMisspelled: Boolean,
) {
factory.parsePill(
pill = pill,
).let {
assert(it.label == expectedLabel) { "Label error - Expected:\"$expectedLabel\" but was:\"${it.label}\"" }
assert(it.amount == expectedAmount) { "Amount error - Expected:\"$expectedAmount\" but was:\"${it.amount}\"" }
assert(it.description == pill) { "Description error - Expected:\"$pill\" but was:\"${it.description}\"" }
assert(it.isValid == expectedIsValid) { "isValid error - Expected:\"$expectedIsValid\" but was:\"${it.isValid}\"" }
assert(it.isMisspelled == expectedIsMisspelled) { "isMisspelled error - Expected:\"$expectedIsMisspelled\" but was:\"${it.isMisspelled}\"" }
}
}
}

View file

@ -1,8 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.hilt) apply false
id("com.android.application") version "8.13.0" apply false
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
id("org.jetbrains.kotlin.plugin.compose") version "2.2.20" apply false
id("org.jetbrains.kotlin.plugin.serialization") version "2.2.20" apply false
id("com.google.devtools.ksp") version "2.2.20-2.0.3" apply false
id("com.google.dagger.hilt.android") version "2.57.2" apply false
}

View file

@ -1,71 +0,0 @@
# Copyright 2025 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
[versions]
agp = "8.13.0"
kotlin = "2.2.0"
kotlinSerialization = "2.2.0"
coreKtx = "1.16.0"
junit = "4.13.2"
junitVersion = "1.3.0"
espressoCore = "3.7.0"
kotlinxSerializationCore = "1.9.0"
lifecycleRuntimeKtx = "2.9.2"
lifecycleViewmodel = "1.0.0-SNAPSHOT"
activityCompose = "1.12.0-alpha05"
composeBom = "2025.07.01"
navigation3 = "1.0.0-alpha07"
material3 = "1.4.0-beta01"
nav3Material = "1.0.0-SNAPSHOT"
ksp = "2.2.0-2.0.2"
hilt = "2.57"
hiltNavigationCompose = "1.2.0"
datastore = "1.1.7"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
androidx-datastore = { module = "androidx.datastore:datastore-preferences", version.ref = "datastore" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom-alpha", version.ref = "composeBom" }
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" }
androidx-material3-windowsizeclass = { group = "androidx.compose.material3", name = "material3-window-size-class", version.ref = "material3" }
androidx-adaptive-layout = { group = "androidx.compose.material3.adaptive", name = "adaptive-layout" }
androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "hiltNavigationCompose" }
androidx-lifecycle-viewmodel-navigation3 = { module = "androidx.lifecycle:lifecycle-viewmodel-navigation3", version.ref = "lifecycleViewmodel" }
androidx-navigation3-runtime = { module = "androidx.navigation3:navigation3-runtime", version.ref = "navigation3" }
androidx-navigation3-ui = { module = "androidx.navigation3:navigation3-ui", version.ref = "navigation3" }
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinxSerializationCore" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationCore" }
androidx-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended" }
androidx-material3-navigation3 = { group = "androidx.compose.material3.adaptive", name = "adaptive-navigation3", version.ref = "nav3Material" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
jetbrains-kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlinSerialization"}
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }

View file

@ -14,6 +14,7 @@ pluginManagement {
}
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {