[releng] Add R-build with p2.statsURI, p2.mirrorsURL, avoid absolute P2
references
diff --git a/releng/org.eclipse.ocl.releng.build-site/downloads.sh b/releng/org.eclipse.ocl.releng.build-site/downloads.sh
index d0091d4..dc438d8 100644
--- a/releng/org.eclipse.ocl.releng.build-site/downloads.sh
+++ b/releng/org.eclipse.ocl.releng.build-site/downloads.sh
@@ -1,6 +1,6 @@
 #!/bin/bash -xv
 #*******************************************************************************
-# Copyright (c) 2018 Willink Transformations and others.
+# Copyright (c) 2018, 2019 Willink Transformations and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v2.0
 # which accompanies this distribution, and is available at
@@ -12,13 +12,13 @@
 #
 #	Promote the PUBLISH__URL to the downloads 'page'.
 #
-#	PUBLISH__URL			The zip to be published e.g. https://ci.eclipse.org/ocl/job/ocl-master/38/artifact/releng/org.eclipse.ocl.releng.build-site/target/org.eclipse.ocl-6.5.0.v20171021-1702.zip
-#	PUBLISH__VERSION		Unqualified version e.g. 6.5.0
-#	PUBLISH__BUILD_T		Build type N/I/S, blank suppresses promotion
-#	PUBLISH__QUALIFIER		Version qualifier e.g. v20171020-1234
-#	PUBLISH__ALIAS			Non blank to use alias as part of final name
-#	PUBLISH__JAVADOC		The optional Javadoc zip to be published e.g. https://ci.eclipse.org/ocl/job/ocl-master/38/artifact/releng/org.eclipse.ocl.releng.build-site/target/OCL-javadoc.zip
-#	PUBLISH__PDFDOC			The optional PDF doc to be published e.g. https://ci.eclipse.org/ocl/job/ocl-master/38/artifact/releng/org.eclipse.ocl.releng.build-site/target/ocl.pdf
+#	-u PUBLISH__URL			The zip to be published e.g. https://ci.eclipse.org/ocl/job/ocl-master/38/artifact/releng/org.eclipse.ocl.releng.build-site/target/org.eclipse.ocl-6.5.0.v20171021-1702.zip
+#	-v PUBLISH__VERSION		Unqualified version e.g. 6.5.0
+#	-t PUBLISH__BUILD_T		Build type N/I/S/R, blank suppresses promotion
+#	-q PUBLISH__QUALIFIER		Version qualifier e.g. v20171020-1234
+#	-a PUBLISH__ALIAS			Non blank to use alias as part of final name
+#	-j PUBLISH__JAVADOC		The optional Javadoc zip to be published e.g. https://ci.eclipse.org/ocl/job/ocl-master/38/artifact/releng/org.eclipse.ocl.releng.build-site/target/OCL-javadoc.zip
+#	-p PUBLISH__PDFDOC			The optional PDF doc to be published e.g. https://ci.eclipse.org/ocl/job/ocl-master/38/artifact/releng/org.eclipse.ocl.releng.build-site/target/ocl.pdf
 #
 dropsFolder="/home/data/httpd/download.eclipse.org/modeling/mdt/ocl/downloads/drops/"
 javadocFolder="/home/data/httpd/download.eclipse.org/ocl/javadoc/"
@@ -28,6 +28,20 @@
 localZip="newJavadoc.zip"
 pdfName="ocl.pdf"
 
+while getopts u:v:t:q:a:j:p: option
+do
+case "${option}"
+in
+u) PUBLISH__URL=${OPTARG};;
+v) PUBLISH__VERSION=${OPTARG};;
+t) PUBLISH__BUILD_T=${OPTARG};;
+q) PUBLISH__QUALIFIER=${OPTARG};;
+a) PUBLISH__ALIAS=${OPTARG};;
+j) PUBLISH__JAVADOC=${OPTARG};;
+p) PUBLISH__PDFDOC=${OPTARG};;
+esac
+done
+
 if [ -n "${PUBLISH__BUILD_T}" ]
 then
 
diff --git a/releng/org.eclipse.ocl.releng.build-site/updates.sh b/releng/org.eclipse.ocl.releng.build-site/updates.sh
index b7536d8..71cbbc5 100644
--- a/releng/org.eclipse.ocl.releng.build-site/updates.sh
+++ b/releng/org.eclipse.ocl.releng.build-site/updates.sh
@@ -1,6 +1,6 @@
 #!/bin/bash -xv
 #*******************************************************************************
-# Copyright (c) 2018 Willink Transformations and others.
+# Copyright (c) 2018, 2019 Willink Transformations and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v2.0
 # which accompanies this distribution, and is available at
@@ -12,17 +12,28 @@
 #
 #    Promote the PUBLISH__URL to an updates repository.
 #
-#    PUBLISH__URL            The zip to be published e.g. https://ci.eclipse.org/ocl/job/ocl-master/38/artifact/releng/org.eclipse.ocl.releng.build-site/target/org.eclipse.ocl-6.5.0.v20171021-1702.zip
-#    PUBLISH__VERSION        Unqualified version e.g. 6.5.0
-#    PUBLISH__BUILD_T        Build type N/I/S, blank suppresses promotion
-#    PUBLISH__QUALIFIER      Version qualifier e.g. v20171020-1234
+#    -u PUBLISH__URL            The zip to be published e.g. https://ci.eclipse.org/ocl/job/ocl-master/38/artifact/releng/org.eclipse.ocl.releng.build-site/target/org.eclipse.ocl-6.5.0.v20171021-1702.zip
+#    -v PUBLISH__VERSION        Unqualified version e.g. 6.5.0
+#    -t PUBLISH__BUILD_T        Build type N/I/S/R, blank suppresses promotion
+#    -q PUBLISH__QUALIFIER      Version qualifier e.g. v20171020-1234
 #
 updatesFolder="/home/data/httpd/download.eclipse.org/modeling/mdt/ocl/updates/"
 group="modeling.mdt.ocl"
 localZip="ocl.zip"
 projectRepoName="OCL"
 manageComposite="/shared/common/apache-ant-latest/bin/ant -f /shared/modeling/tools/promotion/manage-composite.xml"
-externalUpdatesFolder="http://download.eclipse.org/modeling/mdt/ocl/updates/"
+externalUpdatesFolder="https://download.eclipse.org/modeling/mdt/ocl/updates/"
+
+while getopts u:v:t:q: option
+do
+case "${option}"
+in
+u) PUBLISH__URL=${OPTARG};;
+v) PUBLISH__VERSION=${OPTARG};;
+t) PUBLISH__BUILD_T=${OPTARG};;
+q) PUBLISH__QUALIFIER=${OPTARG};;
+esac
+done
 
 if [ -n "${PUBLISH__BUILD_T}" ]
 then
@@ -32,20 +43,25 @@
   then
     buildFolder="${updatesFolder}nightly"
     buildRepoName="Nightly"
-    externalFolder="${externalUpdatesFolder}nightly/${PUBLISH__VERSION}"
+    latestRelativeReference="../${PUBLISH__VERSION}"
   elif [ "${PUBLISH__BUILD_T}" = "I" ]
   then
     buildFolder="${updatesFolder}interim"
     buildRepoName="Interim"
-    externalFolder="${externalUpdatesFolder}interim/${PUBLISH__VERSION}"
+    latestRelativeReference="../${PUBLISH__VERSION}"
   elif [ "${PUBLISH__BUILD_T}" = "S" ]
   then
     buildFolder="${updatesFolder}milestones"
     buildRepoName="Milestones"
-    externalFolder="${externalUpdatesFolder}milestones/${PUBLISH__VERSION}/${tQualifier}"
+    latestRelativeReference="../${PUBLISH__VERSION}/${tQualifier}"
+  elif [ "${PUBLISH__BUILD_T}" = "R" ]
+  then
+    buildFolder="${updatesFolder}releases"
+    buildRepoName="Releases"
+    latestRelativeReference="../${PUBLISH__VERSION}"
   else
     buildFolder="${updatesFolder}other"
-    externalFolder="${externalUpdatesFolder}other/${PUBLISH__VERSION}"
+    latestRelativeReference="../${PUBLISH__VERSION}"
     buildRepoName="Other"
   fi
 
@@ -98,12 +114,21 @@
         chmod -R g+w ${tQualifier}
         ${manageComposite} add -Dchild.repository=${tQualifier} -Dcomposite.name="${projectRepoName} ${PUBLISH__VERSION} ${buildRepoName} Repository"
       popd
+    elif [ "${PUBLISH__BUILD_T}" = "R" ]
+    then
+      curl -s -k ${PUBLISH__URL} > ${localZip}
+      unzip -ou ${localZip} -d new${PUBLISH__VERSION}
+      chgrp -R ${group} new${PUBLISH__VERSION}
+      chmod -R g+w new${PUBLISH__VERSION}
+      mv ${PUBLISH__VERSION} old${PUBLISH__VERSION}
+      mv new${PUBLISH__VERSION} ${PUBLISH__VERSION}
+      rm -rf old${PUBLISH__VERSION} ${localZip}
 
     fi
 
     mkdir ${buildFolder}/newlatest
     pushd ${buildFolder}/newlatest
-      ${manageComposite} add -Dchild.repository=${externalFolder} -Dcomposite.name="${projectRepoName} Latest ${PUBLISH__VERSION} ${buildRepoName} Repository"
+      ${manageComposite} add -Dchild.repository=${latestRelativeReference} -Dcomposite.name="${projectRepoName} Latest ${PUBLISH__VERSION} ${buildRepoName} Repository"
     popd
     if [ -d "latest" ]
     then
diff --git a/releng/org.eclipse.ocl.releng.tycho/.launches/Build OCL Distribution - Release.launch b/releng/org.eclipse.ocl.releng.tycho/.launches/Build OCL Distribution - Release.launch
new file mode 100644
index 0000000..04ddf52
--- /dev/null
+++ b/releng/org.eclipse.ocl.releng.tycho/.launches/Build OCL Distribution - Release.launch
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>

+<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">

+<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>

+<stringAttribute key="M2_GOALS" value="clean verify"/>

+<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>

+<booleanAttribute key="M2_OFFLINE" value="false"/>

+<stringAttribute key="M2_PROFILES" value="release"/>

+<listAttribute key="M2_PROPERTIES"/>

+<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>

+<booleanAttribute key="M2_SKIP_TESTS" value="false"/>

+<intAttribute key="M2_THREADS" value="1"/>

+<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>

+<stringAttribute key="M2_USER_SETTINGS" value=""/>

+<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>

+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>

+<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/org.eclipse.ocl.releng.tycho}"/>

+</launchConfiguration>

diff --git a/releng/org.eclipse.ocl.releng.tycho/README.txt b/releng/org.eclipse.ocl.releng.tycho/README.txt
index 7f3f5d6..e33e3ef 100644
--- a/releng/org.eclipse.ocl.releng.tycho/README.txt
+++ b/releng/org.eclipse.ocl.releng.tycho/README.txt
@@ -1,28 +1,41 @@
 The Tycho build automatically promotes downloads and updates, so no cron job help is necessary.
+The Tycho build minimises the need for shell activity by auto-registering in P2 repos including the latest.
+
+The ocl.aggrcon file is in the ssh://'committer-name'@git.eclipse.org:29418/simrel/org.eclipse.simrel.build.git repo.
 
 The updates can be checked by looking for the new entry on http://www.eclipse.org/modeling/mdt/downloads/?project=ocl
 or installing new software from e.g. http://download.eclipse.org/modeling/mdt/ocl/updates/milestones/6.9.0/S201408191307
+or installing new software from e.g. http://download.eclipse.org/modeling/mdt/ocl/updates/releases/6.9.0/
 
-However operations on composite repositories are not automated, partly because they are sufficiently important to deserve manual attention. 
-
-A new milestone build can be added to the composite repository by:
+A new milestone build was formerly manually added to the composite repository by:
 
 logon to build.eclipse.org
 cd ~/downloads/modeling/mdt/ocl/updates/milestones/6.9.0
 ant -f /shared/modeling/tools/promotion/manage-composite.xml add -Dchild.repository=S201408191307 [ -Dcomposite.name="OCL 6.9.0 milestones" ]
 
-(This can be checked by installing new software from e.g. http://download.eclipse.org/modeling/mdt/ocl/updates/milestones/6.9.0)
-
 The SimRel aggregator is configured by GIT\org.eclipse.simrel.build\ocl.aggrcon to use an explicit milestone entry
 
 So edit ocl.aggrcon to update 
 location="http://download.eclipse.org/modeling/mdt/ocl/updates/milestones/6.9.0/S201408191307"
-commit with a comment such as [ocl] 6.9.0M1 for 2019-03 and Push to Gerrit (refs/for/master)
-Browse the Gerrit change in the dialog response or find the job and so Gerrit change via https://ci.eclipse.org/simrel/job/simrel.runaggregator.VALIDATE.gerrit/
-Login to Gerrit, (Eclipse user name + password), and once the (refreshed) Gerrit provides a Code-Review+2 button, click it, then click Submit. Chnage should show as successfully merged.
+commit with a comment such as [ocl] 6.9.0M1 for 2019-09 and Push to Gerrit (refs/for/master)
+The Push dialog identifies a Gerrit such as https://git.eclipse.org/r/149210
+Open the Gerrit, Open the Buld job and its console
+When the build succeeds, refresh the Gerrit, Click CodeReview+2, Click Submit.
+Refresh 
 
-Once a release has been promoted update ocl.aggrcon to the final release
-location="http://download.eclipse.org/modeling/mdt/ocl/updates/releases/6.9.0"
+RC builds are just aliases for regular S builds.
+The final R build rebuilds the final RC build and is built as late as possible for contribution to the final SimRel build.
+For the R  build update qvtd.aggrcon to
+location="http://download.eclipse.org/modeling/mdt/ocl/updates/releases/3.10.0"
+
+After a few hours the mirrors can be checked by:
+https://www.eclipse.org/downloads/download.php?file=/modeling/mdt/ocl/updates/releases/6.9.0&format=xml
+
+Disable the Promoter job until GIT has been updated for the next release number.
+
+After each first repo contribution, remember to update the aggregates e.g.
+cd ~/downloads/modeling/mdt/ocl/updates/milestones
+ant -f /shared/modeling/tools/promotion/manage-composite.xml add -Dchild.repository=6.9.0
 
 Downloads are accessible at
 cd ~/downloads/modeling/mdt/ocl/downloads/drops/6.9.0
diff --git a/releng/org.eclipse.ocl.releng.tycho/pom.xml b/releng/org.eclipse.ocl.releng.tycho/pom.xml
index 82ebebb..30c794c 100644
--- a/releng/org.eclipse.ocl.releng.tycho/pom.xml
+++ b/releng/org.eclipse.ocl.releng.tycho/pom.xml
@@ -10,6 +10,9 @@
 <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <modelVersion>4.0.0</modelVersion>
+  <prerequisites>
+    <maven>3.0</maven>
+  </prerequisites>
   <groupId>org.eclipse.ocl</groupId>
   <artifactId>org.eclipse.ocl.releng.tycho</artifactId>
   <version>6.9.0-SNAPSHOT</version>
@@ -64,7 +67,7 @@
     <maven-resources-version>2.6</maven-resources-version>
     <maven-site-version>3.4</maven-site-version>
     <maven-surefire-version>2.17</maven-surefire-version>
-    <tycho-version>1.3.0</tycho-version>
+    <tycho-version>1.4.0</tycho-version>
     <tycho-extras-version>${tycho-version}</tycho-extras-version>
     
     <BUILD_ALIAS></BUILD_ALIAS>
@@ -182,11 +185,11 @@
               <ws>win32</ws>
               <arch>x86_64</arch>
             </environment>
-            <environment>
+            <!--environment>
               <os>linux</os>
               <ws>gtk</ws>
               <arch>x86</arch>
-            </environment>
+            </environment-->
             <environment>
               <os>linux</os>
               <ws>gtk</ws>
@@ -238,22 +241,6 @@
             <goals>
               <goal>source-feature</goal>
             </goals>
-            <configuration>
-              <excludes>
-              <!-- The following source features are manually included by some 
-              coordination features. We prevent to look for a "source of sources" -->
-                <feature id="org.eclipse.ocl.all.source"/>
-                <feature id="org.eclipse.ocl.all.sdk.source"/>
-                <feature id="org.eclipse.ocl.doc.source"/>
-                <feature id="org.eclipse.ocl.edit.source"/>
-                <feature id="org.eclipse.ocl.examples.classic.source"/>
-                <feature id="org.eclipse.ocl.examples.unified.source"/>
-                <feature id="org.eclipse.ocl.examples.source"/>
-                <feature id="org.eclipse.ocl.ui.source"/>
-                <feature id="org.eclipse.ocl.unified.core.source"/>
-                <feature id="org.eclipse.ocl.unified.ui.source"/>
-              </excludes>
-            </configuration>
           </execution>
         </executions>
       </plugin>
@@ -471,9 +458,9 @@
           <version>2.10.3</version>
           <configuration>
             <sourceFileIncludes>
-              <sourceFileInclude>org/eclipse/m2m/qvt/oml/**/*.java</sourceFileInclude>
+              <sourceFileInclude>org/eclipse/ocl/**/*.java</sourceFileInclude>
             </sourceFileIncludes>
-            <doctitle>QVTo Interim API</doctitle>
+            <doctitle>OCL Interim API</doctitle>
           </configuration>
         </plugin-->
       </plugins>
@@ -522,7 +509,6 @@
         <buildType>S</buildType>
         <targetPlatform>targetPlatforms/stable</targetPlatform>
       </properties>
-    
       <!--properties>
         <cbi-jdt-repo.url>https://repo.eclipse.org/content/repositories/eclipse-staging/</cbi-jdt-repo.url>
         <!- - jdt.core and jdt.compiler.apt should "match", come from same build, and be signed
@@ -532,6 +518,30 @@
       </properties-->
     </profile>
     <profile>
+      <id>release</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+      </activation>
+      <properties>
+        <buildType>R</buildType>
+        <targetPlatform>targetPlatforms/stable</targetPlatform>
+      </properties>
+       <build>
+        <plugins>
+          <plugin>
+            <groupId>org.eclipse.tycho</groupId>
+            <artifactId>tycho-p2-repository-plugin</artifactId>
+            <configuration>
+              <extraArtifactRepositoryProperties>
+                <p2.statsURI>http://download.eclipse.org/stats/modeling/mdt/ocl/updates/releases/${unqualifiedVersion}</p2.statsURI>
+                <p2.mirrorsURL>http://www.eclipse.org/downloads/download.php?file=/modeling/mdt/ocl/updates/releases/${unqualifiedVersion}&amp;format=xml</p2.mirrorsURL>
+              </extraArtifactRepositoryProperties>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
       <id>oxygen</id>
       <activation>
         <activeByDefault>false</activeByDefault>