@@ -114,6 +114,7 @@ configure<SourceSetContainer> {
114114// //
115115// //////////////////////////////////
116116
117+ val recipeParserClasspath by configurations.creating
117118
118119repositories {
119120 mavenLocal()
@@ -168,6 +169,25 @@ dependencies {
168169 testImplementation(libs.commons.lang3)
169170 testImplementation(libs.logback.classic)
170171 testImplementation(libs.archunit)
172+
173+ // OpenRewrite
174+ // Import Rewrite's bill of materials.
175+ testImplementation(platform(" org.openrewrite.recipe:rewrite-recipe-bom:3.6.1" ))
176+
177+ // rewrite-java dependencies only necessary for Java Recipe development
178+ testImplementation(" org.openrewrite:rewrite-java" )
179+ testImplementation(" org.openrewrite.recipe:rewrite-java-dependencies" )
180+
181+ // This is supposed to only be the version that corresponds to the current Java version,
182+ // but as there are no toolchain, we include all, they can coexist safely tho.
183+ testRuntimeOnly(" org.openrewrite:rewrite-java-8" )
184+ testRuntimeOnly(" org.openrewrite:rewrite-java-11" )
185+ testRuntimeOnly(" org.openrewrite:rewrite-java-17" )
186+
187+ // For authoring tests for any kind of Recipe
188+ testImplementation(" org.openrewrite:rewrite-test" )
189+
190+ recipeParserClasspath(" net.dv8tion:JDA:5.6.1" )
171191}
172192
173193fun isNonStable (version : String ): Boolean {
@@ -459,6 +479,16 @@ nexusPublishing {
459479 }
460480}
461481
482+ val downloadRecipeClasspath by tasks.registering(Copy ::class ) {
483+ from(recipeParserClasspath)
484+ into(" src/test/resources/META-INF/rewrite/classpath" )
485+
486+ include(" JDA-*.jar" )
487+ }
488+
489+ tasks.named(" processTestResources" ).configure {
490+ dependsOn(downloadRecipeClasspath)
491+ }
462492
463493// //////////////////////////////////
464494// //
0 commit comments