diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d6a4c3..f823193 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,12 +14,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: gradle/wrapper-validation-action@v1 + - uses: gradle/wrapper-validation-action@v2 - uses: actions/setup-java@v4 with: distribution: adopt java-version: 17 - - uses: gradle/gradle-build-action@v2 + - uses: gradle/gradle-build-action@v3 with: arguments: lint cache-read-only: true @@ -28,11 +28,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: gradle/wrapper-validation-action@v1 + - uses: gradle/wrapper-validation-action@v2 - uses: actions/setup-java@v4 with: distribution: adopt java-version: 17 - - uses: gradle/gradle-build-action@v2 + - uses: gradle/gradle-build-action@v3 with: arguments: check -xlint diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bcfacfb..8beefc9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: version: ${{ steps.semver.outputs.version }} steps: - uses: actions/checkout@v4 - - uses: gradle/wrapper-validation-action@v1 + - uses: gradle/wrapper-validation-action@v2 - uses: actions/setup-java@v4 with: distribution: adopt @@ -20,7 +20,7 @@ jobs: with: versioning: ${{ github.ref }} id: semver - - uses: gradle/gradle-build-action@v2 + - uses: gradle/gradle-build-action@v3 env: ORG_GRADLE_PROJECT_version: ${{ steps.semver.outputs.version }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.NEXUS_PASSWORD }} diff --git a/compose/src/main/kotlin/xyz/tynn/astring/compose/Spanned.kt b/compose/src/main/kotlin/xyz/tynn/astring/compose/Spanned.kt index 501bb44..26f89aa 100644 --- a/compose/src/main/kotlin/xyz/tynn/astring/compose/Spanned.kt +++ b/compose/src/main/kotlin/xyz/tynn/astring/compose/Spanned.kt @@ -47,7 +47,6 @@ import androidx.compose.ui.text.ParagraphStyle import androidx.compose.ui.text.SpanStyle import androidx.compose.ui.text.UrlAnnotation import androidx.compose.ui.text.VerbatimTtsAnnotation -import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontFamily.Companion.Cursive import androidx.compose.ui.text.font.FontFamily.Companion.Default @@ -62,6 +61,7 @@ import androidx.compose.ui.text.intl.LocaleList import androidx.compose.ui.text.style.BaselineShift.Companion.Subscript import androidx.compose.ui.text.style.BaselineShift.Companion.Superscript import androidx.compose.ui.text.style.TextAlign.Companion.Center +import androidx.compose.ui.text.style.TextAlign.Companion.Unspecified import androidx.compose.ui.text.style.TextDecoration.Companion.LineThrough import androidx.compose.ui.text.style.TextDecoration.Companion.Underline import androidx.compose.ui.text.style.TextGeometricTransform @@ -113,9 +113,9 @@ private fun Any.toParagraphStyle() = when (this) { is AlignmentSpan -> ParagraphStyle( textAlign = when (alignment) { ALIGN_CENTER -> Center - ALIGN_NORMAL -> null - ALIGN_OPPOSITE -> null - else -> null + ALIGN_NORMAL -> Unspecified + ALIGN_OPPOSITE -> Unspecified + else -> Unspecified }, ) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ab9b1c5..a9a8aef 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] -android = "8.2.2" -compose-compiler = "1.5.8" -kotlin = "1.9.22" +android = "8.3.0" +compose-compiler = "1.5.10" +kotlin = "1.9.23" [plugins] android = { id = "com.android.library", version.ref = "android" } @@ -9,13 +9,13 @@ android-app = { id = "com.android.application", version.ref = "android" } conventions = "xyz.tynn.convention.project:0.0.5" kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } -paparazzi = "app.cash.paparazzi:1.3.1" +paparazzi = "app.cash.paparazzi:1.3.3" publish = "io.github.gradle-nexus.publish-plugin:1.3.0" [libraries] androidx-activity-compose = "androidx.activity:activity-compose:1.8.2" androidx-appcompat = "androidx.appcompat:appcompat:1.6.1" -androidx-compose-bom = "androidx.compose:compose-bom:2023.10.01" +androidx-compose-bom = "androidx.compose:compose-bom:2024.02.02" androidx-compose-material.module = "androidx.compose.material:material" androidx-compose-ui.module = "androidx.compose.ui:ui" androidx-compose-ui-preview.module = "androidx.compose.ui:ui-tooling-preview" @@ -33,9 +33,9 @@ google-material = "com.google.android.material:material:1.11.0" junit = "junit:junit:4.13.2" kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" } kotlin-test.module = "org.jetbrains.kotlin:kotlin-test-junit" -mockk = "io.mockk:mockk:1.13.9" +mockk = "io.mockk:mockk:1.13.10" robolectric = "org.robolectric:robolectric:4.11.1" -slf4j = "org.slf4j:slf4j-nop:2.0.11" +slf4j = "org.slf4j:slf4j-nop:2.0.12" [bundles] compose = ["androidx-activity-compose", "androidx-compose-ui-preview", "androidx-compose-material"] diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135..d64cd49 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 e6aba25..2ea3535 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.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0adc8e1..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85..7101f8e 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 diff --git a/integration/compose/build.gradle b/integration/compose/build.gradle index af84fb1..ca70016 100644 --- a/integration/compose/build.gradle +++ b/integration/compose/build.gradle @@ -37,3 +37,14 @@ dependencies { androidTestImplementation libs.androidx.compose.ui.test androidTestImplementation libs.bundles.testing.android } + +afterEvaluate { + dependencies.constraints.testImplementation 'com.google.guava:guava', { + attributes { + attribute( + TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, + objects.named(TargetJvmEnvironment, TargetJvmEnvironment.STANDARD_JVM) + ) + } + } +} diff --git a/integration/compose/src/test/snapshots/images/xyz.tynn.astring.integration.compose_ComposeWidgetTest_screenshotComposeWidget.png b/integration/compose/src/test/snapshots/images/xyz.tynn.astring.integration.compose_ComposeWidgetTest_screenshotComposeWidget.png index 25aac38..24172a0 100644 Binary files a/integration/compose/src/test/snapshots/images/xyz.tynn.astring.integration.compose_ComposeWidgetTest_screenshotComposeWidget.png and b/integration/compose/src/test/snapshots/images/xyz.tynn.astring.integration.compose_ComposeWidgetTest_screenshotComposeWidget.png differ