Browse Source

updated poms for testing and added jenkins file

Kenneth Lausdahl 7 years ago
parent
commit
2674e393b0

+ 60 - 0
DSL_SemanticAdaptation/Jenkinsfile

@@ -0,0 +1,60 @@
+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']]))
+//    }}
+}

+ 0 - 4
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.ide/xtend-gen/.gitignore

@@ -1,4 +0,0 @@
-# Ignore everything in this directory
-*
-# Except this file
-!.gitignore

+ 8 - 0
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.tests/pom.xml

@@ -14,6 +14,8 @@
 
 	<name>be.uantwerpen.ansymo.semanticadaptation Language Tests</name>
 
+
+
 	<build>
 		<plugins>
 			<plugin>
@@ -30,13 +32,19 @@
 				<groupId>org.eclipse.xtend</groupId>
 				<artifactId>xtend-maven-plugin</artifactId>
 			</plugin>
+
+
 			<plugin>
+				<!-- Remember that these tests only run in integration so between package and install http://www.vogella.com/tutorials/EclipseTycho/article.html -->
 				<groupId>org.eclipse.tycho</groupId>
 				<artifactId>tycho-surefire-plugin</artifactId>
 				<version>${tycho-version}</version>
 				<configuration>
 					<useUIHarness>false</useUIHarness>
 					<useUIThread>false</useUIThread>
+					<includes>
+            <include>**/SemanticAdaptationParsingTest.class</include>
+          </includes>
 				</configuration>
 			</plugin>
 		</plugins>

+ 40 - 38
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation/pom.xml

@@ -16,6 +16,7 @@
 
 	<build>
 		<plugins>
+			
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-clean-plugin</artifactId>
@@ -71,46 +72,47 @@
 					</arguments>
 				</configuration>
 				<dependencies>
-					<!--dependency>
+					<!--
+							this plugin is deprecated and does not exists of 2.11 so I re-created it's behaviour  according to https://eclipse.org/Xtext/releasenotes.html
+							dependency>
+							<groupId>org.eclipse.xtext</groupId>
+							<artifactId>org.eclipse.xtext.xtext</artifactId>
+							<version>${xtext.version}</version>
+							</dependency
+					-->
+
+					<dependency>
 						<groupId>org.eclipse.xtext</groupId>
-						<artifactId>org.eclipse.xtext.xtext</artifactId>
+						<artifactId>org.eclipse.xtext.generator</artifactId>
 						<version>${xtext.version}</version>
-					</dependency-->
-
-
-
-<dependency>
-<groupId>org.eclipse.xtext</groupId>
-<artifactId>org.eclipse.xtext.generator</artifactId>
-<version>${xtext.version}</version>
-</dependency>
-<dependency>
-<groupId>org.eclipse.xtext</groupId>
-<artifactId>org.eclipse.xtext.ecore</artifactId>
-<version>${xtext.version}</version>
-</dependency>
-<dependency>
-<groupId>org.eclipse.xtext</groupId>
-<artifactId>org.eclipse.xtext.util</artifactId>
-<version>${xtext.version}</version>
-</dependency>
-<dependency>
-<groupId>org.eclipse.xtext</groupId>
-<artifactId>org.eclipse.xtext</artifactId>
-<version>${xtext.version}</version>
-</dependency>
-<dependency>
-<groupId>org.eclipse.xtext</groupId>
-<artifactId>org.eclipse.xtext.common.types</artifactId>
-<version>${xtext.version}</version>
-</dependency>
+					</dependency>
+					<dependency>
+						<groupId>org.eclipse.xtext</groupId>
+						<artifactId>org.eclipse.xtext.ecore</artifactId>
+						<version>${xtext.version}</version>
+					</dependency>
+					<dependency>
+						<groupId>org.eclipse.xtext</groupId>
+						<artifactId>org.eclipse.xtext.util</artifactId>
+						<version>${xtext.version}</version>
+					</dependency>
+					<dependency>
+						<groupId>org.eclipse.xtext</groupId>
+						<artifactId>org.eclipse.xtext</artifactId>
+						<version>${xtext.version}</version>
+					</dependency>
+					<dependency>
+						<groupId>org.eclipse.xtext</groupId>
+						<artifactId>org.eclipse.xtext.common.types</artifactId>
+						<version>${xtext.version}</version>
+					</dependency>
 
-<!-- https://mvnrepository.com/artifact/org.eclipse.emf/org.eclipse.emf.mwe2.launch -->
-<dependency>
-    <groupId>org.eclipse.emf</groupId>
-    <artifactId>org.eclipse.emf.mwe2.launch</artifactId>
-    <version>2.9.0.201605261059</version>
-</dependency>
+					<!-- https://mvnrepository.com/artifact/org.eclipse.emf/org.eclipse.emf.mwe2.launch -->
+					<dependency>
+						<groupId>org.eclipse.emf</groupId>
+						<artifactId>org.eclipse.emf.mwe2.launch</artifactId>
+						<version>2.9.0.201605261059</version>
+					</dependency>
 
 
 
@@ -134,7 +136,7 @@
 		<pluginManagement>
 			<plugins>
 				<!--This plugin's configuration is used to store Eclipse m2e settings 
-					only. It has no influence on the Maven build itself. -->
+						only. It has no influence on the Maven build itself. -->
 				<plugin>
 					<groupId>org.eclipse.m2e</groupId>
 					<artifactId>lifecycle-mapping</artifactId>

+ 22 - 13
DSL_SemanticAdaptation/pom.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+				 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>be.uantwerpen.ansymo.semanticadaptation</groupId>
@@ -8,19 +8,21 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
 	<version>1.0.0-SNAPSHOT</version>
 	<packaging>pom</packaging>
 
+
+	<!-- the mavenization is based on this approach https://github.com/xtext/maven-xtext-example -->
 	<modules>
 		<module>be.uantwerpen.ansymo.semanticadaptation</module>
- <module>be.uantwerpen.ansymo.semanticadaptation.tests</module>
-<module>be.uantwerpen.ansymo.semanticadaptation.ide</module>
-<module>be.uantwerpen.ansymo.semanticadaptation.ui</module>
+		<module>be.uantwerpen.ansymo.semanticadaptation.tests</module>
+		<module>be.uantwerpen.ansymo.semanticadaptation.ide</module>
+		<module>be.uantwerpen.ansymo.semanticadaptation.ui</module>
 		<!--module>../my.mavenized.herolanguage.ui</module>
-		<module>../my.mavenized.herolanguage.tests</module>
-		<module>../my.mavenized.herolanguage.sdk</module>
-		<module>../my.mavenized.herolanguage.updatesite</module-->
+				<module>../my.mavenized.herolanguage.tests</module>
+				<module>../my.mavenized.herolanguage.sdk</module>
+				<module>../my.mavenized.herolanguage.updatesite</module-->
 	</modules>
 
 	<properties>
-		<tycho-version>0.24.0</tycho-version>
+		<tycho-version>1.0.0</tycho-version>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<xtext.version>2.11.0</xtext.version>
 	</properties>
@@ -35,22 +37,22 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
 			<id>Xtext Update Site</id>
 			<layout>p2</layout>
 			<!--url>http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/</url-->
-<url>http://download.eclipse.org/modeling/tmf/xtext/updates/releases/${xtext.version}/</url>
+			<url>http://download.eclipse.org/modeling/tmf/xtext/updates/releases/${xtext.version}/</url>
 		</repository>
 
 
- <repository>
+		<!--repository>
       <id>mvn</id>
       <url>http://mvnrepository.com/artifact</url>
-    </repository>
+    </repository-->
 
 	</repositories>
 	<build>
 		<pluginManagement>
 			<plugins>
 				<!-- xtend-maven-plugin is in pluginManagement instead of in plugins 
-					so that it doesn't run before the exec-maven-plugin's *.mwe2 gen; this way 
-					we can list it after. -->
+						 so that it doesn't run before the exec-maven-plugin's *.mwe2 gen; this way 
+						 we can list it after. -->
 
 				<plugin>
 					<groupId>org.eclipse.xtend</groupId>
@@ -67,6 +69,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
 						</execution>
 					</executions>
 					<configuration>
+
+						<xtendAsPrimaryDebugSource>true</xtendAsPrimaryDebugSource>
+            <!--outputDirectory>${project.build.directory}/xtend-gen/main</outputDirectory-->
+            <testOutputDirectory>${project.build.directory}/xtend-gen/test</testOutputDirectory>
+            <writeTraceFiles>true</writeTraceFiles>
+
+
 						<outputDirectory>xtend-gen</outputDirectory>
 					</configuration>
 				</plugin>