Port the build to Gradle
Closes gh-19609 Closes gh-19608
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-tools</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>org.springframework.boot.gradle.plugin</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Boot Gradle Plugin Marker Artifact</name>
|
||||
<description>Spring Boot Gradle Plugin Marker Artifact</description>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../../..</main.basedir>
|
||||
</properties>
|
||||
<scm>
|
||||
<url>${git.url}</url>
|
||||
<connection>${git.connection}</connection>
|
||||
<developerConnection>${git.developerConnection}</developerConnection>
|
||||
</scm>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-gradle-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>regex-property</id>
|
||||
<goals>
|
||||
<goal>regex-property</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<failIfNoMatch>false</failIfNoMatch>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-parent</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../spring-boot-parent</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-boot-tools</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Boot Tools</name>
|
||||
<description>Spring Boot Tools</description>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../..</main.basedir>
|
||||
</properties>
|
||||
<scm>
|
||||
<url>${git.url}</url>
|
||||
<connection>${git.connection}</connection>
|
||||
<developerConnection>${git.developerConnection}</developerConnection>
|
||||
</scm>
|
||||
<modules>
|
||||
<module>org.springframework.boot.gradle.plugin</module>
|
||||
<module>spring-boot-antlib</module>
|
||||
<module>spring-boot-autoconfigure-processor</module>
|
||||
<module>spring-boot-configuration-docs</module>
|
||||
<module>spring-boot-configuration-metadata</module>
|
||||
<module>spring-boot-configuration-processor</module>
|
||||
<module>spring-boot-gradle-plugin</module>
|
||||
<module>spring-boot-loader</module>
|
||||
<module>spring-boot-loader-tools</module>
|
||||
<module>spring-boot-maven-plugin</module>
|
||||
<module>spring-boot-test-support</module>
|
||||
</modules>
|
||||
</project>
|
||||
@@ -0,0 +1,75 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'org.springframework.boot.conventions'
|
||||
id 'org.springframework.boot.deployed'
|
||||
}
|
||||
|
||||
description = 'Spring Boot Antlib'
|
||||
|
||||
ext {
|
||||
antVersion = "1.9.3"
|
||||
}
|
||||
|
||||
configurations {
|
||||
antUnit
|
||||
antIvy
|
||||
}
|
||||
|
||||
dependencies {
|
||||
antUnit "org.apache.ant:ant-antunit:1.3"
|
||||
antIvy "org.apache.ivy:ivy:2.4.0"
|
||||
|
||||
compileOnly project(":spring-boot-project:spring-boot-tools:spring-boot-loader")
|
||||
compileOnly "org.apache.ant:ant:${antVersion}"
|
||||
|
||||
implementation enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies"))
|
||||
implementation project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools")
|
||||
implementation "org.springframework:spring-core"
|
||||
}
|
||||
|
||||
task copyIntegrationTestSources(type: Copy) {
|
||||
from file("src/it")
|
||||
into "${buildDir}/it"
|
||||
}
|
||||
|
||||
processResources {
|
||||
eachFile {
|
||||
filter { it.replace('${spring-boot.version}', project.version) }
|
||||
}
|
||||
}
|
||||
|
||||
task integrationTest {
|
||||
dependsOn copyIntegrationTestSources, jar
|
||||
def resultsDir = file("${buildDir}/test-results/integrationTest")
|
||||
inputs.dir file("src/it")
|
||||
inputs.files sourceSets.main.runtimeClasspath
|
||||
outputs.dirs resultsDir
|
||||
doLast {
|
||||
ant.with {
|
||||
taskdef(resource: "org/apache/ant/antunit/antlib.xml",
|
||||
classpath: configurations.antUnit.asPath)
|
||||
taskdef(resource: "org/apache/ivy/ant/antlib.xml",
|
||||
classpath: configurations.antIvy.asPath)
|
||||
taskdef(resource: "org/springframework/boot/ant/antlib.xml",
|
||||
classpath: sourceSets.main.runtimeClasspath.asPath,
|
||||
uri: "antlib:org.springframework.boot.ant")
|
||||
ant.property(name: "ivy.class.path", value: configurations.antIvy.asPath)
|
||||
ant.property(name: "antunit.class.path", value: configurations.antUnit.asPath)
|
||||
antunit {
|
||||
propertyset {
|
||||
ant.propertyref(name: "build.compiler")
|
||||
ant.propertyref(name: "antunit.class.path")
|
||||
ant.propertyref(name: "ivy.class.path")
|
||||
}
|
||||
plainlistener()
|
||||
file("${buildDir}/test-results/integrationTest").mkdirs()
|
||||
xmllistener(toDir: resultsDir)
|
||||
fileset(dir: "${buildDir}/it", includes: "**/build.xml")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
check {
|
||||
dependsOn integrationTest
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-tools</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>spring-boot-antlib</artifactId>
|
||||
<name>Spring Boot Antlib</name>
|
||||
<description>Spring Boot Antlib</description>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../../..</main.basedir>
|
||||
<ant.version>1.9.3</ant.version>
|
||||
</properties>
|
||||
<scm>
|
||||
<url>${git.url}</url>
|
||||
<connection>${git.connection}</connection>
|
||||
<developerConnection>${git.developerConnection}</developerConnection>
|
||||
</scm>
|
||||
<dependencies>
|
||||
<!-- Compile -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-loader-tools</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- Provided -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-loader</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
<version>${ant.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<configuration>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>org.springframework.boot:spring-boot-loader-tools</include>
|
||||
<include>org.springframework:spring-core</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||
<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>shade-runtime-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>antunit</id>
|
||||
<phase>integration-test</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<mkdir dir="${project.build.directory}/it" />
|
||||
<copy todir="${project.build.directory}/it">
|
||||
<fileset dir="${project.basedir}/src/it" />
|
||||
</copy>
|
||||
<path id="taskpath">
|
||||
<fileset dir="${project.build.directory}"
|
||||
includes="${project.build.finalName}.${project.packaging}" />
|
||||
</path>
|
||||
<pathconvert refid="taskpath" />
|
||||
<typedef resource="org/springframework/boot/ant/antlib.xml" classpathref="taskpath" uri="antlib:org.springframework.boot.ant" />
|
||||
<property name="build.compiler" value="${antBuildCompiler}" />
|
||||
<antunit xmlns="antlib:org.apache.ant.antunit">
|
||||
<propertyset>
|
||||
<propertyref name="build.compiler" />
|
||||
</propertyset>
|
||||
<plainlistener />
|
||||
<fileset xmlns="antlib:org.apache.tools.ant" dir="${project.build.directory}/it"
|
||||
includes="**/build.xml" />
|
||||
</antunit>
|
||||
</target>
|
||||
<skip>${skipTests}</skip>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
<version>${ant.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant-launcher</artifactId>
|
||||
<version>${ant.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant-antunit</artifactId>
|
||||
<version>1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.ivy</groupId>
|
||||
<artifactId>ivy</artifactId>
|
||||
<version>2.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
||||
<artifactId>ecj</artifactId>
|
||||
<version>4.6.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>java-8</id>
|
||||
<activation>
|
||||
<jdk>[1.8,1.9)</jdk>
|
||||
</activation>
|
||||
<properties>
|
||||
<antBuildCompiler>org.eclipse.jdt.core.JDTCompilerAdapter</antBuildCompiler>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>java-9</id>
|
||||
<activation>
|
||||
<jdk>[1.9,)</jdk>
|
||||
</activation>
|
||||
<properties>
|
||||
<antBuildCompiler>modern</antBuildCompiler>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
@@ -6,11 +6,16 @@
|
||||
<property name="target.dir" location="target" />
|
||||
<property name="classes.dir" location="${target.dir}/classes" />
|
||||
|
||||
<taskdef resource="org/apache/ivy/ant/antlib.xml"
|
||||
uri="antlib:org.apache.ivy.ant" classpath="${ivy.class.path}"/>
|
||||
<taskdef resource="org/apache/ant/antunit/antlib.xml"
|
||||
uri="antlib:org.apache.ant.antunit" classpath="${antunit.class.path}"/>
|
||||
|
||||
<target name="setUp">
|
||||
<ivy:cachepath inline="true" pathid="compile.classpath" organisation="joda-time" module="joda-time" type="jar" revision="2.8.1" />
|
||||
|
||||
<mkdir dir="${classes.dir}" />
|
||||
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="compile.classpath" />
|
||||
<au:logcapturer/>
|
||||
</target>
|
||||
|
||||
<target name="tearDown">
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'org.springframework.boot.conventions'
|
||||
id 'org.springframework.boot.deployed'
|
||||
}
|
||||
|
||||
description = 'Spring Boot AutoConfigure Annotation Processor'
|
||||
|
||||
dependencies {
|
||||
testImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies'))
|
||||
testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support')
|
||||
testImplementation 'org.assertj:assertj-core'
|
||||
testImplementation 'org.springframework:spring-core'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-tools</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>spring-boot-autoconfigure-processor</artifactId>
|
||||
<name>Spring Boot Auto-Configure Annotation Processor</name>
|
||||
<description>Spring Auto-Configure Annotation Processor</description>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../../..</main.basedir>
|
||||
</properties>
|
||||
<scm>
|
||||
<url>${git.url}</url>
|
||||
<connection>${git.connection}</connection>
|
||||
<developerConnection>${git.developerConnection}</developerConnection>
|
||||
</scm>
|
||||
<dependencies>
|
||||
<!-- Test -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test-support</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- Ensure own annotation processor doesn't kick in -->
|
||||
<proc>none</proc>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-tools</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>spring-boot-configuration-docs</artifactId>
|
||||
<name>Spring Boot Configuration Docs</name>
|
||||
<description>Spring Boot Configuration Docs</description>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../../..</main.basedir>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-metadata</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test-support</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2019 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.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.configurationdocs;
|
||||
|
||||
/**
|
||||
* Simple builder to help construct Asciidoc markup.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
class AsciidocBuilder {
|
||||
|
||||
private final StringBuilder content;
|
||||
|
||||
AsciidocBuilder() {
|
||||
this.content = new StringBuilder();
|
||||
}
|
||||
|
||||
AsciidocBuilder appendKey(Object... items) {
|
||||
for (Object item : items) {
|
||||
appendln("`+", item, "+` +");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
AsciidocBuilder newLine() {
|
||||
return append(System.lineSeparator());
|
||||
}
|
||||
|
||||
AsciidocBuilder appendln(Object... items) {
|
||||
return append(items).newLine();
|
||||
}
|
||||
|
||||
AsciidocBuilder append(Object... items) {
|
||||
for (Object item : items) {
|
||||
this.content.append(item);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.content.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2019 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.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.configurationdocs;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
|
||||
|
||||
/**
|
||||
* Table entry regrouping a list of configuration properties sharing the same description.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
class CompoundConfigurationTableEntry extends ConfigurationTableEntry {
|
||||
|
||||
private Set<String> configurationKeys;
|
||||
|
||||
private String description;
|
||||
|
||||
CompoundConfigurationTableEntry(String key, String description) {
|
||||
this.key = key;
|
||||
this.description = description;
|
||||
this.configurationKeys = new TreeSet<>();
|
||||
}
|
||||
|
||||
void addConfigurationKeys(ConfigurationMetadataProperty... properties) {
|
||||
Stream.of(properties).map(ConfigurationMetadataProperty::getId).forEach(this.configurationKeys::add);
|
||||
}
|
||||
|
||||
@Override
|
||||
void write(AsciidocBuilder builder) {
|
||||
builder.append("|");
|
||||
this.configurationKeys.forEach(builder::appendKey);
|
||||
builder.newLine().appendln("|").appendln("|+++", this.description, "+++");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2019 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.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.configurationdocs;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
|
||||
import org.springframework.boot.configurationmetadata.ConfigurationMetadataRepositoryJsonBuilder;
|
||||
|
||||
/**
|
||||
* Write Asciidoc documents with configuration properties listings.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public class ConfigurationMetadataDocumentWriter {
|
||||
|
||||
public void writeDocument(Path outputDirectory, DocumentOptions options, InputStream... metadata)
|
||||
throws IOException {
|
||||
assertValidOutputDirectory(outputDirectory);
|
||||
if (!Files.exists(outputDirectory)) {
|
||||
Files.createDirectory(outputDirectory);
|
||||
}
|
||||
assertMetadata(metadata);
|
||||
List<ConfigurationTable> tables = createConfigTables(getMetadataProperties(metadata), options);
|
||||
for (ConfigurationTable table : tables) {
|
||||
writeConfigurationTable(table, outputDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
private void assertValidOutputDirectory(Path outputDirPath) {
|
||||
if (outputDirPath == null) {
|
||||
throw new IllegalArgumentException("output path should not be null");
|
||||
}
|
||||
if (Files.exists(outputDirPath) && !Files.isDirectory(outputDirPath)) {
|
||||
throw new IllegalArgumentException("output path already exists and is not a directory");
|
||||
}
|
||||
}
|
||||
|
||||
private void assertMetadata(InputStream... metadata) {
|
||||
if (metadata == null || metadata.length < 1) {
|
||||
throw new IllegalArgumentException("missing input metadata");
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, ConfigurationMetadataProperty> getMetadataProperties(InputStream... metadata)
|
||||
throws IOException {
|
||||
ConfigurationMetadataRepositoryJsonBuilder builder = ConfigurationMetadataRepositoryJsonBuilder
|
||||
.create(metadata);
|
||||
return builder.build().getAllProperties();
|
||||
}
|
||||
|
||||
private List<ConfigurationTable> createConfigTables(Map<String, ConfigurationMetadataProperty> metadataProperties,
|
||||
DocumentOptions options) {
|
||||
List<ConfigurationTable> tables = new ArrayList<>();
|
||||
List<String> unmappedKeys = metadataProperties.values().stream().filter((property) -> !property.isDeprecated())
|
||||
.map(ConfigurationMetadataProperty::getId).collect(Collectors.toList());
|
||||
Map<String, CompoundConfigurationTableEntry> overrides = getOverrides(metadataProperties, unmappedKeys,
|
||||
options);
|
||||
options.getMetadataSections().forEach((id, keyPrefixes) -> tables
|
||||
.add(createConfigTable(metadataProperties, unmappedKeys, overrides, id, keyPrefixes)));
|
||||
if (!unmappedKeys.isEmpty()) {
|
||||
throw new IllegalStateException(
|
||||
"The following keys were not written to the documentation: " + String.join(", ", unmappedKeys));
|
||||
}
|
||||
if (!overrides.isEmpty()) {
|
||||
throw new IllegalStateException("The following keys were not written to the documentation: "
|
||||
+ String.join(", ", overrides.keySet()));
|
||||
}
|
||||
return tables;
|
||||
}
|
||||
|
||||
private Map<String, CompoundConfigurationTableEntry> getOverrides(
|
||||
Map<String, ConfigurationMetadataProperty> metadataProperties, List<String> unmappedKeys,
|
||||
DocumentOptions options) {
|
||||
Map<String, CompoundConfigurationTableEntry> overrides = new HashMap<>();
|
||||
options.getOverrides().forEach((keyPrefix, description) -> {
|
||||
CompoundConfigurationTableEntry entry = new CompoundConfigurationTableEntry(keyPrefix, description);
|
||||
List<String> matchingKeys = unmappedKeys.stream().filter((key) -> key.startsWith(keyPrefix))
|
||||
.collect(Collectors.toList());
|
||||
for (String matchingKey : matchingKeys) {
|
||||
entry.addConfigurationKeys(metadataProperties.get(matchingKey));
|
||||
}
|
||||
overrides.put(keyPrefix, entry);
|
||||
unmappedKeys.removeAll(matchingKeys);
|
||||
});
|
||||
return overrides;
|
||||
}
|
||||
|
||||
private ConfigurationTable createConfigTable(Map<String, ConfigurationMetadataProperty> metadataProperties,
|
||||
List<String> unmappedKeys, Map<String, CompoundConfigurationTableEntry> overrides, String id,
|
||||
List<String> keyPrefixes) {
|
||||
ConfigurationTable table = new ConfigurationTable(id);
|
||||
for (String keyPrefix : keyPrefixes) {
|
||||
List<String> matchingOverrides = overrides.keySet().stream()
|
||||
.filter((overrideKey) -> overrideKey.startsWith(keyPrefix)).collect(Collectors.toList());
|
||||
matchingOverrides.forEach((match) -> table.addEntry(overrides.remove(match)));
|
||||
}
|
||||
List<String> matchingKeys = unmappedKeys.stream()
|
||||
.filter((key) -> keyPrefixes.stream().anyMatch(key::startsWith)).collect(Collectors.toList());
|
||||
for (String matchingKey : matchingKeys) {
|
||||
ConfigurationMetadataProperty property = metadataProperties.get(matchingKey);
|
||||
table.addEntry(new SingleConfigurationTableEntry(property));
|
||||
}
|
||||
unmappedKeys.removeAll(matchingKeys);
|
||||
return table;
|
||||
}
|
||||
|
||||
private void writeConfigurationTable(ConfigurationTable table, Path outputDirectory) throws IOException {
|
||||
Path outputFilePath = outputDirectory.resolve(table.getId() + ".adoc");
|
||||
Files.deleteIfExists(outputFilePath);
|
||||
Files.createFile(outputFilePath);
|
||||
try (OutputStream outputStream = Files.newOutputStream(outputFilePath)) {
|
||||
outputStream.write(table.toAsciidocTable().getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2019 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.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.configurationdocs;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
/**
|
||||
* Asciidoctor table listing configuration properties sharing to a common theme.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
class ConfigurationTable {
|
||||
|
||||
private final String id;
|
||||
|
||||
private final Set<ConfigurationTableEntry> entries;
|
||||
|
||||
ConfigurationTable(String id) {
|
||||
this.id = id;
|
||||
this.entries = new TreeSet<>();
|
||||
}
|
||||
|
||||
String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
void addEntry(ConfigurationTableEntry... entries) {
|
||||
this.entries.addAll(Arrays.asList(entries));
|
||||
}
|
||||
|
||||
String toAsciidocTable() {
|
||||
AsciidocBuilder builder = new AsciidocBuilder();
|
||||
builder.appendln("[cols=\"1,1,2\", options=\"header\"]");
|
||||
builder.appendln("|===");
|
||||
builder.appendln("|Key|Default Value|Description");
|
||||
builder.appendln();
|
||||
this.entries.forEach((entry) -> {
|
||||
entry.write(builder);
|
||||
builder.appendln();
|
||||
});
|
||||
return builder.appendln("|===").toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2019 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.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.configurationdocs;
|
||||
|
||||
/**
|
||||
* Abstract class for entries in {@link ConfigurationTable}.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
abstract class ConfigurationTableEntry implements Comparable<ConfigurationTableEntry> {
|
||||
|
||||
protected String key;
|
||||
|
||||
String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
abstract void write(AsciidocBuilder builder);
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ConfigurationTableEntry other = (ConfigurationTableEntry) obj;
|
||||
return this.key.equals(other.key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.key.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(ConfigurationTableEntry other) {
|
||||
return this.key.compareTo(other.getKey());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2019 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.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.configurationdocs;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Options for generating documentation for configuration properties.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public final class DocumentOptions {
|
||||
|
||||
private final Map<String, List<String>> metadataSections;
|
||||
|
||||
private final Map<String, String> overrides;
|
||||
|
||||
private DocumentOptions(Map<String, List<String>> metadataSections, Map<String, String> overrides) {
|
||||
this.metadataSections = metadataSections;
|
||||
this.overrides = overrides;
|
||||
}
|
||||
|
||||
Map<String, List<String>> getMetadataSections() {
|
||||
return this.metadataSections;
|
||||
}
|
||||
|
||||
Map<String, String> getOverrides() {
|
||||
return this.overrides;
|
||||
}
|
||||
|
||||
static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for DocumentOptions.
|
||||
*/
|
||||
public static class Builder {
|
||||
|
||||
Map<String, List<String>> metadataSections = new HashMap<>();
|
||||
|
||||
Map<String, String> overrides = new HashMap<>();
|
||||
|
||||
SectionSpec addSection(String name) {
|
||||
return new SectionSpec(this, name);
|
||||
}
|
||||
|
||||
Builder addOverride(String keyPrefix, String description) {
|
||||
this.overrides.put(keyPrefix, description);
|
||||
return this;
|
||||
}
|
||||
|
||||
DocumentOptions build() {
|
||||
return new DocumentOptions(this.metadataSections, this.overrides);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration for a documentation section listing properties for a specific theme.
|
||||
*/
|
||||
public static class SectionSpec {
|
||||
|
||||
private final String name;
|
||||
|
||||
private final Builder builder;
|
||||
|
||||
SectionSpec(Builder builder, String name) {
|
||||
this.builder = builder;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
Builder withKeyPrefixes(String... keyPrefixes) {
|
||||
this.builder.metadataSections.put(this.name, Arrays.asList(keyPrefixes));
|
||||
return this.builder;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2019 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.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.configurationdocs;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
|
||||
|
||||
/**
|
||||
* Table entry containing a single configuration property.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
class SingleConfigurationTableEntry extends ConfigurationTableEntry {
|
||||
|
||||
private final String description;
|
||||
|
||||
private final String defaultValue;
|
||||
|
||||
SingleConfigurationTableEntry(ConfigurationMetadataProperty property) {
|
||||
this.key = property.getId();
|
||||
if (property.getType() != null && property.getType().startsWith("java.util.Map")) {
|
||||
this.key += ".*";
|
||||
}
|
||||
this.description = property.getDescription();
|
||||
this.defaultValue = getDefaultValue(property.getDefaultValue());
|
||||
}
|
||||
|
||||
private String getDefaultValue(Object defaultValue) {
|
||||
if (defaultValue == null) {
|
||||
return null;
|
||||
}
|
||||
if (defaultValue.getClass().isArray()) {
|
||||
return Arrays.stream((Object[]) defaultValue).map(Object::toString)
|
||||
.collect(Collectors.joining("," + System.lineSeparator()));
|
||||
}
|
||||
return defaultValue.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
void write(AsciidocBuilder builder) {
|
||||
builder.appendln("|`+", this.key, "+`");
|
||||
writeDefaultValue(builder);
|
||||
writeDescription(builder);
|
||||
builder.appendln();
|
||||
}
|
||||
|
||||
private void writeDefaultValue(AsciidocBuilder builder) {
|
||||
String defaultValue = (this.defaultValue != null) ? this.defaultValue : "";
|
||||
if (defaultValue.isEmpty()) {
|
||||
builder.appendln("|");
|
||||
}
|
||||
else {
|
||||
defaultValue = defaultValue.replace("\\", "\\\\").replace("|", "\\|");
|
||||
builder.appendln("|`+", defaultValue, "+`");
|
||||
}
|
||||
}
|
||||
|
||||
private void writeDescription(AsciidocBuilder builder) {
|
||||
if (this.description == null || this.description.isEmpty()) {
|
||||
builder.append("|");
|
||||
}
|
||||
else {
|
||||
String cleanedDescription = this.description.replace("|", "\\|");
|
||||
builder.append("|+++", cleanedDescription, "+++");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2019 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.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.configurationdocs;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for {@link CompoundConfigurationTableEntry}.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
class CompoundConfigurationTableEntryTests {
|
||||
|
||||
private static String NEWLINE = System.lineSeparator();
|
||||
|
||||
@Test
|
||||
void simpleProperty() {
|
||||
ConfigurationMetadataProperty firstProp = new ConfigurationMetadataProperty();
|
||||
firstProp.setId("spring.test.first");
|
||||
firstProp.setType("java.lang.String");
|
||||
ConfigurationMetadataProperty secondProp = new ConfigurationMetadataProperty();
|
||||
secondProp.setId("spring.test.second");
|
||||
secondProp.setType("java.lang.String");
|
||||
ConfigurationMetadataProperty thirdProp = new ConfigurationMetadataProperty();
|
||||
thirdProp.setId("spring.test.third");
|
||||
thirdProp.setType("java.lang.String");
|
||||
CompoundConfigurationTableEntry entry = new CompoundConfigurationTableEntry("spring.test",
|
||||
"This is a description.");
|
||||
entry.addConfigurationKeys(firstProp, secondProp, thirdProp);
|
||||
AsciidocBuilder builder = new AsciidocBuilder();
|
||||
entry.write(builder);
|
||||
assertThat(builder.toString()).isEqualTo(
|
||||
"|`+spring.test.first+` +" + NEWLINE + "`+spring.test.second+` +" + NEWLINE + "`+spring.test.third+` +"
|
||||
+ NEWLINE + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2019 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.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.configurationdocs;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for {@link ConfigurationTable}.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
class ConfigurationTableTests {
|
||||
|
||||
private static String NEWLINE = System.lineSeparator();
|
||||
|
||||
@Test
|
||||
void simpleTable() {
|
||||
ConfigurationTable table = new ConfigurationTable("test");
|
||||
ConfigurationMetadataProperty first = new ConfigurationMetadataProperty();
|
||||
first.setId("spring.test.prop");
|
||||
first.setDefaultValue("something");
|
||||
first.setDescription("This is a description.");
|
||||
first.setType("java.lang.String");
|
||||
ConfigurationMetadataProperty second = new ConfigurationMetadataProperty();
|
||||
second.setId("spring.test.other");
|
||||
second.setDefaultValue("other value");
|
||||
second.setDescription("This is another description.");
|
||||
second.setType("java.lang.String");
|
||||
table.addEntry(new SingleConfigurationTableEntry(first));
|
||||
table.addEntry(new SingleConfigurationTableEntry(second));
|
||||
assertThat(table.toAsciidocTable()).isEqualTo("[cols=\"1,1,2\", options=\"header\"]" + NEWLINE + "|==="
|
||||
+ NEWLINE + "|Key|Default Value|Description" + NEWLINE + NEWLINE + "|`+spring.test.other+`" + NEWLINE
|
||||
+ "|`+other value+`" + NEWLINE + "|+++This is another description.+++" + NEWLINE + NEWLINE
|
||||
+ "|`+spring.test.prop+`" + NEWLINE + "|`+something+`" + NEWLINE + "|+++This is a description.+++"
|
||||
+ NEWLINE + NEWLINE + "|===" + NEWLINE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2019 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.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.configurationdocs;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for {@link SingleConfigurationTableEntry}.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
class SingleConfigurationTableEntryTests {
|
||||
|
||||
private static String NEWLINE = System.lineSeparator();
|
||||
|
||||
@Test
|
||||
void simpleProperty() {
|
||||
ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
|
||||
property.setId("spring.test.prop");
|
||||
property.setDefaultValue("something");
|
||||
property.setDescription("This is a description.");
|
||||
property.setType("java.lang.String");
|
||||
SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property);
|
||||
AsciidocBuilder builder = new AsciidocBuilder();
|
||||
entry.write(builder);
|
||||
assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+something+`" + NEWLINE
|
||||
+ "|+++This is a description.+++" + NEWLINE);
|
||||
}
|
||||
|
||||
@Test
|
||||
void noDefaultValue() {
|
||||
ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
|
||||
property.setId("spring.test.prop");
|
||||
property.setDescription("This is a description.");
|
||||
property.setType("java.lang.String");
|
||||
SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property);
|
||||
AsciidocBuilder builder = new AsciidocBuilder();
|
||||
entry.write(builder);
|
||||
assertThat(builder.toString()).isEqualTo(
|
||||
"|`+spring.test.prop+`" + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE);
|
||||
}
|
||||
|
||||
@Test
|
||||
void defaultValueWithPipes() {
|
||||
ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
|
||||
property.setId("spring.test.prop");
|
||||
property.setDefaultValue("first|second");
|
||||
property.setDescription("This is a description.");
|
||||
property.setType("java.lang.String");
|
||||
SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property);
|
||||
AsciidocBuilder builder = new AsciidocBuilder();
|
||||
entry.write(builder);
|
||||
assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first\\|second+`" + NEWLINE
|
||||
+ "|+++This is a description.+++" + NEWLINE);
|
||||
}
|
||||
|
||||
@Test
|
||||
void defaultValueWithBackslash() {
|
||||
ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
|
||||
property.setId("spring.test.prop");
|
||||
property.setDefaultValue("first\\second");
|
||||
property.setDescription("This is a description.");
|
||||
property.setType("java.lang.String");
|
||||
SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property);
|
||||
AsciidocBuilder builder = new AsciidocBuilder();
|
||||
entry.write(builder);
|
||||
assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first\\\\second+`" + NEWLINE
|
||||
+ "|+++This is a description.+++" + NEWLINE);
|
||||
}
|
||||
|
||||
@Test
|
||||
void descriptionWithPipe() {
|
||||
ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
|
||||
property.setId("spring.test.prop");
|
||||
property.setDescription("This is a description with a | pipe.");
|
||||
property.setType("java.lang.String");
|
||||
SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property);
|
||||
AsciidocBuilder builder = new AsciidocBuilder();
|
||||
entry.write(builder);
|
||||
assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|" + NEWLINE
|
||||
+ "|+++This is a description with a \\| pipe.+++" + NEWLINE);
|
||||
}
|
||||
|
||||
@Test
|
||||
void mapProperty() {
|
||||
ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
|
||||
property.setId("spring.test.prop");
|
||||
property.setDescription("This is a description.");
|
||||
property.setType("java.util.Map<java.lang.String,java.lang.String>");
|
||||
SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property);
|
||||
AsciidocBuilder builder = new AsciidocBuilder();
|
||||
entry.write(builder);
|
||||
assertThat(builder.toString()).isEqualTo(
|
||||
"|`+spring.test.prop.*+`" + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE);
|
||||
}
|
||||
|
||||
@Test
|
||||
void listProperty() {
|
||||
String[] defaultValue = new String[] { "first", "second", "third" };
|
||||
ConfigurationMetadataProperty property = new ConfigurationMetadataProperty();
|
||||
property.setId("spring.test.prop");
|
||||
property.setDescription("This is a description.");
|
||||
property.setType("java.util.List<java.lang.String>");
|
||||
property.setDefaultValue(defaultValue);
|
||||
SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property);
|
||||
AsciidocBuilder builder = new AsciidocBuilder();
|
||||
entry.write(builder);
|
||||
assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first," + NEWLINE + "second,"
|
||||
+ NEWLINE + "third+`" + NEWLINE + "|+++This is a description.+++" + NEWLINE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'maven-publish'
|
||||
id 'org.springframework.boot.conventions'
|
||||
}
|
||||
|
||||
description = 'Spring Boot Configuration Metadata'
|
||||
|
||||
dependencies {
|
||||
implementation enforcedPlatform(project(path: ":spring-boot-project:spring-boot-parent"))
|
||||
implementation "com.vaadin.external.google:android-json"
|
||||
|
||||
testImplementation "org.junit.jupiter:junit-jupiter"
|
||||
testImplementation "org.assertj:assertj-core"
|
||||
testImplementation "org.springframework:spring-core"
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-tools</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>spring-boot-configuration-metadata</artifactId>
|
||||
<name>Spring Boot Configuration Metadata</name>
|
||||
<description>Spring Boot Configuration Metadata</description>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../../..</main.basedir>
|
||||
</properties>
|
||||
<scm>
|
||||
<url>${git.url}</url>
|
||||
<connection>${git.connection}</connection>
|
||||
<developerConnection>${git.developerConnection}</developerConnection>
|
||||
</scm>
|
||||
<dependencies>
|
||||
<!-- Compile (should stick to the bare minimum) -->
|
||||
<dependency>
|
||||
<groupId>com.vaadin.external.google</groupId>
|
||||
<artifactId>android-json</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,27 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'org.springframework.boot.conventions'
|
||||
id 'org.springframework.boot.deployed'
|
||||
}
|
||||
|
||||
description = 'Spring Boot Configuration Annotation Processor'
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDir file("src/json-shade/java")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies"))
|
||||
testImplementation project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")
|
||||
testImplementation "javax.validation:validation-api"
|
||||
testImplementation "org.assertj:assertj-core"
|
||||
testImplementation "org.hamcrest:hamcrest-library"
|
||||
testImplementation "org.junit.jupiter:junit-jupiter"
|
||||
testImplementation "org.mockito:mockito-core"
|
||||
testImplementation "org.projectlombok:lombok"
|
||||
testImplementation "org.springframework:spring-core"
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-tools</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<name>Spring Boot Configuration Processor</name>
|
||||
<description>Spring Boot Configuration Processor</description>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../../..</main.basedir>
|
||||
</properties>
|
||||
<scm>
|
||||
<url>${git.url}</url>
|
||||
<connection>${git.connection}</connection>
|
||||
<developerConnection>${git.developerConnection}</developerConnection>
|
||||
</scm>
|
||||
<dependencies>
|
||||
<!-- Test -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.validation</groupId>
|
||||
<artifactId>jakarta.validation-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test-support</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- Ensure own annotation processor doesn't kick in -->
|
||||
<proc>none</proc>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-json-shade-source</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>${basedir}/src/json-shade/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -102,24 +102,21 @@ class JSON {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static JSONException typeMismatch(Object indexOrName, Object actual,
|
||||
String requiredType) throws JSONException {
|
||||
public static JSONException typeMismatch(Object indexOrName, Object actual, String requiredType)
|
||||
throws JSONException {
|
||||
if (actual == null) {
|
||||
throw new JSONException("Value at " + indexOrName + " is null.");
|
||||
}
|
||||
throw new JSONException("Value " + actual + " at " + indexOrName + " of type "
|
||||
+ actual.getClass().getName() + " cannot be converted to "
|
||||
+ requiredType);
|
||||
throw new JSONException("Value " + actual + " at " + indexOrName + " of type " + actual.getClass().getName()
|
||||
+ " cannot be converted to " + requiredType);
|
||||
}
|
||||
|
||||
public static JSONException typeMismatch(Object actual, String requiredType)
|
||||
throws JSONException {
|
||||
public static JSONException typeMismatch(Object actual, String requiredType) throws JSONException {
|
||||
if (actual == null) {
|
||||
throw new JSONException("Value is null.");
|
||||
}
|
||||
throw new JSONException(
|
||||
"Value " + actual + " of type " + actual.getClass().getName()
|
||||
+ " cannot be converted to " + requiredType);
|
||||
throw new JSONException("Value " + actual + " of type " + actual.getClass().getName()
|
||||
+ " cannot be converted to " + requiredType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -127,7 +127,6 @@ public class JSONArray {
|
||||
|
||||
/**
|
||||
* Appends {@code value} to the end of this array.
|
||||
*
|
||||
* @param value the value
|
||||
* @return this array.
|
||||
*/
|
||||
@@ -138,7 +137,6 @@ public class JSONArray {
|
||||
|
||||
/**
|
||||
* Appends {@code value} to the end of this array.
|
||||
*
|
||||
* @param value a finite value. May not be {@link Double#isNaN() NaNs} or
|
||||
* {@link Double#isInfinite() infinities}.
|
||||
* @return this array.
|
||||
@@ -171,7 +169,6 @@ public class JSONArray {
|
||||
|
||||
/**
|
||||
* Appends {@code value} to the end of this array.
|
||||
*
|
||||
* @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean, Integer,
|
||||
* Long, Double, {@link JSONObject#NULL}, or {@code null}. May not be
|
||||
* {@link Double#isNaN() NaNs} or {@link Double#isInfinite() infinities}. Unsupported
|
||||
@@ -288,8 +285,7 @@ public class JSONArray {
|
||||
return value;
|
||||
}
|
||||
catch (IndexOutOfBoundsException e) {
|
||||
throw new JSONException(
|
||||
"Index " + index + " out of range [0.." + this.values.size() + ")");
|
||||
throw new JSONException("Index " + index + " out of range [0.." + this.values.size() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,7 +440,6 @@ public class JSONArray {
|
||||
* a long.
|
||||
* @param index the index to get the value from
|
||||
* @return the {@code value}
|
||||
*
|
||||
* @throws JSONException if the value at {@code index} doesn't exist or cannot be
|
||||
* coerced to a long.
|
||||
*/
|
||||
@@ -642,7 +637,6 @@ public class JSONArray {
|
||||
* 94043,
|
||||
* 90210
|
||||
* ]</pre>
|
||||
*
|
||||
* @param indentSpaces the number of spaces to indent for each level of nesting.
|
||||
* @return a human readable JSON string of this array
|
||||
* @throws JSONException if processing of json failed
|
||||
|
||||
@@ -41,11 +41,11 @@ import java.util.Map;
|
||||
* <li>When the requested type is an int, other {@link Number} types will be coerced using
|
||||
* {@link Number#intValue() intValue}. Strings that can be coerced using
|
||||
* {@link Double#valueOf(String)} will be, and then cast to int.
|
||||
* <li><a id="lossy">When the requested type is a long, other {@link Number} types will
|
||||
* be coerced using {@link Number#longValue() longValue}. Strings that can be coerced
|
||||
* using {@link Double#valueOf(String)} will be, and then cast to long. This two-step
|
||||
* conversion is lossy for very large values. For example, the string
|
||||
* "9223372036854775806" yields the long 9223372036854775807.</a>
|
||||
* <li><a id="lossy">When the requested type is a long, other {@link Number} types will be
|
||||
* coerced using {@link Number#longValue() longValue}. Strings that can be coerced using
|
||||
* {@link Double#valueOf(String)} will be, and then cast to long. This two-step conversion
|
||||
* is lossy for very large values. For example, the string "9223372036854775806" yields
|
||||
* the long 9223372036854775807.</a>
|
||||
* <li>When the requested type is a String, other non-null values will be coerced using
|
||||
* {@link String#valueOf(Object)}. Although null cannot be coerced, the sentinel value
|
||||
* {@link JSONObject#NULL} is coerced to the string "null".
|
||||
@@ -117,7 +117,6 @@ public class JSONObject {
|
||||
/**
|
||||
* Creates a new {@code JSONObject} by copying all name/value mappings from the given
|
||||
* map.
|
||||
*
|
||||
* @param copyFrom a map whose keys are of type {@link String} and whose values are of
|
||||
* supported types.
|
||||
* @throws NullPointerException if any of the map's keys are null.
|
||||
@@ -334,7 +333,6 @@ public class JSONObject {
|
||||
|
||||
/**
|
||||
* Removes the named mapping if it exists; does nothing otherwise.
|
||||
*
|
||||
* @param name the name of the property
|
||||
* @return the value previously mapped by {@code name}, or null if there was no such
|
||||
* mapping.
|
||||
@@ -430,7 +428,6 @@ public class JSONObject {
|
||||
/**
|
||||
* Returns the value mapped by {@code name} if it exists and is a double or can be
|
||||
* coerced to a double.
|
||||
*
|
||||
* @param name the name of the property
|
||||
* @return the value
|
||||
* @throws JSONException if the mapping doesn't exist or cannot be coerced to a
|
||||
@@ -690,8 +687,7 @@ public class JSONObject {
|
||||
* @return the array
|
||||
*/
|
||||
public JSONArray names() {
|
||||
return this.nameValuePairs.isEmpty() ? null
|
||||
: new JSONArray(new ArrayList<>(this.nameValuePairs.keySet()));
|
||||
return this.nameValuePairs.isEmpty() ? null : new JSONArray(new ArrayList<>(this.nameValuePairs.keySet()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -823,9 +819,9 @@ public class JSONObject {
|
||||
if (o instanceof Map) {
|
||||
return new JSONObject((Map) o);
|
||||
}
|
||||
if (o instanceof Boolean || o instanceof Byte || o instanceof Character
|
||||
|| o instanceof Double || o instanceof Float || o instanceof Integer
|
||||
|| o instanceof Long || o instanceof Short || o instanceof String) {
|
||||
if (o instanceof Boolean || o instanceof Byte || o instanceof Character || o instanceof Double
|
||||
|| o instanceof Float || o instanceof Integer || o instanceof Long || o instanceof Short
|
||||
|| o instanceof String) {
|
||||
return o;
|
||||
}
|
||||
if (o.getClass().getPackage().getName().startsWith("java.")) {
|
||||
|
||||
@@ -191,8 +191,7 @@ public class JSONStringer {
|
||||
* @return the JSON stringer
|
||||
* @throws JSONException if processing of json failed
|
||||
*/
|
||||
JSONStringer close(Scope empty, Scope nonempty, String closeBracket)
|
||||
throws JSONException {
|
||||
JSONStringer close(Scope empty, Scope nonempty, String closeBracket) throws JSONException {
|
||||
Scope context = peek();
|
||||
if (context != nonempty && context != empty) {
|
||||
throw new JSONException("Nesting problem");
|
||||
|
||||
@@ -375,8 +375,8 @@ public class JSONTokener {
|
||||
throw syntaxError("Names cannot be null");
|
||||
}
|
||||
else {
|
||||
throw syntaxError("Names must be strings, but " + name
|
||||
+ " is of type " + name.getClass().getName());
|
||||
throw syntaxError(
|
||||
"Names must be strings, but " + name + " is of type " + name.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,71 +1,112 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath("io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.15")
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'eclipse'
|
||||
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'
|
||||
}
|
||||
|
||||
apply plugin: 'io.spring.javaformat'
|
||||
description = 'Spring Boot Gradle Plugin'
|
||||
|
||||
configurations {
|
||||
asciidoctorExtensions
|
||||
documentation
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven {
|
||||
url 'https://repo.spring.io/release'
|
||||
mavenContent {
|
||||
includeGroup 'io.spring.asciidoctor'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation localGroovy()
|
||||
implementation gradleApi()
|
||||
implementation fileTree(dir: 'target/dependencies/compile', include: '*.jar')
|
||||
testImplementation gradleTestKit()
|
||||
testImplementation 'org.apache.commons:commons-compress:1.13'
|
||||
testImplementation fileTree(dir: 'target/dependencies/test', include: '*.jar')
|
||||
asciidoctorExtensions 'io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:0.3.0.RELEASE'
|
||||
implementation enforcedPlatform(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': (version ? version : 'unknown')
|
||||
attributes 'Implementation-Version': project.version
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
testLogging {
|
||||
events "passed", "skipped", "failed"
|
||||
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()
|
||||
stylesheetFile = file('src/main/javadoc/spring-javadoc.css')
|
||||
links = [
|
||||
'https://docs.oracle.com/javase/8/docs/api/',
|
||||
'https://docs.gradle.org/current/javadoc/'
|
||||
]
|
||||
source = '8'
|
||||
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"
|
||||
}
|
||||
title = "${project.description} $version API"
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar) {
|
||||
classifier = "javadoc"
|
||||
from javadoc
|
||||
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 {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
'documentation' zip
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
org.gradle.daemon=false
|
||||
Binary file not shown.
@@ -1,5 +0,0 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -1,172 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
@@ -1,84 +0,0 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1,399 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-tools</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>spring-boot-gradle-plugin</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Boot Gradle Plugin</name>
|
||||
<description>Spring Boot Gradle Plugin</description>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../../..</main.basedir>
|
||||
<gradle.executable>./gradlew</gradle.executable>
|
||||
<gradle.task>build</gradle.task>
|
||||
<refdocs.build.directory>${project.build.directory}/refdocs/</refdocs.build.directory>
|
||||
</properties>
|
||||
<scm>
|
||||
<url>${git.url}</url>
|
||||
<connection>${git.connection}</connection>
|
||||
<developerConnection>${git.developerConnection}</developerConnection>
|
||||
</scm>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-loader-tools</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.spring.gradle</groupId>
|
||||
<artifactId>dependency-management-plugin</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-gradle-plugin</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.googlecode.maven-download-plugin</groupId>
|
||||
<artifactId>download-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-doc-resources</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>wget</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<url>${spring-doc-resources.url}</url>
|
||||
<unpack>true</unpack>
|
||||
<outputDirectory>${refdocs.build.directory}/asciidoc</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-compile-dependencies</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<inherited>false</inherited>
|
||||
<configuration>
|
||||
<includeScope>compile</includeScope>
|
||||
<outputDirectory>${project.build.directory}/dependencies/compile</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-test-dependencies</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<inherited>false</inherited>
|
||||
<configuration>
|
||||
<includeScope>test</includeScope>
|
||||
<outputDirectory>${project.build.directory}/dependencies/test</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-asciidoc-resources</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${refdocs.build.directory}/asciidoc</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/asciidoc</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-gradle-resources</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${refdocs.build.directory}/gradle</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/gradle</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>gradle</id>
|
||||
<phase>prepare-package</phase>
|
||||
<configuration>
|
||||
<executable>${gradle.executable}</executable>
|
||||
<arguments>
|
||||
<argument>clean</argument>
|
||||
<argument>${gradle.task}</argument>
|
||||
<argument>-Pversion=${project.version}</argument>
|
||||
<argument>-Pdescription=${project.description}</argument>
|
||||
<argument>-S</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-artifacts</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>attach-artifact</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifacts>
|
||||
<artifact>
|
||||
<file>build/libs/${project.artifactId}-${project.version}.jar</file>
|
||||
<type>jar</type>
|
||||
</artifact>
|
||||
<artifact>
|
||||
<file>build/libs/${project.artifactId}-${project.version}-javadoc.jar</file>
|
||||
<type>jar</type>
|
||||
<classifier>javadoc</classifier>
|
||||
</artifact>
|
||||
<artifact>
|
||||
<file>build/libs/${project.artifactId}-${project.version}-sources.jar</file>
|
||||
<type>jar</type>
|
||||
<classifier>sources</classifier>
|
||||
</artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>windows</id>
|
||||
<activation>
|
||||
<os>
|
||||
<family>windows</family>
|
||||
</os>
|
||||
</activation>
|
||||
<properties>
|
||||
<gradle.executable>gradlew.bat</gradle.executable>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>skipTests</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>skipTests</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<gradle.task>assemble</gradle.task>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>full</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>full</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ant-contrib</groupId>
|
||||
<artifactId>ant-contrib</artifactId>
|
||||
<version>1.0b3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant-nodeps</artifactId>
|
||||
<version>1.8.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.tigris.antelope</groupId>
|
||||
<artifactId>antelopetasks</artifactId>
|
||||
<version>3.2.10</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>set-up-maven-properties</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<exportAntProperties>true</exportAntProperties>
|
||||
<target>
|
||||
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
|
||||
<taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" />
|
||||
<var name="version-type" value="${project.version}" />
|
||||
<propertyregex property="version-type" override="true"
|
||||
input="${version-type}" regexp=".*\.(.*)" replace="\1" />
|
||||
<propertyregex property="version-type" override="true"
|
||||
input="${version-type}" regexp="(M)\d+" replace="MILESTONE" />
|
||||
<propertyregex property="version-type" override="true"
|
||||
input="${version-type}" regexp="(RC)\d+" replace="MILESTONE" />
|
||||
<propertyregex property="version-type" override="true"
|
||||
input="${version-type}" regexp="BUILD-(.*)" replace="SNAPSHOT" />
|
||||
<var name="github-tag" value="v${project.version}" />
|
||||
<propertyregex property="github-tag" override="true"
|
||||
input="${github-tag}" regexp=".*SNAPSHOT" replace="master" />
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>package-docs-zip</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<zip
|
||||
destfile="${project.build.directory}/${project.artifactId}-${project.version}-docs.zip">
|
||||
<zipfileset
|
||||
src="build/libs/${project.artifactId}-${project.version}-javadoc.jar"
|
||||
prefix="api" />
|
||||
<zipfileset dir="${project.build.directory}/generated-docs/reference/html"
|
||||
prefix="reference/html" />
|
||||
<mappedresources>
|
||||
<fileset dir="${project.build.directory}/generated-docs/reference/pdf"
|
||||
includes="index.pdf" />
|
||||
<globmapper from="index.pdf"
|
||||
to="reference/pdf/spring-boot-gradle-plugin-reference.pdf" />
|
||||
</mappedresources>
|
||||
</zip>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-html-documentation</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>process-asciidoc</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<backend>html5</backend>
|
||||
<outputDirectory>${project.build.directory}/generated-docs/reference/html</outputDirectory>
|
||||
<sourceHighlighter>highlight.js</sourceHighlighter>
|
||||
<doctype>book</doctype>
|
||||
<attributes>
|
||||
<highlightjsdir>js/highlight</highlightjsdir>
|
||||
<highlightjs-theme>github</highlightjs-theme>
|
||||
<linkcss>true</linkcss>
|
||||
<imagesdir>./images</imagesdir>
|
||||
<icons>font</icons>
|
||||
<stylesdir>css/</stylesdir>
|
||||
<stylesheet>style.css</stylesheet>
|
||||
<attribute-missing>warn</attribute-missing>
|
||||
</attributes>
|
||||
<logHandler>
|
||||
<outputToConsole>true</outputToConsole>
|
||||
<failIf>
|
||||
<severity>DEBUG</severity>
|
||||
</failIf>
|
||||
</logHandler>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>generate-pdf-documentation</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>process-asciidoc</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<backend>pdf</backend>
|
||||
<outputDirectory>${project.build.directory}/generated-docs/reference/pdf</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<sourceDirectory>${refdocs.build.directory}/asciidoc</sourceDirectory>
|
||||
<sourceDocumentName>index.adoc</sourceDocumentName>
|
||||
<attributes>
|
||||
<github-tag>${github-tag}</github-tag>
|
||||
<version-type>${version-type}</version-type>
|
||||
<version>${project.version}</version>
|
||||
<dependency-management-plugin-version>${dependency-management-plugin.version}</dependency-management-plugin-version>
|
||||
</attributes>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.spring.asciidoctor</groupId>
|
||||
<artifactId>spring-asciidoctor-extensions-block-switch</artifactId>
|
||||
<version>${spring-asciidoctor-extensions.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-zip</id>
|
||||
<goals>
|
||||
<goal>attach-artifact</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifacts>
|
||||
<artifact>
|
||||
<file>${project.build.directory}/${project.artifactId}-${project.version}-docs.zip</file>
|
||||
<type>zip</type>
|
||||
<classifier>docs</classifier>
|
||||
</artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>java13</id>
|
||||
<activation>
|
||||
<jdk>13</jdk>
|
||||
</activation>
|
||||
<properties>
|
||||
<gradle.task>assemble</gradle.task>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
@@ -22,7 +22,7 @@ Andy Wilkinson
|
||||
:maven-publish-plugin: {gradle-userguide}/maven_publish_plugin.html
|
||||
:software-component: {gradle-userguide}/software_model_extend.html
|
||||
:kotlin-plugin: https://kotlinlang.org/docs/reference/using-gradle.html
|
||||
:spring-boot-docs: https://docs.spring.io/spring-boot/docs/{version}
|
||||
:spring-boot-docs: https://docs.spring.io/spring-boot/docs/{gradle-project-version}
|
||||
:api-documentation: {spring-boot-docs}/gradle-plugin/api
|
||||
:spring-boot-reference: {spring-boot-docs}/reference/htmlsingle
|
||||
:build-info-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/buildinfo/BuildInfo.html
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user