You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
171 lines
5.3 KiB
171 lines
5.3 KiB
/* |
|
* Copyright 2012-present the original author or authors. |
|
* |
|
* Licensed under the Apache License, Version 2.0 (the License); |
|
* you may not use this file except in compliance with the License. |
|
* You may obtain a copy of the License at |
|
* |
|
* https://www.apache.org/licenses/LICENSE-2.0 |
|
* |
|
* Unless required by applicable law or agreed to in writing, software |
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
* See the License for the specific language governing permissions and |
|
* limitations under the License. |
|
*/ |
|
|
|
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.springframework.boot.antora-contributor" |
|
id "org.springframework.boot.docker-test" |
|
id "org.springframework.boot.maven-repository" |
|
id "org.springframework.boot.optional-dependencies" |
|
} |
|
|
|
description = "Spring Boot Gradle Plugins" |
|
|
|
configurations { |
|
"testCompileClasspath" { |
|
// Downgrade SLF4J is required for tests to run in Eclipse |
|
resolutionStrategy.force("org.slf4j:slf4j-api:1.7.36") |
|
} |
|
} |
|
|
|
dependencies { |
|
dockerTestImplementation(project(":test-support:spring-boot-gradle-test-support")) |
|
dockerTestImplementation(project(":test-support:spring-boot-docker-test-support")) |
|
dockerTestImplementation(gradleTestKit()) |
|
dockerTestImplementation("org.assertj:assertj-core") |
|
dockerTestImplementation("org.junit.jupiter:junit-jupiter") |
|
dockerTestImplementation("org.testcontainers:testcontainers-junit-jupiter") |
|
|
|
implementation(project(":buildpack:spring-boot-buildpack-platform")) |
|
implementation(project(":loader: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") |
|
|
|
testImplementation(project(":test-support:spring-boot-gradle-test-support")) |
|
testImplementation(project(":test-support:spring-boot-test-support")) |
|
testImplementation("com.tngtech.archunit:archunit-junit5:1.4.0") |
|
testImplementation("net.java.dev.jna:jna-platform") |
|
testImplementation("org.apache.commons:commons-compress") |
|
testImplementation("org.apache.httpcomponents.client5:httpclient5") |
|
testImplementation("org.graalvm.buildtools:native-gradle-plugin") |
|
testImplementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") |
|
testImplementation("org.jetbrains.kotlin:kotlin-compiler-runner:$kotlinVersion") |
|
testImplementation("org.jetbrains.kotlin:kotlin-daemon-client:$kotlinVersion") |
|
testImplementation("org.tomlj:tomlj:1.0.0") |
|
testImplementation("tools.jackson.core:jackson-databind") |
|
} |
|
|
|
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" |
|
} |
|
} |
|
} |
|
|
|
tasks.register("preparePluginValidationClasses", 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" |
|
} |
|
} |
|
|
|
antoraContributions { |
|
'gradle-plugin' { |
|
catalogContent { |
|
from(javadoc) { |
|
into("api/java") |
|
} |
|
} |
|
localAggregateContent { |
|
from(tasks.named("generateAntoraYml")) { |
|
into "modules" |
|
} |
|
} |
|
source() |
|
} |
|
} |
|
|
|
tasks.named("generateAntoraPlaybook") { |
|
antoraExtensions.xref.stubs = ["appendix:.*", "api:.*", "reference:.*"] |
|
asciidocExtensions.excludeJavadocExtension = true |
|
} |
|
|
|
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") |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
tasks.named("compileTestJava") { |
|
options.nullability.checking = "tests" |
|
} |
|
|
|
tasks.named("compileDockerTestJava") { |
|
options.nullability.checking = "tests" |
|
}
|
|
|