generated from moderneinc/rewrite-recipe-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
109 lines (88 loc) · 3.06 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import nebula.plugin.contacts.Contact
import nebula.plugin.contacts.ContactsExtension
plugins {
`java-library`
id("nebula.release") version "16.0.0"
id("nebula.maven-manifest") version "18.4.0"
id("nebula.maven-nebula-publish") version "18.4.0"
id("nebula.maven-resolved-dependencies") version "18.4.0"
id("nebula.contacts") version "6.0.0"
id("nebula.info") version "11.3.3"
id("nebula.javadoc-jar") version "18.4.0"
id("nebula.source-jar") version "18.4.0"
}
apply(plugin = "nebula.publish-verification")
configure<nebula.plugin.release.git.base.ReleasePluginExtension> {
defaultVersionStrategy = nebula.plugin.release.NetflixOssStrategies.SNAPSHOT(project)
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
// Set as appropriate for your organization
group = "org.tkvangorder"
description = "Rewrite recipes."
repositories {
mavenLocal()
// Needed to pick up snapshot versions of rewrite
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
mavenCentral()
}
configurations.all {
resolutionStrategy {
cacheChangingModulesFor(0, TimeUnit.SECONDS)
cacheDynamicVersionsFor(0, TimeUnit.SECONDS)
}
}
//The bom version can also be set to a specific version or latest.release.
val rewriteBomVersion = "latest.integration"
dependencies {
compileOnly("org.projectlombok:lombok:latest.release")
compileOnly("com.google.code.findbugs:jsr305:latest.release")
annotationProcessor("org.projectlombok:lombok:latest.release")
implementation(platform("org.openrewrite.recipe:rewrite-recipe-bom:${rewriteBomVersion}"))
implementation("org.openrewrite:rewrite-java")
implementation("org.openrewrite:rewrite-maven")
runtimeOnly("org.openrewrite:rewrite-java-17")
//rewrite uses SLF4J to produce parser output.
runtimeOnly("ch.qos.logback:logback-classic:1.2.+")
testImplementation("org.junit.jupiter:junit-jupiter-api:latest.release")
testImplementation("org.junit.jupiter:junit-jupiter-params:latest.release")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")
testImplementation("org.openrewrite:rewrite-test")
testImplementation("org.assertj:assertj-core:latest.release")
}
tasks.named<Test>("test") {
useJUnitPlatform()
jvmArgs = listOf("-XX:+UnlockDiagnosticVMOptions", "-XX:+ShowHiddenFrames")
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
}
tasks.named<JavaCompile>("compileJava") {
options.release.set(8)
}
configure<ContactsExtension> {
val j = Contact("team@moderne.io")
j.moniker("Team Moderne")
people["team@moderne.io"] = j
}
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")
}
}
}