From 8f19618cc2389fdd80109a1401adca2e93c9e861 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Thu, 31 Aug 2017 14:08:45 +0200 Subject: [PATCH] Let's eat our own dogfood sc-build reuses sc-build logic to generate its own docs --- README.adoc | 53 +++++++++++++++++++++++++++--- docs/pom.xml | 28 ++++++++++++++++ docs/src/main/asciidoc/README.adoc | 2 ++ pom.xml | 35 ++++++++++++++------ 4 files changed, 103 insertions(+), 15 deletions(-) diff --git a/README.adoc b/README.adoc index b0b9ce74..0ccbb2bd 100644 --- a/README.adoc +++ b/README.adoc @@ -1,4 +1,6 @@ -// Do not edit this file (e.g. go instead to docs/src/main/asciidoc) +// Do not edit this file (e.g. go instead to src/main/asciidoc) + +image:https://circleci.com/gh/spring-cloud/spring-cloud-build.svg?style=svg[link="https://travis-ci.org/spring-cloud/spring-cloud-build"] Spring Cloud Build is a common utility project for Spring Cloud to use for plugin and dependency management. @@ -26,9 +28,9 @@ $ mvn deploy -DaltReleaseDeploymentRepository=repo.spring.io::default::https://r and for jcenter use ---- +---- $ mvn deploy -DaltReleaseDeploymentRepository=bintray::default::https://api.bintray.com/maven/spring/jars/org.springframework.cloud:build ---- +---- and for Maven Central use @@ -48,7 +50,7 @@ follow the guidelines below. === Sign the Contributor License Agreement Before we accept a non-trivial patch or pull request we will need you to sign the -https://support.springsource.com/spring_committer_signup[contributor's agreement]. +https://cla.pivotal.io/sign/spring[Contributor License Agreement]. Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and @@ -83,4 +85,45 @@ added after the original pull request but before a merge. other target branch in the main project). * When writing a commit message please follow http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions], if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit - message (where XXXX is the issue number). \ No newline at end of file + message (where XXXX is the issue number). + +== 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] +---- + + + docs + + + + org.apache.maven.plugins + maven-dependency-plugin <1> + + + org.asciidoctor + asciidoctor-maven-plugin <2> + + + com.agilejava.docbkx + docbkx-maven-plugin <3> + + + org.apache.maven.plugins + maven-antrun-plugin <4> + false + + + + + +---- +<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 \ No newline at end of file diff --git a/docs/pom.xml b/docs/pom.xml index f06d7b57..b87d967f 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -11,6 +11,13 @@ spring-cloud-build 1.3.5.BUILD-SNAPSHOT + + spring-cloud-build + + 1.2.x,2.0.x + ${basedir}/.. + ${basedir}/src/main + @@ -24,4 +31,25 @@ + + + docs + + + + org.asciidoctor + asciidoctor-maven-plugin + + + com.agilejava.docbkx + docbkx-maven-plugin + + + org.apache.maven.plugins + maven-antrun-plugin + + + + + diff --git a/docs/src/main/asciidoc/README.adoc b/docs/src/main/asciidoc/README.adoc index b2e0ac47..27561297 100644 --- a/docs/src/main/asciidoc/README.adoc +++ b/docs/src/main/asciidoc/README.adoc @@ -82,3 +82,5 @@ approach of generating documentation just add these plugins to your `docs` modul <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 + +IMPORTANT: The order of plugin declaration is important! \ No newline at end of file diff --git a/pom.xml b/pom.xml index 36b711ea..f093c542 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,7 @@ ${project.artifactId} 1.5.7.BUILD-SNAPSHOT 1.3.5.BUILD-SNAPSHOT + ${project.build.directory}/build-docs jacoco @@ -452,6 +453,9 @@ limitations under the License. true + + false + spring-milestones @@ -478,6 +482,9 @@ limitations under the License. true + + false + spring-milestones @@ -487,6 +494,14 @@ limitations under the License. false + + spring-releases + Spring Releases + https://repo.spring.io/libs-release-local + + false + + @@ -652,7 +667,7 @@ limitations under the License. sources jar false - ${project.build.directory}/build-docs + ${docs.resources.dir} @@ -722,10 +737,10 @@ limitations under the License. ${docs.main}.xml true false - ${project.build.directory}/build-docs/docbook/xsl/pdf.xsl + ${docs.resources.dir}/docbook/xsl/pdf.xsl 1 1 - ${project.build.directory}/build-docs/docbook/xsl/xslthl-config.xml + ${docs.resources.dir}/docbook/xsl/xslthl-config.xml @@ -750,7 +765,7 @@ limitations under the License. prepare-package - ${project.build.directory}/build-docs/docbook/xsl/html-singlepage.xsl + ${docs.resources.dir}/docbook/xsl/html-singlepage.xsl ${basedir}/target/docbook/htmlsingle @@ -759,7 +774,7 @@ limitations under the License. - + @@ -776,7 +791,7 @@ limitations under the License. prepare-package - ${project.build.directory}/build-docs/docbook/xsl/html-multipage.xsl + ${docs.resources.dir}/docbook/xsl/html-multipage.xsl ${basedir}/target/docbook/html multi_ @@ -788,7 +803,7 @@ limitations under the License. - + @@ -852,7 +867,7 @@ limitations under the License. - + @@ -868,10 +883,10 @@ limitations under the License. - + - +