Repository: cortinico/ktfmt-gradle
Pull request #53 (2022-02-19 14:15:04)

Update kotlin to 1.5.31 and Gradle to 7.4 and ktfmt to 0.32
## 🚀 Description
Cherry picking the first part of #52

## 📄 Motivation and Context
Let's do one release with just Kotlin 1.5 and postpone the bump to Kotlin 1.6 in a subsequent build.

## 🧪 How Has This Been Tested?
Build is green locally. Waiting for a CI result.

## 📦 Types of changes
- [x] New feature (non-breaking change which adds functionality)


Patch:
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
deleted file mode 100644
index 797acea..0000000
--- a/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="RunConfigurationProducerService">
-    <option name="ignoredProducers">
-      <set>
-        <option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
-      </set>
-    </option>
-  </component>
-</project>
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8890154..8d15676 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,9 @@ Please add your entries according to this format.
 
 ## Unreleased
 
-- KtFmt to 0.30
+- KtFmt to 0.32
+- Kotlin to 1.5.31
+- Gradle to 7.4
 
 ## Version 0.7.0 *(2021-08-30)*
 
diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt
index 30ab4e7..7b09ab7 100644
--- a/buildSrc/src/main/java/Dependencies.kt
+++ b/buildSrc/src/main/java/Dependencies.kt
@@ -4,7 +4,7 @@ object Versions {
 
 object BuildPluginsVersion {
     const val DETEKT = "1.17.0"
-    const val KOTLIN = "1.5.21"
+    const val KOTLIN = "1.5.31"
     const val VERSIONS_PLUGIN = "0.38.0"
 }
 
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index a0f7639..b1159fc 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/plugin-build/buildSrc/src/main/java/Dependencies.kt b/plugin-build/buildSrc/src/main/java/Dependencies.kt
index 1dd4b5d..7f012f6 100644
--- a/plugin-build/buildSrc/src/main/java/Dependencies.kt
+++ b/plugin-build/buildSrc/src/main/java/Dependencies.kt
@@ -3,14 +3,14 @@ object Versions {
     const val COROUTINES = "1.5.1"
     const val DIFF_UTIL = "4.9"
     const val JUPITER = "5.7.2"
-    const val KTFMT = "0.30"
+    const val KTFMT = "0.32"
     const val TRUTH = "1.1.3"
 }
 
 object BuildPluginsVersion {
     const val BINARY_COMPATIBILITY_VALIDATOR = "0.7.1"
     const val DETEKT = "1.17.0"
-    const val KOTLIN = "1.5.21"
+    const val KOTLIN = "1.5.31"
     const val KTFMT = "0.7.0"
     const val PLUGIN_PUBLISH = "0.14.0"
     const val VERSIONS_PLUGIN = "0.39.0"
diff --git a/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/FormattingOptionsBean.kt b/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/FormattingOptionsBean.kt
index 28e8723..4aed391 100644
--- a/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/FormattingOptionsBean.kt
+++ b/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/FormattingOptionsBean.kt
@@ -1,8 +1,8 @@
 package com.ncorti.ktfmt.gradle
 
-import com.facebook.ktfmt.DEFAULT_MAX_WIDTH
-import com.facebook.ktfmt.FormattingOptions
-import com.facebook.ktfmt.FormattingOptions.Style as KtfmtStyle
+import com.facebook.ktfmt.format.FormattingOptions
+import com.facebook.ktfmt.format.FormattingOptions.Companion.DEFAULT_MAX_WIDTH
+import com.facebook.ktfmt.format.FormattingOptions.Style as KtfmtStyle
 import java.io.Serializable
 
 internal data class FormattingOptionsBean(
diff --git a/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/tasks/KtfmtBaseTask.kt b/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/tasks/KtfmtBaseTask.kt
index a624310..c30dee3 100644
--- a/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/tasks/KtfmtBaseTask.kt
+++ b/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/tasks/KtfmtBaseTask.kt
@@ -1,7 +1,7 @@
 package com.ncorti.ktfmt.gradle.tasks
 
-import com.facebook.ktfmt.ParseError
-import com.facebook.ktfmt.format
+import com.facebook.ktfmt.format.Formatter.format
+import com.facebook.ktfmt.format.ParseError
 import com.google.common.annotations.VisibleForTesting
 import com.google.googlejavaformat.FormattingError
 import com.ncorti.ktfmt.gradle.FormattingOptionsBean


Test patch:
diff --git a/plugin-build/plugin/src/test/java/com/ncorti/ktfmt/gradle/tasks/KtfmtBaseTaskTest.kt b/plugin-build/plugin/src/test/java/com/ncorti/ktfmt/gradle/tasks/KtfmtBaseTaskTest.kt
index 3c1eaca..9444b61 100644
--- a/plugin-build/plugin/src/test/java/com/ncorti/ktfmt/gradle/tasks/KtfmtBaseTaskTest.kt
+++ b/plugin-build/plugin/src/test/java/com/ncorti/ktfmt/gradle/tasks/KtfmtBaseTaskTest.kt
@@ -1,6 +1,6 @@
 package com.ncorti.ktfmt.gradle.tasks
 
-import com.facebook.ktfmt.ParseError
+import com.facebook.ktfmt.format.ParseError
 import com.google.common.truth.Truth.assertThat
 import java.io.File
 import kotlinx.coroutines.runBlocking
diff --git a/plugin-build/plugin/src/test/resources/jvmProject/build.gradle.kts b/plugin-build/plugin/src/test/resources/jvmProject/build.gradle.kts
index 0ec15d9..ec178e6 100644
--- a/plugin-build/plugin/src/test/resources/jvmProject/build.gradle.kts
+++ b/plugin-build/plugin/src/test/resources/jvmProject/build.gradle.kts
@@ -1,5 +1,5 @@
 plugins {
-    kotlin("jvm") version "1.5.21"
+    kotlin("jvm") version "1.5.31"
     id("com.ncorti.ktfmt.gradle")
 }