forked from moderneinc/rewrite-recipe-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
80 lines (66 loc) · 3.41 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
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 = "com.yourorg"
description = "Rewrite recipes."
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")
implementation("org.openrewrite:rewrite-yaml")
implementation("org.assertj:assertj-core:3.24.2")
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.+")
// Our recipe converts Guava's `Lists` type
testRuntimeOnly("com.google.guava:guava:latest.release")
testRuntimeOnly("org.apache.commons:commons-lang3:latest.release")
testRuntimeOnly("org.springframework:spring-core:latest.release")
// Contains the OpenRewriteBestPractices recipe, which you can apply to your recipes
rewrite("org.openrewrite.recipe:rewrite-recommendations:latest.release")
}
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")
}
}
}