diff options
author | Sadaf Ebrahimi <sadafebrahimi@google.com> | 2023-10-11 18:14:52 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-10-11 18:14:52 +0000 |
commit | 34801040130c4f569159cba4ed3ecbd19fa7eba9 (patch) | |
tree | 6828f288804569d33125cc99634f11f71ee43553 | |
parent | 7adc4f925ee5c07558a8aba474f67af73bf0f817 (diff) | |
parent | 2c59cab21bc377e7c949a84edb0c076262b5ff3d (diff) | |
download | kotlinpoet-34801040130c4f569159cba4ed3ecbd19fa7eba9.tar.gz |
Upgrade kotlinpoet to 562b5c4a5297e85ae2727fc9f6c4e96e770d7420 am: 2ce0395b31 am: ea3cf49ba6 am: a00f60e1a9 am: 2c59cab21b
Original change: https://android-review.googlesource.com/c/platform/external/kotlinpoet/+/2781899
Change-Id: Icd4a94edcb853f280fa63061758705c6eac3611f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | .github/workflows/build.yml | 4 | ||||
-rw-r--r-- | .github/workflows/mkdocs-requirements.txt | 19 | ||||
-rw-r--r-- | .github/workflows/release.yml | 2 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | gradle/libs.versions.toml | 12 | ||||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.jar | bin | 63375 -> 63721 bytes | |||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 2 | ||||
-rwxr-xr-x | gradlew | 17 | ||||
-rw-r--r-- | interop/kotlinx-metadata/api/kotlinx-metadata.api | 4 | ||||
-rw-r--r-- | interop/kotlinx-metadata/src/main/kotlin/com/squareup/kotlinpoet/metadata/specs/JvmModifier.kt | 1 | ||||
-rw-r--r-- | kotlinpoet/api/kotlinpoet.api | 4 | ||||
-rw-r--r-- | kotlinpoet/src/main/java/com/squareup/kotlinpoet/CodeBlock.kt | 1 | ||||
-rw-r--r-- | kotlinpoet/src/main/java/com/squareup/kotlinpoet/ContextReceivable.kt | 1 | ||||
-rw-r--r-- | kotlinpoet/src/test/java/com/squareup/kotlinpoet/CodeBlockTest.kt | 13 | ||||
-rw-r--r-- | settings.gradle.kts | 2 |
15 files changed, 47 insertions, 43 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9ff4be9..0bd44d18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 @@ -37,7 +37,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure JDK uses: actions/setup-java@v3 diff --git a/.github/workflows/mkdocs-requirements.txt b/.github/workflows/mkdocs-requirements.txt index cb9f0930..213346e0 100644 --- a/.github/workflows/mkdocs-requirements.txt +++ b/.github/workflows/mkdocs-requirements.txt @@ -1,19 +1,18 @@ -click==8.1.6 +click==8.1.7 future==0.18.3 Jinja2==3.1.2 livereload==2.6.3 -lunr==0.6.2 -Markdown==3.3.7 # See https://github.com/mkdocs/mkdocs/issues/2892. +lunr==0.7.0.post1 MarkupSafe==2.1.3 -mkdocs==1.4.3 -mkdocs-macros-plugin==1.0.2 -mkdocs-material==9.1.19 -mkdocs-material-extensions==1.1.1 -Pygments==2.15.1 -pymdown-extensions==10.1 +mkdocs==1.5.3 +mkdocs-macros-plugin==1.0.4 +mkdocs-material==9.4.5 +mkdocs-material-extensions==1.2 +Pygments==2.16.1 +pymdown-extensions==10.3 python-dateutil==2.8.2 PyYAML==6.0.1 repackage==0.7.3 six==1.16.0 termcolor==2.3.0 -tornado==6.3.2 +tornado==6.3.3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe264dea..cb8950a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure JDK uses: actions/setup-java@v3 @@ -1,6 +1,6 @@ # This project was upgraded with external_updater. # Usage: tools/external_updater/updater.sh update kotlinpoet -# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md +# For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md name: "kotlinpoet" description: "A Kotlin API for generating .kt source files" @@ -13,11 +13,11 @@ third_party { type: GIT value: "https://github.com/square/kotlinpoet.git" } - version: "7ba293ecb6af9f66de19c689c4b69d8a3e20745e" + version: "562b5c4a5297e85ae2727fc9f6c4e96e770d7420" license_type: NOTICE last_upgrade_date { year: 2023 - month: 7 - day: 26 + month: 10 + day: 10 } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7e65f1f1..6bba5ebc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,22 +13,22 @@ # limitations under the License. [versions] -kotlin = "1.9.0" -kct = "0.3.1" -ksp = "1.9.0-1.0.12" +kotlin = "1.9.10" +kct = "0.3.2" +ksp = "1.9.10-1.0.13" ktlint = "0.48.2" [plugins] kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -dokka = { id = "org.jetbrains.dokka", version = "1.8.20" } +dokka = { id = "org.jetbrains.dokka", version = "1.9.0" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } -spotless = { id = "com.diffplug.spotless", version = "6.20.0" } +spotless = { id = "com.diffplug.spotless", version = "6.22.0" } mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.25.3" } kotlinBinaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.2" } [libraries] autoCommon = { module = "com.google.auto:auto-common", version = "1.2.2" } -guava = { module = "com.google.guava:guava", version = "32.1.1-jre" } +guava = { module = "com.google.guava:guava", version = "32.1.2-jre" } javapoet = "com.squareup:javapoet:1.13.0" autoService = "com.google.auto.service:auto-service-annotations:1.1.1" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar Binary files differindex 033e24c4..7f93135c 100644 --- a/gradle/wrapper/gradle-wrapper.jar +++ b/gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c747538f..8838ba97 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.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,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 @@ -152,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 @@ -201,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/interop/kotlinx-metadata/api/kotlinx-metadata.api b/interop/kotlinx-metadata/api/kotlinx-metadata.api index f780eae0..091b3030 100644 --- a/interop/kotlinx-metadata/api/kotlinx-metadata.api +++ b/interop/kotlinx-metadata/api/kotlinx-metadata.api @@ -190,10 +190,6 @@ public abstract interface class com/squareup/kotlinpoet/metadata/specs/JvmModifi public fun annotationSpec ()Lcom/squareup/kotlinpoet/AnnotationSpec; } -public final class com/squareup/kotlinpoet/metadata/specs/JvmModifier$DefaultImpls { - public static fun annotationSpec (Lcom/squareup/kotlinpoet/metadata/specs/JvmModifier;)Lcom/squareup/kotlinpoet/AnnotationSpec; -} - public final class com/squareup/kotlinpoet/metadata/specs/KmTypesKt { public static final fun isExtensionType (Lkotlinx/metadata/KmType;)Z } diff --git a/interop/kotlinx-metadata/src/main/kotlin/com/squareup/kotlinpoet/metadata/specs/JvmModifier.kt b/interop/kotlinx-metadata/src/main/kotlin/com/squareup/kotlinpoet/metadata/specs/JvmModifier.kt index 079a0e9a..f09e6add 100644 --- a/interop/kotlinx-metadata/src/main/kotlin/com/squareup/kotlinpoet/metadata/specs/JvmModifier.kt +++ b/interop/kotlinx-metadata/src/main/kotlin/com/squareup/kotlinpoet/metadata/specs/JvmModifier.kt @@ -26,7 +26,6 @@ import com.squareup.kotlinpoet.metadata.KotlinPoetMetadataPreview * This API is considered read-only and should not be implemented outside of KotlinPoet. */ @KotlinPoetMetadataPreview -@JvmDefaultWithCompatibility public interface JvmModifier { public fun annotationSpec(): AnnotationSpec? { return null diff --git a/kotlinpoet/api/kotlinpoet.api b/kotlinpoet/api/kotlinpoet.api index c9547c1f..114bd190 100644 --- a/kotlinpoet/api/kotlinpoet.api +++ b/kotlinpoet/api/kotlinpoet.api @@ -156,10 +156,6 @@ public abstract interface class com/squareup/kotlinpoet/ContextReceivable { } public abstract interface class com/squareup/kotlinpoet/ContextReceivable$Builder { - public abstract fun getContextReceiverTypes ()Ljava/util/List; -} - -public final class com/squareup/kotlinpoet/ContextReceivable$Builder$DefaultImpls { } public abstract interface annotation class com/squareup/kotlinpoet/DelicateKotlinPoetApi : java/lang/annotation/Annotation { diff --git a/kotlinpoet/src/main/java/com/squareup/kotlinpoet/CodeBlock.kt b/kotlinpoet/src/main/java/com/squareup/kotlinpoet/CodeBlock.kt index 6c8e4bba..6a99631c 100644 --- a/kotlinpoet/src/main/java/com/squareup/kotlinpoet/CodeBlock.kt +++ b/kotlinpoet/src/main/java/com/squareup/kotlinpoet/CodeBlock.kt @@ -371,6 +371,7 @@ public class CodeBlock private constructor( val format = DecimalFormatSymbols().apply { decimalSeparator = '.' groupingSeparator = '_' + minusSign = '-' } val precision = if (o is Float || o is Double) o.toString().split(".").last().length else 0 diff --git a/kotlinpoet/src/main/java/com/squareup/kotlinpoet/ContextReceivable.kt b/kotlinpoet/src/main/java/com/squareup/kotlinpoet/ContextReceivable.kt index 127c3605..929096bc 100644 --- a/kotlinpoet/src/main/java/com/squareup/kotlinpoet/ContextReceivable.kt +++ b/kotlinpoet/src/main/java/com/squareup/kotlinpoet/ContextReceivable.kt @@ -23,7 +23,6 @@ public interface ContextReceivable { public val contextReceiverTypes: List<TypeName> /** The builder analogue to [ContextReceivable] types. */ - @JvmDefaultWithCompatibility public interface Builder<out T : Builder<T>> { /** Mutable map of the current originating elements this builder contains. */ diff --git a/kotlinpoet/src/test/java/com/squareup/kotlinpoet/CodeBlockTest.kt b/kotlinpoet/src/test/java/com/squareup/kotlinpoet/CodeBlockTest.kt index dc52f38e..be4e62dd 100644 --- a/kotlinpoet/src/test/java/com/squareup/kotlinpoet/CodeBlockTest.kt +++ b/kotlinpoet/src/test/java/com/squareup/kotlinpoet/CodeBlockTest.kt @@ -17,6 +17,7 @@ package com.squareup.kotlinpoet import com.google.common.truth.Truth.assertThat import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy +import java.util.Locale import kotlin.test.Test class CodeBlockTest { @@ -627,4 +628,16 @@ class CodeBlockTest { assertThat(CodeBlock.of("%S", 10000.12345678901).toString()).isEqualTo("\"10000.12345678901\"") assertThat(CodeBlock.of("%S", 1281.toShort()).toString()).isEqualTo("\"1281\"") } + + // https://github.com/square/kotlinpoet/issues/1657 + @Test fun minusSignInSwedishLocale() { + val defaultLocale = Locale.getDefault() + Locale.setDefault(Locale.forLanguageTag("sv")) + + val i = -42 + val s = CodeBlock.of("val i = %L", i) + assertThat(s.toString()).isEqualTo("val i = -42") + + Locale.setDefault(defaultLocale) + } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 4aefa8ec..465f238c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -21,7 +21,7 @@ pluginManagement { } plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version("0.6.0") + id("org.gradle.toolchains.foojay-resolver-convention") version("0.7.0") } include( |