Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin to v2.1.0 #383

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/local.properties
.DS_Store
/build
.idea/
.idea/
.kotlin/
2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Please add your entries according to this format.
## Unreleased

- Add tasks `ktfmtCheckScripts` and `ktfmtFormatScripts` to check and format the `.kts` files in the project folder.
- Kotlin to 2.1.0
- Gradle to 8.12

## Version 0.21.0 _(2024-11-01)_
- KtFmt to 0.53
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ Please note that `ktfmt-gradle` relies on `ktfmt` hence the minimum supported JD

Please also note the following requirements:

* **Kotlin 1.4+**. In order to reformat Kotlin 1.4 code, you need run on **Gradle to 6.8+** (This is due to Gradle 6.7 embedding Kotlin 1.3.x - See [#12660](https://github.com/gradle/gradle/issues/12660)).

* **Android**. `ktfmt-gradle` relies on features from **Android Gradle Plugin 4.1+**. So make sure you bump AGP before applying this plugin.

### Task
Expand Down
2 changes: 1 addition & 1 deletion example/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import app.cash.sqldelight.gradle.VerifyMigrationTask
plugins {
kotlin("jvm")
id("com.ncorti.ktfmt.gradle")
id("com.google.devtools.ksp") version "2.0.21-1.0.27"
id("com.google.devtools.ksp") version "2.1.0-1.0.29"
id("app.cash.sqldelight") version "2.0.2"
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ binaryCompatibilityValidator = "0.16.3"
detekt = "1.23.7"
diffUtils = "4.15"
junit = "5.11.4"
kotlin = "2.0.21"
kotlin = "2.1.0"
ktfmt-plugin = "0.21.0"
ktfmt = "0.53"
pluginPublish = "1.3.0"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
3 changes: 1 addition & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 1 addition & 1 deletion plugin-build/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
3 changes: 1 addition & 2 deletions plugin-build/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
4 changes: 2 additions & 2 deletions plugin-build/plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ java {

kotlin {
compilerOptions {
apiVersion.set(KotlinVersion.fromVersion("1.4"))
languageVersion.set(KotlinVersion.fromVersion("1.4"))
apiVersion.set(KotlinVersion.fromVersion("1.6"))
languageVersion.set(KotlinVersion.fromVersion("1.6"))
jvmTarget = JvmTarget.JVM_11
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,7 @@ internal object KtfmtPluginUtils {
name.split(" ").joinToString("") {
val charArray = it.toCharArray()
if (charArray[0].isLowerCase()) {
// We use toUpperCase here to retain compatibility with Gradle 6.9 and Kotlin
// 1.4
@Suppress("DEPRECATION")
charArray[0] = charArray[0].toUpperCase()
charArray[0] = charArray[0].uppercaseChar()
}
charArray.concatToString()
}
Expand All @@ -144,10 +141,7 @@ internal object KtfmtPluginUtils {
name.split(" ").joinToString("") {
val charArray = it.toCharArray()
if (charArray[0].isLowerCase()) {
// We use toUpperCase here to retain compatibility with Gradle 6.9 and Kotlin
// 1.4
@Suppress("DEPRECATION")
charArray[0] = charArray[0].toUpperCase()
charArray[0] = charArray[0].uppercaseChar()
}
charArray.concatToString()
}
Expand Down
Loading