|
18 | 18 | import org.openrewrite.gradle.RewriteDryRunTask |
19 | 19 |
|
20 | 20 | plugins { |
21 | | - id("org.openrewrite.rewrite") |
| 21 | + id("build-logic.openrewrite-base") |
22 | 22 | } |
23 | 23 |
|
24 | 24 | dependencies { |
25 | | - rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:latest.integration")) |
26 | | - rewrite("org.openrewrite.recipe:rewrite-static-analysis") |
27 | | - rewrite("org.openrewrite.recipe:rewrite-testing-frameworks") |
| 25 | + openrewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:latest.integration")) |
| 26 | + openrewrite("org.openrewrite.recipe:rewrite-static-analysis") |
| 27 | + openrewrite("org.openrewrite.recipe:rewrite-testing-frameworks") |
28 | 28 | } |
29 | 29 |
|
30 | | -rewrite { |
| 30 | +openrewrite { |
31 | 31 | configFile = project.rootProject.file("config/openrewrite/rewrite.yml") |
32 | | - // See RewriteDryRunTask workaround below |
33 | | - failOnDryRunResults = false |
34 | | - |
35 | | - activeStyle("org.apache.jmeter.style.Style") |
36 | | - |
37 | | - // See config/openrewrite/rewrite.yml |
38 | | - activeRecipe("org.apache.jmeter.staticanalysis.CodeCleanup") |
39 | | - // See https://github.com/openrewrite/rewrite-static-analysis/blob/8c803a9c50b480841a4af031f60bac5ee443eb4e/src/main/resources/META-INF/rewrite/common-static-analysis.yml#L21 |
40 | | - activeRecipe("org.apache.jmeter.staticanalysis.CommonStaticAnalysis") |
41 | | - plugins.withId("build-logic.test-junit5") { |
42 | | - // See https://github.com/openrewrite/rewrite-testing-frameworks/blob/47ccd370247f1171fa9df005da8a9a3342d19f3f/src/main/resources/META-INF/rewrite/junit5.yml#L18C7-L18C62 |
43 | | - activeRecipe("org.openrewrite.java.testing.junit5.JUnit5BestPractices") |
44 | | - // See https://github.com/openrewrite/rewrite-testing-frameworks/blob/47ccd370247f1171fa9df005da8a9a3342d19f3f/src/main/resources/META-INF/rewrite/junit5.yml#L255C7-L255C60 |
45 | | - activeRecipe("org.openrewrite.java.testing.junit5.CleanupAssertions") |
46 | | - } |
47 | | -} |
48 | | - |
49 | | -// See https://github.com/openrewrite/rewrite-gradle-plugin/issues/255 |
50 | | -tasks.withType<RewriteDryRunTask>().configureEach { |
51 | | - doFirst { |
52 | | - if (reportPath.exists()) { |
53 | | - // RewriteDryRunTask keeps the report file if there are no violations, so we remove it |
54 | | - reportPath.delete() |
55 | | - } |
56 | | - } |
57 | | - doLast { |
58 | | - if (reportPath.exists()) { |
59 | | - throw GradleException( |
60 | | - "The following files have format violations. " + |
61 | | - "Execute ./gradlew ${path.replace("Dry", "")} to apply the changes:\n" + |
62 | | - reportPath.readText() |
63 | | - ) |
64 | | - } |
65 | | - } |
| 32 | + activeStyles += "org.apache.jmeter.style.Style" |
66 | 33 | } |
| 34 | +//rewrite { |
| 35 | +// |
| 36 | +//} |
| 37 | +//rewrite { |
| 38 | +// configFile = project.rootProject.file("config/openrewrite/rewrite.yml") |
| 39 | +// // See RewriteDryRunTask workaround below |
| 40 | +// failOnDryRunResults = false |
| 41 | +// |
| 42 | +// activeStyle("org.apache.jmeter.style.Style") |
| 43 | +// |
| 44 | +// // See config/openrewrite/rewrite.yml |
| 45 | +// activeRecipe("org.apache.jmeter.staticanalysis.CodeCleanup") |
| 46 | +// // See https://github.com/openrewrite/rewrite-static-analysis/blob/8c803a9c50b480841a4af031f60bac5ee443eb4e/src/main/resources/META-INF/rewrite/common-static-analysis.yml#L21 |
| 47 | +// activeRecipe("org.apache.jmeter.staticanalysis.CommonStaticAnalysis") |
| 48 | +// plugins.withId("build-logic.test-junit5") { |
| 49 | +// // See https://github.com/openrewrite/rewrite-testing-frameworks/blob/47ccd370247f1171fa9df005da8a9a3342d19f3f/src/main/resources/META-INF/rewrite/junit5.yml#L18C7-L18C62 |
| 50 | +// activeRecipe("org.openrewrite.java.testing.junit5.JUnit5BestPractices") |
| 51 | +// // See https://github.com/openrewrite/rewrite-testing-frameworks/blob/47ccd370247f1171fa9df005da8a9a3342d19f3f/src/main/resources/META-INF/rewrite/junit5.yml#L255C7-L255C60 |
| 52 | +// activeRecipe("org.openrewrite.java.testing.junit5.CleanupAssertions") |
| 53 | +// } |
| 54 | +//} |
| 55 | +// |
| 56 | +//// See https://github.com/openrewrite/rewrite-gradle-plugin/issues/255 |
| 57 | +//tasks.withType<RewriteDryRunTask>().configureEach { |
| 58 | +// doFirst { |
| 59 | +// if (reportPath.exists()) { |
| 60 | +// // RewriteDryRunTask keeps the report file if there are no violations, so we remove it |
| 61 | +// reportPath.delete() |
| 62 | +// } |
| 63 | +// } |
| 64 | +// doLast { |
| 65 | +// if (reportPath.exists()) { |
| 66 | +// throw GradleException( |
| 67 | +// "The following files have format violations. " + |
| 68 | +// "Execute ./gradlew ${path.replace("Dry", "")} to apply the changes:\n" + |
| 69 | +// reportPath.readText() |
| 70 | +// ) |
| 71 | +// } |
| 72 | +// } |
| 73 | +//} |
0 commit comments