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 2018/07/18 22:51:01 UTC

[isis] 05/05: ISIS-1810: recreating simpleapp archetype

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 85cb362e08811fe76db61d5948fa3d4344b98fcf
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jul 19 00:48:49 2018 +0200

    ISIS-1810: recreating simpleapp archetype
---
 .../simpleapp/src/main/resources/archetype-resources/pom.xml  |  4 ++--
 .../src/test/resources/projects/basic/archetype.properties    |  2 +-
 scripts/updateGeneratedArchetypeSources.groovy                | 11 ++++++++++-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
index 6a7e5dc..2404a4b 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
@@ -26,11 +26,11 @@
   </parent>
   <groupId>${groupId}</groupId>
   <artifactId>${artifactId}</artifactId>
-  <version>${version}</version>
+  <version>${revision}</version>
   <name>Apache Isis App - SimpleApp Parent</name>
   <packaging>pom</packaging>
   <properties>
-    <revision>0.0.1-SNAPSHOT</revision>
+    <revision>${version}</revision>
     <isis.version>2.0.0-M1</isis.version>
     <lombok.version>[1.18,)</lombok.version>
     <compiler-plugin.source>1.8</compiler-plugin.source>
diff --git a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
index 3c2332a..1ec5147 100644
--- a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
+++ b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
@@ -1,4 +1,4 @@
-#Thu Jul 19 00:37:12 CEST 2018
+#Thu Jul 19 00:48:43 CEST 2018
 package=it.pkg
 version=0.1-SNAPSHOT
 groupId=archetype.it
diff --git a/scripts/updateGeneratedArchetypeSources.groovy b/scripts/updateGeneratedArchetypeSources.groovy
index 357af14..b4018dc 100644
--- a/scripts/updateGeneratedArchetypeSources.groovy
+++ b/scripts/updateGeneratedArchetypeSources.groovy
@@ -122,7 +122,16 @@ println "updating ${resourcePomXmlFile.path}"
 
 def resourcePomXml = new XmlSlurper(false,false).parseText(resourcePomXmlFile.text)
 
-resourcePomXml.properties.revision='0.0.1-SNAPSHOT'
+
+// this looks weird, but trust me, it's correct
+
+// version is set to the (in-effect) hard-coded string '${revision}'.  This is resolved when the app generated
+// from the archetype is built, eg with mvn -Drevision=...; it will fall back to the properties/revision.
+resourcePomXml.version='${revision}'
+// the properties.revision, meanwhile, is set to the version that is prompted for when the
+// app is first generated from the archetype
+resourcePomXml.properties.revision='${version}'
+
 resourcePomXml.properties['isis.version']=isis_version
 
 resourcePomXmlFile.text = withLicense(resourcePomXml)