You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2019/11/21 00:30:11 UTC
[isis] 01/09: ISIS-2181: simplies build scripts,
only call mvn versions:set if $REVISION is set.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch ISIS-2181
in repository https://gitbox.apache.org/repos/asf/isis.git
View the commit online:
https://github.com/apache/isis/commit/4735eac0c98b4a35b0b1a5cfa7ca5ca81c99beea
commit 4735eac0c98b4a35b0b1a5cfa7ca5ca81c99beea
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Nov 20 21:39:01 2019 +0000
ISIS-2181: simplies build scripts, only call mvn versions:set if $REVISION is set.
This allows core-parent/pom.xml to be simplified
---
core-parent/pom.xml | 37 +++++++++++++++++--------------------
scripts/ci/build-core.sh | 10 +++++-----
scripts/ci/build-demo-app.sh | 22 +++++++++-------------
scripts/ci/build-site.sh | 4 ++--
scripts/ci/build-starter-apps.sh | 21 +++++++++------------
5 files changed, 42 insertions(+), 52 deletions(-)
diff --git a/core-parent/pom.xml b/core-parent/pom.xml
index 2b59fb6..f1a0e0a 100644
--- a/core-parent/pom.xml
+++ b/core-parent/pom.xml
@@ -31,16 +31,6 @@ under the License.
then the original from org.apache:apache have been commented out.
-->
- <!-- APACHE ISIS customisation 1/6: start -->
-
- <!-- NB: <groupId> must come before the <parent>, because the
- build scripts grep for the version as a fallback -->
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-parent</artifactId>
- <version>2.0.0-M3-SNAPSHOT</version>
- <packaging>pom</packaging>
- <!-- APACHE ISIS customisation 1/6: end -->
-
<!-- for more information, see the documentation of this POM: http://maven.apache.org/pom/asf/ -->
<!-- ORG.APACHE:APACHE : commented out : start
@@ -52,13 +42,20 @@ under the License.
ORG.APACHE:APACHE : commented out : end -->
- <!-- APACHE ISIS customisation 2/6: start -->
+ <!-- APACHE ISIS customisation 1/5: start -->
+
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
</parent>
- <!-- APACHE ISIS customisation 2/6: end -->
+
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-parent</artifactId>
+ <version>2.0.0-M3-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <!-- APACHE ISIS customisation 1/5: end -->
<!-- ORG.APACHE:APACHE : commented out : start
@@ -75,13 +72,13 @@ under the License.
ORG.APACHE:APACHE : commented out : end -->
- <!-- APACHE ISIS customisation 3/6: start -->
+ <!-- APACHE ISIS customisation 2/5: start -->
<name>Apache Isis</name>
<description>Parent for the core framework + extensions, starter parent pom for starter apps.</description>
<url>https://isis.apache.org</url>
<inceptionYear>2010</inceptionYear>
- <!-- APACHE ISIS customisation 3/6: end -->
+ <!-- APACHE ISIS customisation 2/5: end -->
<organization>
<name>The Apache Software Foundation</name>
@@ -114,7 +111,7 @@ under the License.
</scm>
ORG.APACHE:APACHE : commented out : end -->
- <!-- APACHE ISIS customisation 4/6: start -->
+ <!-- APACHE ISIS customisation 3/5: start -->
<mailingLists>
<mailingList>
<name>developers</name>
@@ -272,7 +269,7 @@ under the License.
<timezone>+3</timezone>
</developer>
</developers>
- <!-- APACHE ISIS customisation 4/6: end -->
+ <!-- APACHE ISIS customisation 3/5: end -->
<distributionManagement>
<repository>
@@ -488,7 +485,7 @@ under the License.
<artifactId>apache-rat-plugin</artifactId>
<version>0.12</version>
- <!-- APACHE ISIS customisation 5/6: start -->
+ <!-- APACHE ISIS customisation 4/5: start -->
<configuration>
<addDefaultLicenseMatchers>true</addDefaultLicenseMatchers>
<excludeSubProjects>true</excludeSubProjects>
@@ -594,7 +591,7 @@ under the License.
</licenseFamily>
</licenseFamilies>
</configuration>
- <!-- APACHE ISIS customisation 5/6: end -->
+ <!-- APACHE ISIS customisation 4/5: end -->
</plugin>
@@ -778,7 +775,7 @@ under the License.
</profile>
<!-- END SNIPPET: release-profile -->
- <!-- APACHE ISIS customisation 6/6: start -->
+ <!-- APACHE ISIS customisation 5/5: start -->
<profile>
<id>gcpappenginerepo-deploy</id>
<activation>
@@ -845,7 +842,7 @@ under the License.
<module>../examples/apps/simpleapp</module>
</modules>
</profile>
- <!-- APACHE ISIS customisation 6/6: end -->
+ <!-- APACHE ISIS customisation 5/5: end -->
</profiles>
</project>
diff --git a/scripts/ci/build-core.sh b/scripts/ci/build-core.sh
index ac7ad63..ccadc26 100644
--- a/scripts/ci/build-core.sh
+++ b/scripts/ci/build-core.sh
@@ -23,19 +23,19 @@ sh $SCRIPT_DIR/print-environment.sh "build-core"
cd $PROJECT_ROOT_PATH/core-parent
-if [ -z "$REVISION" ]; then
- REVISION=$(grep "<version>" pom.xml | head -1 | cut -d">" -f2 | cut -d"<" -f1)
+if [ ! -z "$REVISION" ]; then
+ mvn versions:set -DnewVersion=$REVISION
fi
-mvn versions:set -DnewVersion=$REVISION -Drevision=$REVISION
mvn -s $SETTINGS_XML \
--batch-mode \
$MVN_STAGES \
- -Drevision=$REVISION \
-Dskip.assemble-zip \
$MVN_ADDITIONAL_OPTS
-mvn versions:revert -Drevision=$REVISION
+if [ ! -z "$REVISION" ]; then
+ mvn versions:revert
+fi
cd $PROJECT_ROOT_PATH
diff --git a/scripts/ci/build-demo-app.sh b/scripts/ci/build-demo-app.sh
index 6d42cff..2d71605 100644
--- a/scripts/ci/build-demo-app.sh
+++ b/scripts/ci/build-demo-app.sh
@@ -28,16 +28,12 @@ echo ""
#
# update version (but just for the modules we need to build)
#
-cd $PROJECT_ROOT_PATH/core-parent
-
-if [ -z "$REVISION" ]; then
- REVISION=$(grep "<version>" pom.xml | head -1 | cut -d">" -f2 | cut -d"<" -f1)
+if [ ! -z "$REVISION" ]; then
+ cd $PROJECT_ROOT_PATH/core-parent
+ mvn versions:set -DnewVersion=$REVISION -Ddemo-app-modules
+ cd $PROJECT_ROOT_PATH
fi
-mvn versions:set -DnewVersion=$REVISION -Drevision=$REVISION -Ddemo-app-modules
-
-cd $PROJECT_ROOT_PATH
-
#
# now build the apps
#
@@ -46,7 +42,6 @@ do
cd $PROJECT_ROOT_PATH/examples/apps/$app
mvn --batch-mode \
- -Drevision=$REVISION \
clean install \
-Dflavor=$FLAVOR \
-Dskip.git \
@@ -54,7 +49,6 @@ do
-DskipTests
mvn --batch-mode \
- -Drevision=$REVISION \
compile jib:build \
-Dflavor=$FLAVOR \
-Dskip.git \
@@ -67,6 +61,8 @@ done
#
# finally, revert the version
#
-cd $PROJECT_ROOT_PATH/core-parent
-mvn versions:revert -Drevision=$REVISION -Dstarter-apps-modules
-cd $PROJECT_ROOT_PATH
+if [ ! -z "$REVISION" ]; then
+ cd $PROJECT_ROOT_PATH/core-parent
+ mvn versions:revert -Dstarter-apps-modules
+ cd $PROJECT_ROOT_PATH
+fi
diff --git a/scripts/ci/build-site.sh b/scripts/ci/build-site.sh
index 84f8393..295cbe4 100644
--- a/scripts/ci/build-site.sh
+++ b/scripts/ci/build-site.sh
@@ -12,9 +12,9 @@ if [ -z "$REVISION" ]; then
export $(cut -d= -f1 $SHARED_VARS_FILE)
fi
fi
+
if [ -z "$REVISION" ]; then
- echo "\$REVISION is not set" >&2
- exit 1
+ export REVISION="SNAPSHOT"
fi
SITE_CONFIG=$1
diff --git a/scripts/ci/build-starter-apps.sh b/scripts/ci/build-starter-apps.sh
index 6ae75eb..372976c 100644
--- a/scripts/ci/build-starter-apps.sh
+++ b/scripts/ci/build-starter-apps.sh
@@ -21,16 +21,12 @@ sh $SCRIPT_DIR/print-environment.sh "build-starter-apps"
#
# update version (but just for the modules we need to build)
#
-cd $PROJECT_ROOT_PATH/core-parent
-
-if [ -z "$REVISION" ]; then
- REVISION=$(grep "<version>" pom.xml | head -1 | cut -d">" -f2 | cut -d"<" -f1)
+if [ ! -z "$REVISION" ]; then
+ cd $PROJECT_ROOT_PATH/core-parent
+ mvn versions:set -DnewVersion=$REVISION -Drevision=$REVISION -Dstarter-apps-modules
+ cd $PROJECT_ROOT_PATH
fi
-mvn versions:set -DnewVersion=$REVISION -Drevision=$REVISION -Dstarter-apps-modules
-
-cd $PROJECT_ROOT_PATH
-
#
# now build the apps
#
@@ -39,7 +35,6 @@ do
cd $PROJECT_ROOT_PATH/examples/demo/$app
mvn --batch-mode \
- -Drevision=$REVISION \
clean install
cd $PROJECT_ROOT_PATH
@@ -48,6 +43,8 @@ done
#
# finally, revert the version
#
-cd $PROJECT_ROOT_PATH/core-parent
-mvn versions:revert -Drevision=$REVISION -Dstarter-apps-modules
-cd $PROJECT_ROOT_PATH
+if [ ! -z "$REVISION" ]; then
+ cd $PROJECT_ROOT_PATH/core-parent
+ mvn versions:revert -Drevision=$REVISION -Dstarter-apps-modules
+ cd $PROJECT_ROOT_PATH
+fi
\ No newline at end of file