Browse Source

fixed issue with mwe2 when running from different directories

Kenneth Lausdahl 7 years ago
parent
commit
0a081b7e41

+ 0 - 60
DSL_SemanticAdaptation/Jenkinsfile

@@ -1,60 +0,0 @@
-node {
-  try
-  {
-    // Mark the code checkout 'stage'....
-    stage 'Checkout'
-    checkout scm
-
-
-    stage ('Clean'){
-      withMaven(mavenLocalRepo: '.repository', mavenSettingsFilePath: "${env.MVN_SETTINGS_PATH}") {
-
-        // Run the maven build
-        sh "mvn clean -PWith-IDE -Dtycho.mode=maven -fn"
-      }}
-
-    stage ('Compile core'){
-      withMaven(mavenLocalRepo: '.repository', mavenSettingsFilePath: "${env.MVN_SETTINGS_PATH}") {
-
-        // Run the maven build
-        sh "mvn compile"
-      }}
-
-    stage ('Package core'){
-      withMaven(mavenLocalRepo: '.repository', mavenSettingsFilePath: "${env.MVN_SETTINGS_PATH}") {
-
-        // Run the maven build
-        sh "mvn package"
-        step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true])
-        step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
-        step([$class: 'JacocoPublisher', exclusionPattern: '**/org/overture/ast/analysis/**/*.*, **/org/overture/ast/expressions/**/*.*, **/org/overture/ast/modules/**/*.*, **/org/overture/ast/node/**/*.*,**/org/overture/ast/patterns/**/*.*, **/org/overture/ast/statements/**/*.*, **/org/overture/ast/types/**/*.*, **/org/overture/codegen/ir/**/*, **/org/overture/ide/**/*'])
-
-        step([$class: 'TasksPublisher', canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', high: 'FIXME', ignoreCase: true, low: '', normal: 'TODO', pattern: '', unHealthy: ''])
-      }}
-
-    stage ('Install IDE'){
-      withMaven(mavenLocalRepo: '.repository', mavenSettingsFilePath: "${env.MVN_SETTINGS_PATH}") {
-
-        // Run the maven build
-        sh "mvn install -PWith-IDE -Pall-platforms -P!linux64 -DexternalTestsPath=$OVERTURE_EXTERNAL_TEST_ROOT -P!ui-tests -Pforce-download-externals -Pcodesigning"
-        step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true])
-        step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
-        step([$class: 'JacocoPublisher', exclusionPattern: '**/org/overture/ast/analysis/**/*.*, **/org/overture/ast/expressions/**/*.*, **/org/overture/ast/modules/**/*.*, **/org/overture/ast/node/**/*.*,**/org/overture/ast/patterns/**/*.*, **/org/overture/ast/statements/**/*.*, **/org/overture/ast/types/**/*.*, **/org/overture/codegen/ir/**/*, **/org/overture/ide/**/*'])
-
-        step([$class: 'TasksPublisher', canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', high: 'FIXME', ignoreCase: true, low: '', normal: 'TODO', pattern: '', unHealthy: ''])
-      }}
-  } catch (any) {
-    currentBuild.result = 'FAILURE'
-    throw any //rethrow exception to prevent the build from proceeding
-  } finally {
-  
-    stage('Reporting'){
-
-
-      // Notify on build failure using the Email-ext plugin
-//      emailext(body: '${DEFAULT_CONTENT}', mimeType: 'text/html',
-//               replyTo: '$DEFAULT_REPLYTO', subject: '${DEFAULT_SUBJECT}',
-//               to: emailextrecipients([[$class: 'CulpritsRecipientProvider'],
-//                                       [$class: 'RequesterRecipientProvider']]))
-//    }}
-}

+ 6 - 1
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation/pom.xml

@@ -14,6 +14,11 @@
 
 	<name>be.uantwerpen.ansymo.semanticadaptation Language Core</name>
 
+<properties>
+    <main.basedir>${project.parent.basedir}</main.basedir>
+</properties>
+
+
 	<build>
 		<plugins>
 			
@@ -67,7 +72,7 @@
 							-p
 						</argument>
 						<argument>
-							runtimeProject=/${project.basedir}
+							runtimeProject=${main.basedir}
 						</argument>
 					</arguments>
 				</configuration>

+ 2 - 1
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation/src/be/uantwerpen/ansymo/semanticadaptation/GenerateSemanticAdaptation.mwe2

@@ -3,7 +3,8 @@ module be.uantwerpen.ansymo.semanticadaptation.GenerateSemanticAdaptation
 import org.eclipse.xtext.xtext.generator.*
 import org.eclipse.xtext.xtext.generator.model.project.*
 
-var rootPath = "."
+var runtimeProject = "."
+var rootPath = "${runtimeProject}"
 
 Workflow {
 	

+ 2 - 0
DSL_SemanticAdaptation/pom.xml

@@ -25,6 +25,8 @@
 		<tycho-version>1.0.0</tycho-version>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<xtext.version>2.11.0</xtext.version>
+
+ <main.basedir>${project.basedir}</main.basedir>
 	</properties>
 
 	<repositories>

+ 42 - 0
Jenkinsfile

@@ -0,0 +1,42 @@
+node {
+  try
+  {
+    // Mark the code checkout 'stage'....
+    stage 'Checkout'
+    checkout scm
+
+
+    stage ('Clean'){
+      withMaven(mavenLocalRepo: '.repository', mavenSettingsFilePath: "${env.MVN_SETTINGS_PATH}") {
+
+        // Run the maven build
+        sh "mvn clean -PWith-IDE -Dtycho.mode=maven -fn -f DSL_SemanticAdaptation/pom.xml"
+      }}
+
+    stage ('Package install'){
+      withMaven(mavenLocalRepo: '.repository', mavenSettingsFilePath: "${env.MVN_SETTINGS_PATH}") {
+
+        // Run the maven build
+        sh "mvn package -f DSL_SemanticAdaptation/pom.xml"
+        step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true])
+        step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
+        step([$class: 'JacocoPublisher')
+
+        step([$class: 'TasksPublisher', canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', high: 'FIXME', ignoreCase: true, low: '', normal: 'TODO', pattern: '', unHealthy: ''])
+      }}
+
+  } catch (any) {
+    currentBuild.result = 'FAILURE'
+    throw any //rethrow exception to prevent the build from proceeding
+  } finally {
+  
+    stage('Reporting'){
+
+
+      // Notify on build failure using the Email-ext plugin
+//      emailext(body: '${DEFAULT_CONTENT}', mimeType: 'text/html',
+//               replyTo: '$DEFAULT_REPLYTO', subject: '${DEFAULT_SUBJECT}',
+//               to: emailextrecipients([[$class: 'CulpritsRecipientProvider'],
+//                                       [$class: 'RequesterRecipientProvider']]))
+//    }}
+}