You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2018/12/18 09:53:57 UTC

[sling-tooling-jenkins] branch feature/SLING-7245 updated (ab91e3c -> b019d94)

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

rombert pushed a change to branch feature/SLING-7245
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git.


    from ab91e3c  SLING-7245 - Validate pull requests using Jenkins
     new 68aea3d  SLING-7245 - Validate pull requests using Jenkins
     new b019d94  SLING-7245 - Validate pull requests using Jenkins

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/sling/SlingModuleParser.groovy | 31 +++++++++++++++++++++++++++++++
 vars/slingOsgiBundleBuild.groovy   | 25 +++++--------------------
 2 files changed, 36 insertions(+), 20 deletions(-)
 create mode 100644 src/sling/SlingModuleParser.groovy


[sling-tooling-jenkins] 01/02: SLING-7245 - Validate pull requests using Jenkins

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feature/SLING-7245
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git

commit 68aea3d1887c5f505b767410adde87eff0749206
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Dec 18 00:06:06 2018 +0100

    SLING-7245 - Validate pull requests using Jenkins
    
    Start parsing .sling-module.xml
---
 vars/slingOsgiBundleBuild.groovy | 25 +++++--------------------
 1 file changed, 5 insertions(+), 20 deletions(-)

diff --git a/vars/slingOsgiBundleBuild.groovy b/vars/slingOsgiBundleBuild.groovy
index 92ee5ec..27052ad 100644
--- a/vars/slingOsgiBundleBuild.groovy
+++ b/vars/slingOsgiBundleBuild.groovy
@@ -1,17 +1,8 @@
+import sling.SlingModuleParser;
+
 def call(Map params = [:]) {
     def availableJDKs = [ 8: 'JDK 1.8 (latest)', 9: 'JDK 1.9 (latest)']
     def mvnVersion = 'Maven 3.3.9'
-    // defaults for the build
-    def buildDesc = {
-        jdks: [8],
-        downstreamProjects: [],
-        archivePatterns: [],
-        mavenGoal: 'install',
-        additionalMavenParams: '',
-        rebuildFrequency: '@weekly',
-        enableXvfb: false,
-        enabled: true
-    }
 
     def moduleDir = params.containsKey('moduleDir') ? params.moduleDir : '.'
 
@@ -20,17 +11,11 @@ def call(Map params = [:]) {
         checkout scm
 
         stage('Init') {
+            def parser = new SlingModuleParser('.sling-module.xml')
             if ( fileExists('.sling-module.xml') ) {
-                def overrides = readFile('.sling-module.xml')
-                def slingMod = new XmlParser().parse(overrides)
-                if ( slingMod?.jenkins?.jdks ) {
-                    def jdks = []
-                    slingMod.jenkins.jdks.jdk.each { jdks.add it.text() }
-                    buildDesc.jdks = jdks
-
-                    echo "$Overriding JDKs list to be ${jdks}"
-                }
+                parser.parse()
             }
+            def buildDesc = parser.buildDesc;
         }
 
         buildDesc.jdks.each { jdkVersion -> 


[sling-tooling-jenkins] 02/02: SLING-7245 - Validate pull requests using Jenkins

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feature/SLING-7245
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git

commit b019d9414e84d64b2aa45f430a064148b270a6df
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Dec 18 00:06:06 2018 +0100

    SLING-7245 - Validate pull requests using Jenkins
    
    Extract parsing to a separate class
---
 src/sling/SlingModuleParser.groovy | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/src/sling/SlingModuleParser.groovy b/src/sling/SlingModuleParser.groovy
new file mode 100644
index 0000000..7bcf500
--- /dev/null
+++ b/src/sling/SlingModuleParser.groovy
@@ -0,0 +1,31 @@
+package sling;
+
+class SlingModuleParser {
+
+    def fileName;
+    
+    // defaults for the build
+    def buildDesc = {
+        jdks: [8],
+        downstreamProjects: [],
+        archivePatterns: [],
+        mavenGoal: 'install',
+        additionalMavenParams: '',
+        rebuildFrequency: '@weekly',
+        enableXvfb: false,
+        enabled: true
+    }
+
+    SlingModuleParser(fileName) {
+        this.fileName = fileName;        
+    }
+
+    def parse() {
+        def slingMod = new XmlParser().parse(overrides)
+        if ( slingMod?.jenkins?.jdks ) {
+            def jdks = []
+            slingMod.jenkins.jdks.jdk.each { jdks.add it.text() }
+            buildDesc.jdks = jdks
+        }
+    }
+}
\ No newline at end of file