Always include documention in the build
By default run AsciiDoc and package the documentation as part of the WAR. This ensures the default `mvn package` will include user documentation, as folks have come to expect it to exist in builds. If AsciiDoc is not available documentation can be skipped by passing -Dgerrit.documentation.skip=true on the command line. This naming convention matches with -Dmaven.test.skip=true as a way to avoid running unit tests. Change-Id: Ic433c5bb291c9abb48117d61c2eabc031a5c5ca0
This commit is contained in:
@@ -242,7 +242,7 @@ limitations under the License.
|
|||||||
<id>include-documentation</id>
|
<id>include-documentation</id>
|
||||||
<phase>process-classes</phase>
|
<phase>process-classes</phase>
|
||||||
<configuration>
|
<configuration>
|
||||||
<target if="gerrit.include-documentation">
|
<target unless="gerrit.documentation.skip">
|
||||||
<property name="src" location="${basedir}/../Documentation" />
|
<property name="src" location="${basedir}/../Documentation" />
|
||||||
<property name="out" location="${project.build.directory}/${project.build.finalName}" />
|
<property name="out" location="${project.build.directory}/${project.build.finalName}" />
|
||||||
<property name="dst" location="${out}/Documentation" />
|
<property name="dst" location="${out}/Documentation" />
|
||||||
@@ -269,7 +269,7 @@ limitations under the License.
|
|||||||
<id>include-release-notes</id>
|
<id>include-release-notes</id>
|
||||||
<phase>process-classes</phase>
|
<phase>process-classes</phase>
|
||||||
<configuration>
|
<configuration>
|
||||||
<target if="gerrit.include-documentation">
|
<target unless="gerrit.documentation.skip">
|
||||||
<property name="src" location="${basedir}/../ReleaseNotes" />
|
<property name="src" location="${basedir}/../ReleaseNotes" />
|
||||||
<property name="out" location="${project.build.directory}/${project.build.finalName}" />
|
<property name="out" location="${project.build.directory}/${project.build.finalName}" />
|
||||||
<property name="dst" location="${out}/ReleaseNotes" />
|
<property name="dst" location="${out}/ReleaseNotes" />
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
include_docs=-Dgerrit.include-documentation=1
|
flags=-Pall
|
||||||
|
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--no-documentation|--without-documentation)
|
--no-documentation|--without-documentation)
|
||||||
include_docs=
|
flags="$flags -Dgerrit.documentation.skip=true"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -24,19 +24,8 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if test -n "$include_docs"
|
|
||||||
then
|
|
||||||
BINARY=asciidoc
|
|
||||||
if ! command -v $BINARY >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
echo >&2 "error: $BINARY executable was not found. Either install $BINARY or use the --without-documentation option"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
./tools/version.sh --release &&
|
./tools/version.sh --release &&
|
||||||
mvn clean install $include_docs -P all
|
mvn clean install $flags
|
||||||
rc=$?
|
rc=$?
|
||||||
./tools/version.sh --reset
|
./tools/version.sh --reset
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user