-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
177 lines (140 loc) · 5.71 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
177 lines (140 loc) · 5.71 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import com.github.jk1.license.LicenseReportExtension
import nebula.plugin.contacts.Contact
import nebula.plugin.contacts.ContactsExtension
//import nl.javadude.gradle.plugins.license.LicenseExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`java-library`
`maven-publish`
signing
id("org.jetbrains.kotlin.jvm") version "1.6.21"
id("nebula.maven-resolved-dependencies") version "17.3.2"
id("nebula.release") version "15.3.1"
id("io.github.gradle-nexus.publish-plugin") version "1.0.0"
// id("com.github.hierynomus.license") version "0.16.1"
id("com.github.jk1.dependency-license-report") version "1.16"
id("org.owasp.dependencycheck") version "latest.release"
id("nebula.maven-publish") version "17.3.2"
id("nebula.contacts") version "5.1.0"
id("nebula.info") version "11.1.0"
id("nebula.javadoc-jar") version "17.3.2"
id("nebula.source-jar") version "17.3.2"
id("nebula.maven-apache-license") version "17.3.2"
id("org.openrewrite.rewrite") version "latest.release"
}
apply(plugin = "nebula.publish-verification")
rewrite {
activeRecipe("org.openrewrite.java.format.AutoFormat", "org.openrewrite.java.cleanup.Cleanup")
}
configure<nebula.plugin.release.git.base.ReleasePluginExtension> {
defaultVersionStrategy = nebula.plugin.release.NetflixOssStrategies.SNAPSHOT(project)
}
dependencyCheck {
analyzers.nodeAuditEnabled = false
analyzers.nodeEnabled = false
analyzers.assemblyEnabled = false
failBuildOnCVSS = 9.0F
suppressionFile = "suppressions.xml"
format = org.owasp.dependencycheck.reporting.ReportGenerator.Format.valueOf(project.properties["dependencyCheckFormat"] as String? ?: "HTML")
}
group = "org.openrewrite.recipe"
description = "Enforce logging best practices and migrate between logging frameworks. Automatically."
repositories {
if (!project.hasProperty("releasing")) {
mavenLocal()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
}
mavenCentral()
}
nexusPublishing {
repositories {
sonatype()
}
}
signing {
setRequired({
!project.version.toString().endsWith("SNAPSHOT") || project.hasProperty("forceSigning")
})
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["nebula"])
}
configurations.all {
resolutionStrategy {
cacheChangingModulesFor(0, TimeUnit.SECONDS)
cacheDynamicVersionsFor(0, TimeUnit.SECONDS)
}
}
val rewriteVersion = if (project.hasProperty("releasing")) {
"latest.release"
} else {
"latest.integration"
}
dependencies {
compileOnly("org.projectlombok:lombok:latest.release")
annotationProcessor("org.projectlombok:lombok:latest.release")
implementation("org.openrewrite:rewrite-java:${rewriteVersion}")
implementation("org.openrewrite:rewrite-maven:${rewriteVersion}")
runtimeOnly("org.openrewrite:rewrite-java-11:${rewriteVersion}")
runtimeOnly("org.springframework:spring-context:latest.release")
runtimeOnly("org.springframework.security:spring-security-config:latest.release")
runtimeOnly("org.springframework.security:spring-security-web:latest.release")
runtimeOnly("jakarta.servlet:jakarta.servlet-api:4.+")
// eliminates "unknown enum constant DeprecationLevel.WARNING" warnings from the build log
// see https://github.com/gradle/kotlin-dsl-samples/issues/1301 for why (okhttp is leaking parts of kotlin stdlib)
compileOnly("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
testImplementation("org.jetbrains.kotlin:kotlin-reflect")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
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")
testRuntimeOnly("org.springframework.boot:spring-boot-starter:latest.release")
testImplementation("org.openrewrite:rewrite-test:${rewriteVersion}")
testImplementation("org.assertj:assertj-core:latest.release")
testRuntimeOnly("org.openrewrite:rewrite-java-11:${rewriteVersion}")
testRuntimeOnly("org.openrewrite:rewrite-java-8:${rewriteVersion}")
testRuntimeOnly("com.fasterxml.jackson.core:jackson-databind:latest.release")
}
tasks.withType(KotlinCompile::class.java).configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}
tasks.named<Test>("test") {
useJUnitPlatform()
jvmArgs = listOf("-XX:+UnlockDiagnosticVMOptions", "-XX:+ShowHiddenFrames")
}
tasks.named<JavaCompile>("compileJava") {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
options.isFork = true
options.compilerArgs.addAll(listOf("--release", "8"))
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
}
configure<ContactsExtension> {
val j = Contact("team@moderne.io")
j.moniker("Team Moderne")
people["team@moderne.io"] = j
}
//configure<LicenseExtension> {
// ext.set("year", Calendar.getInstance().get(Calendar.YEAR))
// skipExistingHeaders = true
// header = project.rootProject.file("gradle/licenseHeader.txt")
// mapping(mapOf("kt" to "SLASHSTAR_STYLE", "java" to "SLASHSTAR_STYLE"))
// exclude("src/main/resources/*.java")
// strictCheck = true
//}
configure<LicenseReportExtension> {
renderers = arrayOf(com.github.jk1.license.render.CsvReportRenderer())
}
configure<PublishingExtension> {
publications {
named("nebula", MavenPublication::class.java) {
suppressPomMetadataWarningsFor("runtimeElements")
}
}
}