generated from moderneinc/rewrite-recipe-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
91 lines (76 loc) · 3.94 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
plugins {
id("org.openrewrite.build.recipe-library-base") version "latest.release"
// This uses the nexus publishing plugin to publish to the moderne-dev repository
// Remove it if you prefer to publish by other means, such as the maven-publish plugin
id("org.openrewrite.build.publish") version "latest.release"
id("nebula.release") version "latest.release"
// Configures artifact repositories used for dependency resolution to include maven central and nexus snapshots.
// If you are operating in an environment where public repositories are not accessible, we recommend using a
// virtual repository which mirrors both maven central and nexus snapshots.
id("org.openrewrite.build.recipe-repositories") version "latest.release"
// Only needed when you want to apply the OpenRewriteBestPractices recipe to your recipes through
// ./gradlew rewriteRun -Drewrite.activeRecipe=org.openrewrite.recipes.OpenRewriteBestPractices
id("org.openrewrite.rewrite") version "latest.release"
}
// Set as appropriate for your organization
group = "org.philzen.oss"
description = "Rewrite recipes."
tasks.named<JavaCompile>("compileJava") {
options.release.set(8)
}
dependencies {
// The bom version can also be set to a specific version
// https://github.com/openrewrite/rewrite-recipe-bom/releases
implementation(platform("org.openrewrite.recipe:rewrite-recipe-bom:latest.release"))
implementation("org.openrewrite:rewrite-java")
implementation("org.openrewrite.recipe:rewrite-java-dependencies")
runtimeOnly("org.openrewrite:rewrite-java-8")
runtimeOnly("org.openrewrite:rewrite-java-17")
// Refaster style recipes need the rewrite-templating annotation processor and dependency for generated recipes
// https://github.com/openrewrite/rewrite-templating/releases
annotationProcessor("org.openrewrite:rewrite-templating:latest.release")
implementation("org.openrewrite:rewrite-templating")
// The `@BeforeTemplate` and `@AfterTemplate` annotations are needed for refaster style recipes
compileOnly("com.google.errorprone:error_prone_core:2.19.1") {
exclude("com.google.auto.service", "auto-service-annotations")
}
// Need to have a slf4j binding to see any output enabled from the parser.
runtimeOnly("ch.qos.logback:logback-classic:1.2.+")
// Contains the OpenRewriteBestPractices recipe, which you can apply to your recipes
rewrite("org.openrewrite.recipe:rewrite-recommendations:latest.release")
// ↓ Dependencies specific to this project
testRuntimeOnly("org.testng:testng:7.5.1") {
because("7.5.x is the last Java 8 compatible version: https://github.com/testng-team/testng/issues/2775")
}
testRuntimeOnly("org.junit.jupiter:junit-jupiter-api:latest.release")
testImplementation("org.apiguardian:apiguardian-api:latest.release") {
because("Non-essential annotations on JUnit 5 implementations, provided here to avoid 'unknown enum constant Status.STABLE' warning on gradle CI build")
}
testRuntimeOnly("org.openrewrite.recipe:rewrite-testing-frameworks:latest.release") {
because("Provides essential recipes for usage in this project's recipe list")
exclude("org.testcontainers", "testcontainers")
}
}
signing {
// To enable signing have your CI workflow set the "signingKey" and "signingPassword" Gradle project properties
isRequired = false
}
// Use maven-style "SNAPSHOT" versioning for non-release builds
configure<nebula.plugin.release.git.base.ReleasePluginExtension> {
defaultVersionStrategy = nebula.plugin.release.NetflixOssStrategies.SNAPSHOT(project)
}
configure<PublishingExtension> {
publications {
named("nebula", MavenPublication::class.java) {
suppressPomMetadataWarningsFor("runtimeElements")
}
}
}
publishing {
repositories {
maven {
name = "moderne"
url = uri("https://us-west1-maven.pkg.dev/moderne-dev/moderne-recipe")
}
}
}