Merge branch 'master' into 2.0.x

This commit is contained in:
Marcin Grzejszczak
2017-08-31 13:49:07 +02:00
4 changed files with 106 additions and 10 deletions

27
docs/pom.xml Normal file
View File

@@ -0,0 +1,27 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-build-docs</artifactId>
<name>spring-cloud-build-docs</name>
<packaging>jar</packaging>
<description>Spring Cloud Build Docs</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>1.3.5.BUILD-SNAPSHOT</version>
</parent>
<build>
<resources>
<resource>
<directory>src/main</directory>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>
</project>

View File

@@ -41,3 +41,44 @@ $ mvn deploy -P central -DaltReleaseDeploymentRepository=sonatype-nexus-staging:
== Contributing
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing.adoc[]
== Reusing the documentation
Spring Cloud Build publishes its `spring-cloud-build-docs` module that contains
helpful scripts (e.g. README generation ruby script) and css, xslt and images
for the Spring Cloud documentation. If you want to follow the same convention
approach of generating documentation just add these plugins to your `docs` module
[source,xml]
----
<profiles>
<profile>
<id>docs</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <1>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId> <2>
</plugin>
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId> <3>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId> <4>
<inherited>false</inherited>
</plugin>
</plugins>
</build>
</profile>
</profiles>
----
<1> This plugin downloads and unpacks the resources of the `spring-cloud-build-docs` module
<2> This plugin is required to parse the Asciidoctor documentation
<3> This plugin converts the Asciidoctor documentation into single and multi page docs
<4> This plugin is required to copy resources into proper final destinations and to generate main README.adoc

View File

@@ -184,7 +184,7 @@ function copy_docs_for_current_version() {
git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
else
cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}
git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file
git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file || echo "Failed to add the file [$file]"
fi
fi
done

46
pom.xml
View File

@@ -9,6 +9,7 @@
<name>Spring Cloud Parent</name>
<description>Spring Cloud parent pom, managing plugins and dependencies for Spring Cloud projects</description>
<modules>
<module>docs</module>
<module>spring-cloud-build-dependencies</module>
<module>spring-cloud-dependencies-parent</module>
<module>spring-cloud-build-tools</module>
@@ -638,6 +639,33 @@ limitations under the License.
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>unpack-docs</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build-docs</artifactId>
<version>${spring-cloud-build.version}</version>
<classifier>sources</classifier>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/build-docs</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
@@ -701,10 +729,10 @@ limitations under the License.
<includes>${docs.main}.xml</includes>
<xincludeSupported>true</xincludeSupported>
<chunkedOutput>false</chunkedOutput>
<foCustomization>${basedir}/src/main/docbook/xsl/pdf.xsl</foCustomization>
<foCustomization>${project.build.directory}/build-docs/docbook/xsl/pdf.xsl</foCustomization>
<useExtensions>1</useExtensions>
<highlightSource>1</highlightSource>
<highlightXslthlConfig>${basedir}/src/main/docbook/xsl/xslthl-config.xml</highlightXslthlConfig>
<highlightXslthlConfig>${project.build.directory}/build-docs/docbook/xsl/xslthl-config.xml</highlightXslthlConfig>
</configuration>
<dependencies>
<dependency>
@@ -729,7 +757,7 @@ limitations under the License.
</goals>
<phase>prepare-package</phase>
<configuration>
<htmlCustomization>${basedir}/src/main/docbook/xsl/html-singlepage.xsl</htmlCustomization>
<htmlCustomization>${project.build.directory}/build-docs/docbook/xsl/html-singlepage.xsl</htmlCustomization>
<targetDirectory>${basedir}/target/docbook/htmlsingle</targetDirectory>
<postProcess>
<copy todir="${basedir}/target/contents/reference/htmlsingle">
@@ -738,7 +766,7 @@ limitations under the License.
</fileset>
</copy>
<copy todir="${basedir}/target/contents/reference/htmlsingle">
<fileset dir="${basedir}/src/main/docbook">
<fileset dir="${project.build.directory}/build-docs/docbook">
<include name="**/*.css" />
<include name="**/*.png" />
<include name="**/*.gif" />
@@ -755,7 +783,7 @@ limitations under the License.
</goals>
<phase>prepare-package</phase>
<configuration>
<htmlCustomization>${basedir}/src/main/docbook/xsl/html-multipage.xsl</htmlCustomization>
<htmlCustomization>${project.build.directory}/build-docs/docbook/xsl/html-multipage.xsl</htmlCustomization>
<targetDirectory>${basedir}/target/docbook/html</targetDirectory>
<!-- By default `-` prefix is added to files and gh-pages don't render these files -->
<chunkedFilenamePrefix>multi_</chunkedFilenamePrefix>
@@ -767,7 +795,7 @@ limitations under the License.
</fileset>
</copy>
<copy todir="${basedir}/target/contents/reference/html">
<fileset dir="${basedir}/src/main/docbook">
<fileset dir="${project.build.directory}/build-docs/docbook">
<include name="**/*.css" />
<include name="**/*.png" />
<include name="**/*.gif" />
@@ -831,7 +859,7 @@ limitations under the License.
<configuration>
<target>
<java classname="org.jruby.Main" failonerror="yes">
<arg value="${basedir}/src/main/ruby/generate_readme.sh"/>
<arg value="${project.build.directory}/build-docs/ruby/generate_readme.sh"/>
<arg value="-o"/>
<arg value="${main.basedir}/README.adoc"/>
</java>
@@ -847,10 +875,10 @@ limitations under the License.
<configuration>
<target>
<copy todir="${basedir}/target/generated-docs/css">
<fileset dir="${basedir}/src/main/docbook/css"/>
<fileset dir="${project.build.directory}/build-docs/docbook/css"/>
</copy>
<copy failonerror="false" todir="${basedir}/target/generated-docs/images">
<fileset dir="${basedir}/src/main/docbook/images"/>
<fileset dir="${project.build.directory}/build-docs/docbook/images"/>
</copy>
</target>
</configuration>