Skip to content

Commit

Permalink
Pointing Gradle deps to use latest stable version of ktfmt
Browse files Browse the repository at this point in the history
Summary:
Right now things are broken as is since we don't update snapshot versions of ktfmt to maven.

My proposal is to use the latest available stable version when compiling them.
Likely not optimal, but at least should reduce the curernt amount of headaches.

Issues:
```
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileKotlin'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find com.facebook:ktfmt:0.49-SNAPSHOT.
```
and
```
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find com.facebook:ktfmt:0.49.
```

Reviewed By: cortinico

Differential Revision: D56472377

fbshipit-source-id: 509620821be40353c10e41f72670de5567792915
  • Loading branch information
Nivaldo Bondança authored and facebook-github-bot committed Apr 23, 2024
1 parent 4211ac2 commit 54dfc1a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
11 changes: 6 additions & 5 deletions ktfmt_idea_plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ plugins {
id("com.diffplug.spotless") version "5.10.2"
}

val ktfmtVersion = rootProject.file("../version.txt").readText().trim().replace("-SNAPSHOT", "")
val currentKtfmtVersion = rootProject.file("../version.txt").readText().trim()
val stableKtfmtVersion = rootProject.file("../stable_version.txt").readText().trim()
val pluginVersion = "1.1"

group = "com.facebook"

version = "$pluginVersion.$ktfmtVersion"
version = "$pluginVersion.$currentKtfmtVersion"

repositories {
mavenCentral()
Expand All @@ -38,8 +39,8 @@ java {
}

dependencies {
implementation("com.facebook", "ktfmt", ktfmtVersion)
implementation("com.google.googlejavaformat", "google-java-format", "1.8")
implementation("com.facebook", "ktfmt", stableKtfmtVersion)
implementation("com.google.googlejavaformat", "google-java-format", "1.22.0")
}

// See https://github.com/JetBrains/gradle-intellij-plugin/
Expand All @@ -59,4 +60,4 @@ tasks {
runPluginVerifier { ideVersions.set(listOf("221")) }
}

spotless { java { googleJavaFormat("1.21.0") } }
spotless { java { googleJavaFormat("1.22.0") } }
2 changes: 1 addition & 1 deletion ktfmt_idea_plugin/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.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion online_formatter/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repositories {
mavenCentral()
}

val ktfmtVersion = rootProject.file("../version.txt").readText().trim()
val ktfmtVersion = rootProject.file("../stable_version.txt").readText().trim()

dependencies {
implementation("com.facebook:ktfmt:$ktfmtVersion")
Expand Down
2 changes: 2 additions & 0 deletions online_formatter/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions stable_version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.48

0 comments on commit 54dfc1a

Please sign in to comment.