You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spring-boot/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle

120 lines
3.3 KiB
Groovy

plugins {
id "java-gradle-plugin"
id "maven-publish"
id "org.asciidoctor.jvm.convert"
id "org.springframework.boot.conventions"
id "org.springframework.boot.maven-repository"
id "org.springframework.boot.optional-dependencies"
}
description = "Spring Boot Gradle Plugin"
configurations {
documentation
}
dependencies {
asciidoctorExtensions("io.spring.asciidoctor:spring-asciidoctor-extensions-section-ids")
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.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") {
exclude(group: "commons-logging", module: "commons-logging")
}
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")
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("org.testcontainers:testcontainers")
}
gradlePlugin {
plugins {
springBootPlugin {
id = "org.springframework.boot"
displayName = "Spring Boot Gradle Plugin"
description = "Spring Boot Gradle Plugin"
implementationClass = "org.springframework.boot.gradle.plugin.SpringBootPlugin"
}
}
}
task preparePluginValidationClasses(type: Copy) {
destinationDir = file("$buildDir/classes/java/pluginValidation")
from(sourceSets.main.output.classesDirs) {
exclude "**/CreateBootStartScripts.class"
}
}
validatePlugins {
classes.setFrom preparePluginValidationClasses
enableStricterValidation = true
}
task dependencyVersions(type: org.springframework.boot.build.constraints.ExtractVersionConstraints) {
enforcedPlatform(":spring-boot-project:spring-boot-dependencies")
}
tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) {
dependsOn dependencyVersions
inputs.dir('src/docs/gradle').withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName('buildScripts')
doFirst {
attributes "dependency-management-plugin-version": dependencyVersions.versionConstraints["io.spring.gradle:dependency-management-plugin"]
}
}
tasks.named('test') {
inputs.dir('src/docs/gradle').withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName('buildScripts')
}
asciidoctor {
sources {
include "index.adoc"
}
}
task asciidoctorPdf(type: org.asciidoctor.gradle.jvm.AsciidoctorTask) {
sources {
include "index.adoc"
}
}
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"
}
}
task zip(type: Zip) {
dependsOn asciidoctor, asciidoctorPdf
duplicatesStrategy "fail"
from(asciidoctorPdf.outputDir) {
into "reference/pdf"
rename "index.pdf", "${project.name}-reference.pdf"
}
from(asciidoctor.outputDir) {
into "reference/htmlsingle"
}
from(javadoc) {
into "api"
}
}
artifacts {
"documentation" zip
}