Skip to content
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
29 changes: 3 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,14 @@ equoIde {
welcome().openUrl('https://github.com/diffplug/spotless/blob/main/CONTRIBUTING.md')
gradleBuildship().autoImport('.')
}

repositories {
mavenCentral()
}

apply from: rootProject.file('gradle/java-publish.gradle')
apply from: rootProject.file('gradle/changelog.gradle')
allprojects {
apply from: rootProject.file('gradle/error-prone.gradle')
apply from: rootProject.file('gradle/rewrite.gradle')
Comment thread
nedtwigg marked this conversation as resolved.
apply from: rootProject.file('gradle/spotless.gradle')
}
apply from: rootProject.file('gradle/changelog.gradle')
apply from: rootProject.file('gradle/java-publish.gradle')
apply from: rootProject.file('gradle/rewrite.gradle')
apply from: rootProject.file('gradle/spotless-freshmark.gradle')
Comment on lines -11 to 19

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • before: java-publish, then changelog, then allprojects
  • after: allprojects, then changelog, then java-publish

That's a risky change. I think they depend on each other, but it takes time to confirm, and we won't notice it's broken until a publish fails. Try to make your PR's more focused on a single change and they are easier to merge.


spotless {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this possible to move and merge with the dedicated project config?

or do we need this to be divided?

groovyGradle {
target '*.gradle', 'gradle/*.gradle'
}
format 'dotfiles', {
target '.gitignore', '.gitattributes', '.editorconfig'
leadingTabsToSpaces(2)
trimTrailingWhitespace()
endWithNewline()
}
}

dependencies {
rewrite(platform('org.openrewrite.recipe:rewrite-recipe-bom:3.16.0'))
rewrite('org.openrewrite.recipe:rewrite-migrate-java:3.19.0')
rewrite('org.openrewrite.recipe:rewrite-java-security:3.19.2')
rewrite('org.openrewrite.recipe:rewrite-rewrite:0.14.0')
rewrite('org.openrewrite.recipe:rewrite-static-analysis:2.19.0')
rewrite('org.openrewrite.recipe:rewrite-third-party:0.29.0')
}
9 changes: 8 additions & 1 deletion gradle/rewrite.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apply plugin: 'org.openrewrite.rewrite'

rewrite {
activeRecipe('com.diffplug.spotless.openrewrite.SanityCheck')
exclusions.addAll(
Expand All @@ -21,3 +20,11 @@ rewrite {
exportDatatables = true
failOnDryRunResults = true
}
dependencies {
rewrite(platform('org.openrewrite.recipe:rewrite-recipe-bom:3.18.0'))
rewrite('org.openrewrite.recipe:rewrite-migrate-java:3.20.0')
rewrite('org.openrewrite.recipe:rewrite-java-security:3.20.0')
rewrite('org.openrewrite.recipe:rewrite-rewrite:0.14.1')
rewrite('org.openrewrite.recipe:rewrite-static-analysis:2.20.0')
rewrite('org.openrewrite.recipe:rewrite-third-party:0.31.1')
}
8 changes: 7 additions & 1 deletion gradle/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ spotless {
}
}
groovyGradle {
target '*.gradle'
target '*.gradle', 'gradle/*.gradle'
greclipse().configFile rootProject.files('gradle/spotless.eclipseformat.xml', 'gradle/spotless.groovyformat.prefs')
}
format 'dotfiles', {
target '.gitignore', '.gitattributes', '.editorconfig'
leadingTabsToSpaces(2)
trimTrailingWhitespace()
endWithNewline()
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=72f44c9f8ebcb1af43838f45ee5c4aa9c5444898b3468ab3f4af7b6076c5bc3f

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public RecursiveDelete(String exclusionDirectory) {

@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
if (exclusionDirectory != null && dir.toFile().getName().equals(exclusionDirectory)) {
if (dir.toFile().getName().equals(exclusionDirectory)) {
return FileVisitResult.SKIP_SUBTREE;
}
return super.preVisitDirectory(dir, attrs);
Expand Down
2 changes: 1 addition & 1 deletion rewrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tags:
recipeList:
- org.openrewrite.gradle.EnableGradleBuildCache
- org.openrewrite.gradle.EnableGradleParallelExecution
# - org.openrewrite.gradle.GradleBestPractices https://github.com/openrewrite/rewrite/issues/6237
- org.openrewrite.gradle.GradleBestPractices
- org.openrewrite.java.RemoveUnusedImports
- org.openrewrite.java.format.NormalizeFormat
- org.openrewrite.java.format.NormalizeLineBreaks
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
id 'io.github.davidburstrom.version-compatibility' version '0.5.0' apply false // https://github.com/davidburstrom/version-compatibility-gradle-plugin/tags
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' apply false // https://github.com/gradle-nexus/publish-plugin/releases
id 'net.ltgt.errorprone' version '4.3.0' apply false
id 'org.openrewrite.rewrite' version '7.18.0' apply false
id 'org.openrewrite.rewrite' version '7.20.0' apply false
}

dependencyResolutionManagement {
Expand Down
Loading