Andy Wilkinson c66d2e8039 Relax the Gradle plugin's Kotlin version constraint
Enforcing the spring-boot-dependencies platform makes for too strong
an opinion about the version of Kotlin that should be on the build
script's classpath. It clashes with the version of Kotlin that's
embedded in Gradle and used with Gradle's Kotlin DSL.

This commit switches to a normal platform (rather than an enforced
platform) which allows it to express an opinion about the version of
Kotlin without making it a strict requirement.

Closes gh-19609
2020-01-13 11:00:49 +00:00

113 lines
2.6 KiB
Groovy

plugins {
id 'java-gradle-plugin'
id 'maven-publish'
id 'org.asciidoctor.jvm.convert'
id 'org.asciidoctor.jvm.pdf'
id 'org.springframework.boot.conventions'
id 'org.springframework.boot.maven-repository'
id 'org.springframework.boot.optional-dependencies'
}
description = 'Spring Boot Gradle Plugin'
configurations {
asciidoctorExtensions
documentation
}
repositories {
maven {
url 'https://repo.spring.io/release'
mavenContent {
includeGroup 'io.spring.asciidoctor'
}
}
}
dependencies {
asciidoctorExtensions 'io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:0.3.0.RELEASE'
implementation platform(project(':spring-boot-project:spring-boot-dependencies'))
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 enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies'))
optional 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core'
}
gradlePlugin {
plugins {
springBootPlugin {
id = 'org.springframework.boot'
implementationClass = 'org.springframework.boot.gradle.plugin.SpringBootPlugin'
}
}
}
jar {
manifest {
attributes 'Implementation-Version': project.version
}
}
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
doFirst {
attributes 'dependency-management-plugin-version': dependencyVersions.versionConstraints['io.spring.gradle:dependency-management-plugin']
}
}
asciidoctor {
configurations 'asciidoctorExtensions'
sources {
include 'index.adoc'
}
attributes 'stylesheet': 'css/style.css'
}
asciidoctorPdf {
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'
}
from(asciidoctor.outputDir) {
into 'reference/html'
}
from(javadoc) {
into 'api'
}
}
artifacts {
'documentation' zip
}