forked from spring-projects/spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
161 lines (141 loc) · 5.14 KB
/
build.gradle
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
import org.gradle.plugins.ide.eclipse.EclipsePlugin
import org.gradle.plugins.ide.eclipse.model.Classpath
import org.gradle.plugins.ide.eclipse.model.Library
plugins {
id "java-gradle-plugin"
id "maven-publish"
id "org.antora"
id "org.springframework.boot.conventions"
id "org.springframework.boot.docker-test"
id "org.springframework.boot.maven-repository"
id "org.springframework.boot.optional-dependencies"
}
description = "Spring Boot Gradle Plugins"
configurations {
antoraContent
"testCompileClasspath" {
// Downgrade SLF4J is required for tests to run in Eclipse
resolutionStrategy.force("org.slf4j:slf4j-api:1.7.36")
}
}
dependencies {
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-gradle-test-support"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation(gradleTestKit())
dockerTestImplementation("org.assertj:assertj-core")
dockerTestImplementation("org.junit.jupiter:junit-jupiter")
dockerTestImplementation("org.testcontainers:junit-jupiter")
dockerTestImplementation("org.testcontainers:testcontainers")
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform"))
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
implementation("io.spring.gradle:dependency-management-plugin")
implementation("org.apache.commons:commons-compress")
implementation("org.springframework:spring-core")
optional("org.graalvm.buildtools:native-gradle-plugin")
optional("org.cyclonedx:cyclonedx-gradle-plugin") {
exclude(group: "org.apache.maven", module: "maven-core")
}
optional("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") {
exclude(group: "commons-logging", module: "commons-logging")
}
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-gradle-test-support"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation("com.tngtech.archunit:archunit-junit5:0.22.0")
testImplementation("org.assertj:assertj-core")
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.mockito:mockito-core")
}
repositories {
gradlePluginPortal() {
content {
includeGroup("org.cyclonedx")
}
}
}
gradlePlugin {
plugins {
springBootPlugin {
id = "org.springframework.boot"
displayName = "Spring Boot Gradle Plugin"
description = "Spring Boot Gradle Plugin"
implementationClass = "org.springframework.boot.gradle.plugin.SpringBootPlugin"
}
springBootAotPlugin {
id = "org.springframework.boot.aot"
displayName = "Spring Boot AOT Gradle Plugin"
description = "Spring Boot AOT Gradle Plugin"
implementationClass = "org.springframework.boot.gradle.plugin.SpringBootAotPlugin"
}
}
}
task preparePluginValidationClasses(type: Copy) {
destinationDir = layout.buildDirectory.dir("classes/java/pluginValidation").get().asFile
from(sourceSets.main.output.classesDirs) {
exclude "**/CreateBootStartScripts.class"
}
}
validatePlugins {
classes.setFrom preparePluginValidationClasses
enableStricterValidation = true
}
tasks.named('test') {
inputs.dir('src/docs/antora/modules/gradle-plugin/examples').withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName('buildScripts')
}
javadoc {
options {
author = true
docTitle = "Spring Boot Gradle Plugin ${project.version} API"
encoding = "UTF-8"
memberLevel = "protected"
outputLevel = "quiet"
splitIndex = true
use = true
windowTitle = "Spring Boot Gradle Plugin ${project.version} API"
links "https://docs.gradle.org/$gradle.gradleVersion/javadoc/"
links "https://docs.oracle.com/en/java/javase/17/docs/api/"
}
}
def antoraGradlePluginLocalAggregateContent = tasks.register("antoraGradlePluginLocalAggregateContent", Zip) {
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
archiveClassifier = "gradle-plugin-local-aggregate-content"
from(tasks.getByName("generateAntoraYml")) {
into "modules"
}
}
def antoraGradlePluginCatalogContent = tasks.register("antoraGradlePluginCatalogContent", Zip) {
destinationDirectory = layout.buildDirectory.dir('generated/docs/antora-content')
archiveClassifier = "gradle-plugin-catalog-content"
from(javadoc) {
into "api/java"
}
}
tasks.named("generateAntoraPlaybook") {
xrefStubs = ["appendix:.*", "api:.*", "reference:.*"]
excludeJavadocExtension = true
alwaysInclude = [name: "gradle-plugin", classifier: "local-aggregate-content"]
dependsOn antoraGradlePluginLocalAggregateContent
}
tasks.named("antora") {
inputs.files(antoraGradlePluginLocalAggregateContent, antoraGradlePluginCatalogContent)
}
artifacts {
antoraContent antoraGradlePluginCatalogContent
}
toolchain {
maximumCompatibleJavaVersion = JavaLanguageVersion.of(20)
}
plugins.withType(EclipsePlugin) {
eclipse {
classpath.file { merger ->
merger.whenMerged { content ->
if (content instanceof Classpath) {
content.entries.each { entry ->
if (entry instanceof Library && (entry.path.contains("gradle-api-") || entry.path.contains("groovy-"))) {
entry.entryAttributes.remove("test")
}
}
}
}
}
}
}