-
Couldn't load subscription status.
- Fork 216
Bring the ice-demos Gradle in-line with the ice Repo Gradle
#654
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,9 +44,26 @@ rewrite { | |||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quality of life - so rewrite prints it's suggestions to the build output so they can be picked up. |
||||||||||||||||||||||||||||||||||||||||||||||||
| // Set whether or not 'rewriteDryRun' should be considered 'failed' when it would make changes. | ||||||||||||||||||||||||||||||||||||||||||||||||
| tasks.named("rewriteDryRun").configure { | ||||||||||||||||||||||||||||||||||||||||||||||||
| rewrite.failOnDryRunResults = runningInCi | ||||||||||||||||||||||||||||||||||||||||||||||||
| // Fail the build when 'rewriteDryRun' wants to make changes to the code, | ||||||||||||||||||||||||||||||||||||||||||||||||
| // and print those required changes in the build output for clarity. | ||||||||||||||||||||||||||||||||||||||||||||||||
| tasks.withType<org.openrewrite.gradle.RewriteDryRunTask>().configureEach { | ||||||||||||||||||||||||||||||||||||||||||||||||
| doFirst { | ||||||||||||||||||||||||||||||||||||||||||||||||
| // Delete the old report file if present | ||||||||||||||||||||||||||||||||||||||||||||||||
| val reportFile = file(reportPath) | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (reportFile.exists()) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| reportFile.delete() | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| doLast { | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (file(reportPath).exists()) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+50
to
+59
|
||||||||||||||||||||||||||||||||||||||||||||||||
| doFirst { | |
| // Delete the old report file if present | |
| val reportFile = file(reportPath) | |
| if (reportFile.exists()) { | |
| reportFile.delete() | |
| } | |
| } | |
| doLast { | |
| if (file(reportPath).exists()) { | |
| // Define the path to the rewrite dry run report file | |
| val reportPath = project.layout.buildDirectory.file("rewrite/rewrite-dry-run.txt").get().asFile.toPath() | |
| doFirst { | |
| // Delete the old report file if present | |
| val reportFile = reportPath.toFile() | |
| if (reportFile.exists()) { | |
| reportFile.delete() | |
| } | |
| } | |
| doLast { | |
| if (reportPath.toFile().exists()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a property defined by the rewrite Task itself.
It's getter is defined here: https://github.com/openrewrite/rewrite-gradle-plugin/blob/363bbc7a63a2df4d8f78f33d6812e416ef9e77cf/plugin/src/main/java/org/openrewrite/gradle/RewriteDryRunTask.java#L32
To access them through gradle you omit the get prefix though.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,8 @@ | |
| <property name="allowByTailComment" value="true"/> | ||
| <property name="allowNonPrintableEscapes" value="true"/> | ||
| </module> | ||
|
|
||
| <module name="UnusedImports"/> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No reason not to check for this. |
||
| <module name="AvoidStarImport"/> | ||
| <module name="OneTopLevelClass"/> | ||
| <module name="NoLineWrap"> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rewriteDryRun can't be run in parallel or with the configuration cache.