Skip to content

Commit

Permalink
Just remove the lyricist processor as it always caused issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Oct 25, 2024
1 parent e7e29f5 commit f3e0d96
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 32 deletions.
45 changes: 23 additions & 22 deletions app/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ kotlin {
}

dependencies {
kspCommonMainMetadata(libs.lyricist.processor)
// This is buggy * ios 18
// kspCommonMainMetadata(libs.lyricist.processor)
"desktopMainImplementation"(libs.kord.common) {
exclude(group = "io.ktor")
}
Expand All @@ -121,24 +122,24 @@ android {
}
}

tasks {
afterEvaluate {
val compilationTasks = kotlin.targets.flatMap {
buildList {
if (it.name != "android") {
add("compileKotlin${it.name.replaceFirstChar { it.titlecase() }}")
val sourcesJarName = "${it.name}SourcesJar"
add(sourcesJarName)
} else {
add("compileDebugKotlinAndroid")
add("compileReleaseKotlinAndroid")
}
}
}
for (task in compilationTasks) {
named(task) {
dependsOn("kspCommonMainKotlinMetadata")
}
}
}
}
//tasks {
// afterEvaluate {
// val compilationTasks = kotlin.targets.flatMap {
// buildList {
// if (it.name != "android") {
// add("compileKotlin${it.name.replaceFirstChar { it.titlecase() }}")
// val sourcesJarName = "${it.name}SourcesJar"
// add(sourcesJarName)
// } else {
// add("compileDebugKotlinAndroid")
// add("compileReleaseKotlinAndroid")
// }
// }
// }
// for (task in compilationTasks) {
// named(task) {
// dependsOn("kspCommonMainKotlinMetadata")
// }
// }
// }
//}
38 changes: 38 additions & 0 deletions app/shared/src/commonMain/kotlin/Strings.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package dev.schlaubi.tonbrett.app

import androidx.compose.runtime.Composable
import androidx.compose.runtime.ProvidableCompositionLocal
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.text.intl.Locale
import cafe.adriel.lyricist.Lyricist
import cafe.adriel.lyricist.LanguageTag
import cafe.adriel.lyricist.rememberStrings
import cafe.adriel.lyricist.ProvideStrings
import dev.schlaubi.tonbrett.app.strings.DeStrings
import dev.schlaubi.tonbrett.app.strings.EnStrings
import dev.schlaubi.tonbrett.app.strings.Strings

public val Strings: Map<LanguageTag, Strings> = mapOf(
"de" to DeStrings,
"en" to EnStrings
)

public val LocalStrings: ProvidableCompositionLocal<Strings> =
staticCompositionLocalOf { EnStrings }



@Composable
public fun rememberStrings(
defaultLanguageTag: LanguageTag = "en",
currentLanguageTag: LanguageTag = Locale.current.toLanguageTag(),
): Lyricist<Strings> =
rememberStrings(Strings, defaultLanguageTag, currentLanguageTag)

@Composable
public fun ProvideStrings(
lyricist: Lyricist<Strings> = rememberStrings(),
content: @Composable () -> Unit
) {
ProvideStrings(lyricist, LocalStrings, content)
}
3 changes: 0 additions & 3 deletions app/shared/src/commonMain/kotlin/TonbrettApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import cafe.adriel.lyricist.LocalStrings
import cafe.adriel.lyricist.ProvideStrings
import cafe.adriel.lyricist.rememberStrings
import dev.schlaubi.tonbrett.app.api.IO
import dev.schlaubi.tonbrett.app.api.LocalContext
import dev.schlaubi.tonbrett.app.components.ErrorText
Expand Down
2 changes: 1 addition & 1 deletion app/shared/src/commonMain/kotlin/components/SearchBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import androidx.compose.ui.draw.rotate
import androidx.compose.ui.input.key.*
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp
import cafe.adriel.lyricist.LocalStrings
import dev.schlaubi.tonbrett.app.ColorScheme
import dev.schlaubi.tonbrett.app.LocalStrings
import dev.schlaubi.tonbrett.app.api.IO
import dev.schlaubi.tonbrett.app.api.LocalContext
import dev.schlaubi.tonbrett.common.SoundGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.unit.dp
import cafe.adriel.lyricist.LocalStrings
import dev.schlaubi.tonbrett.app.ColorScheme
import dev.schlaubi.tonbrett.app.LocalStrings
import dev.schlaubi.tonbrett.app.api.LocalContext
import dev.schlaubi.tonbrett.app.util.conditional
import kotlinx.coroutines.flow.launchIn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.zIndex
import cafe.adriel.lyricist.LocalStrings
import dev.schlaubi.tonbrett.app.ColorScheme
import dev.schlaubi.tonbrett.app.ErrorReporter
import dev.schlaubi.tonbrett.app.LocalStrings
import dev.schlaubi.tonbrett.app.OptionalWebImage
import dev.schlaubi.tonbrett.app.api.IO
import dev.schlaubi.tonbrett.app.api.LocalContext
Expand Down
2 changes: 1 addition & 1 deletion app/shared/src/commonMain/kotlin/components/SoundList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import cafe.adriel.lyricist.LocalStrings
import dev.schlaubi.tonbrett.app.ErrorReporter
import dev.schlaubi.tonbrett.app.LocalStrings
import dev.schlaubi.tonbrett.app.api.IO
import dev.schlaubi.tonbrett.app.api.LocalContext
import dev.schlaubi.tonbrett.common.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dev.schlaubi.tonbrett.app.components
import androidx.compose.foundation.ContextMenuArea
import androidx.compose.foundation.ContextMenuItem
import androidx.compose.runtime.Composable
import cafe.adriel.lyricist.LocalStrings
import dev.schlaubi.tonbrett.app.LocalStrings
import dev.schlaubi.tonbrett.app.api.LocalContext
import dev.schlaubi.tonbrett.common.Id
import dev.schlaubi.tonbrett.common.Route
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import cafe.adriel.lyricist.LocalStrings
import dev.schlaubi.tonbrett.app.api.LocalContext
import dev.schlaubi.tonbrett.app.api.MobileAppContext
import dev.schlaubi.tonbrett.app.api.getUrl
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {

allprojects {
group = "dev.schlaubi.tonbrett"
version = "1.22.6"
version = "1.22.7"

repositories {
mavenCentral()
Expand Down

0 comments on commit f3e0d96

Please sign in to comment.