Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 1f28d59cc5c7f3c12892dc0490b20f91e3f78ee5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?xml version="1.0" encoding="UTF-8"?>
<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>
  <parent>
    <groupId>org.eclipse.papyrus</groupId>
    <artifactId>org.eclipse.papyrus.tests.releng</artifactId>
    <version>1.2.0-SNAPSHOT</version>
    <relativePath>../../../../../releng/main-tests/pom.xml</relativePath>
  </parent>
  <groupId>org.eclipse.papyrus</groupId>
  <artifactId>org.eclipse.papyrus.uml.diagram.tests.releng</artifactId>
  <version>1.2.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  
  <modules>
	<module>org.eclipse.papyrus.uml.diagram.activity.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.clazz.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.statemachine.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.common.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.component.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.communication.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.composite.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.deployment.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.dnd.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.interactionoverview.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.paletteconfiguration.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.profile.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.sequence.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.timing.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.usecase.tests</module>
	<module>org.eclipse.papyrus.uml.diagram.wizards.tests</module>
  </modules>
  
  <profiles>
    <!-- A build profile for generation of diagram tests from the GMFGen model. -->
  	<profile>
  		<id>generate-tests</id>
  		<activation>
  			<!-- Activate this profile if we detect the folder in which tests should be generated. --> 
			<file>
				<exists>test-gen/.gitignore</exists>
			</file>
  		</activation>
		<build>
			<plugins>
				<!-- Empty out the xtend-gen and test-gen folders in the clean phase. -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<configuration>
						<filesets>
							<fileset>
								<directory>xtend-gen</directory>
								<excludes>
									<exclude>**/.gitignore</exclude>
								</excludes>
							</fileset>
							<fileset>
								<directory>test-gen</directory>
								<excludes>
									<exclude>**/.gitignore</exclude>
								</excludes>
							</fileset>
						</filesets>
					</configuration>
				</plugin>
				<!-- Generate Xtend sources before the compilation phase. -->
				<plugin>
					<groupId>org.eclipse.xtend</groupId>
					<artifactId>xtend-maven-plugin</artifactId>
					<executions>
						<execution>
							<id>generate-tests-generator</id>
							<phase>generate-sources</phase>
							<goals>
								<goal>compile</goal>
							</goals>
							<configuration>
								<outputDirectory>xtend-gen</outputDirectory>
							</configuration>
						</execution>
					</executions>
				</plugin>
				
				<!-- Generate test sources after the compilation phase (because we need the generator to be compiled). -->
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<executions>
						<execution>
							<id>generate-diagram-tests</id>
							<phase>generate-test-sources</phase>
							<goals>
								<goal>exec</goal>
							</goals>
							<configuration>
								<classpathScope>compile</classpathScope>
								<executable>java</executable>
								<arguments>
									<argument>-cp</argument>
									<classpath/>
									<argument>${generator.workflow.main.class}</argument>
								</arguments>
							</configuration>
						</execution>
					</executions>
				</plugin>
				
				<!-- And compile them in the test-compile phase. -->
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-compiler-plugin</artifactId>
					<executions>
						<execution>
							<id>compile-generated-diagram-tests</id>
							<phase>test-compile</phase>
							<goals>
								<goal>compile</goal>
							</goals>
							<configuration>
								<useProjectSettings>true</useProjectSettings>
							</configuration>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</build>
  	</profile>
  </profiles>
</project>

Back to the top