/
build.eclipsextextplugin.xml
193 lines (155 loc) · 7.57 KB
/
build.eclipsextextplugin.xml
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?xml version="1.0" encoding="UTF-8"?>
<project basedir=".." default="build" name="UmpleXtextEclipsePlugin" >
<!-- ```````````````````````````
Environment Variables
``````````````````````````` -->
<import file="_template.xml" />
<property name="project.path" value="cruise.umple.xtext.ui"/>
<property name="bin.path" value="${project.path}/bin"/>
<property name="dist.path" value="${dist.dir}/cruise.umple.xtext.ui"/>
<property name="test.output.path" value="${dist.dir}/qa/cruise.umple.xtext.ui"/>
<condition property="jvmarg.01" value="-d32"><equals arg1="${is.osx}" arg2="true" /></condition>
<condition property="jvmarg.02" value="-XstartOnFirstThread"><equals arg1="${is.osx}" arg2="true" /></condition>
<property name="jvmarg.01" value="-Dignore1"/>
<property name="jvmarg.02" value="-Dignore2"/>
<condition property="path.eclipse.01" value="org.eclipse.swt_3.5.2.v3557f.jar"><equals arg1="${is.osx}" arg2="true" /></condition>
<condition property="path.eclipse.02" value="org.eclipse.swt.cocoa.macosx_3.5.2.v3557f.jar"><equals arg1="${is.osx}" arg2="true" /></condition>
<property name="path.eclipse.01" value="linux/org.eclipse.swt_3.6.2.v3659c.jar"/>
<property name="path.eclipse.02" value="linux/org.eclipse.swt.gtk.linux.x86_64_3.6.2.v3659b.jar"/>
<path id="project.classpath">
<pathelement location="${bin.path}"/>
<pathelement location="cruise.umple/bin"/>
<path refid="umple.classpath"/>
<path refid="eclipse.classpath"/>
<path refid="xtext_core.classpath"/>
<path refid="junit4.classpath"/>
</path>
<!-- ```````````````````````````
Compile the application
``````````````````````````` -->
<target name="compile">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" includeantruntime="false" debuglevel="source,lines,vars" destdir="${bin.path}" source="1.7" target="1.7">
<src path="cruise.umple/src"/>
<src path="cruise.umple/src-gen-umpletl"/>
<src path="cruise.umple/src-gen-umple"/>
<src path="cruise.umple.xtext/src"/>
<src path="cruise.umple.xtext/src-gen"/>
<src path="cruise.umple.xtext.ui/src"/>
<src path="cruise.umple.xtext.ui/src-gen"/>
<exclude name="**/.svn"/>
<exclude name="**/*.ump" />
<exclude name="**/data" />
<classpath refid="project.classpath"/>
</javac>
</target>
<!-- ```````````````````````````
Test the application
``````````````````````````` -->
<target name="test">
<junit fork="yes" forkmode="perBatch" haltonfailure="${haltonfailure}" showoutput="${showJunitOutput}" printsummary="${showJunitSummary}">
<jvmarg value="${jvmarg.01}"/>
<jvmarg value="${jvmarg.02}" />
<formatter type="xml"/>
<batchtest fork="yes" todir="${test.output.path}">
<fileset dir="${project.path}/test">
<include name="**/*Test*.java"/>
<exclude name="**/AllTests.java"/>
</fileset>
</batchtest>
<classpath refid="project.classpath"/>
</junit>
<junitreport todir="${test.output.path}">
<fileset dir="${test.output.path}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.output.path}"/>
</junitreport>
</target>
<!-- ```````````````````````````
Package the application
``````````````````````````` -->
<target name="package">
<echo message="Package Version: ${umple.version}" />
<property name="plugin.build.root" location="dist" />
<property name="plugin.build.temp" location="${plugin.build.root}/temp" />
<property name="plugin.build.out" location="${plugin.build.root}" />
<delete dir="${plugin.build.temp}" />
<mkdir dir="${plugin.build.temp}" />
<mkdir dir="${plugin.build.out}" />
<copy file="cruise.umple.xtext.ui/META-INF/MANIFEST.MF" todir="${plugin.build.temp}" />
<replace file="${plugin.build.temp}/MANIFEST.MF">
<replacefilter token=":=" value="=" />
<replacefilter token=":" value="=" />
<replacetoken>;</replacetoken>
<replacevalue>
</replacevalue>
</replace>
<property file="${plugin.build.temp}/MANIFEST.MF" />
<property name="plugin.dir" value="cruise.umple.xtext.ui_${umple.version}" />
<property name="plugin.files" location="${plugin.build.temp}/files/${plugin.dir}" />
<property name="plugin.jar" location="${plugin.build.temp}/jars/plugins/${plugin.dir}.jar" />
<property name="product.zip" value="${plugin.build.out}/cruise.umple.xtext.ui_v${umple.version}.zip" />
<copy todir="${plugin.files}">
<fileset dir="cruise.umple.xtext.ui" includes="plugin.xml" />
<fileset dir="cruise.umple.xtext.ui" includes="icons/**" />
<fileset dir="cruise.umple.xtext.ui" includes="META-INF/MANIFEST.MF" />
<fileset dir="cruise.umple.xtext.ui/bin" includes="cruise/**" />
</copy>
<!-- Files needed by the Google Juice Dependency injection framework -->
<copy todir="${plugin.files}/cruise/umple">
<fileset dir="cruise.umple.xtext/src-gen/cruise/umple/" includes="Umple.xmi" />
<fileset dir="cruise.umple.xtext/src-gen/cruise/umple/" includes="Umple.ecore" />
<fileset dir="cruise.umple.xtext/src-gen/cruise/umple/" includes="Umple.genmodel" />
</copy>
<copy todir="${plugin.files}">
<fileset dir="cruise.umple/src" includes="*.grammar"/>
<fileset dir="cruise.umple/src" includes="*.error"/>
</copy>
<copy todir="${plugin.files}/cruise/umple/parser/antlr/internal">
<fileset dir="cruise.umple.xtext/src-gen/cruise/umple/parser/antlr/internal" includes="InternalUmple*.*" />
</copy>
<copy todir="${plugin.files}/cruise/umple/ui/contentassist/antlr/internal/">
<fileset dir="cruise.umple.xtext.ui/src-gen/cruise/umple/ui/contentassist/antlr/internal/" includes="InternalUmple*.*" />
</copy>
<!-- Assemble plug-in jar -->
<mkdir dir="${plugin.build.temp}/jars/plugins" />
<zip destfile="${plugin.jar}">
<zipfileset dir="${plugin.files}">
<include name="**/*.*" />
</zipfileset>
</zip>
<!-- Assemble the product zip -->
<zip destfile="${product.zip}">
<fileset dir="${plugin.build.temp}/jars" />
</zip>
<copy file="${plugin.build.temp}/jars/plugins/${plugin.dir}.jar" tofile="${plugin.build.out}/${plugin.dir}.jar" />
<!-- Cleanup once you are done -->
<delete dir="${plugin.build.temp}" />
</target>
<!-- ```````````````````````````
Build the application
``````````````````````````` -->
<!--
Build
run by the build machine, should work as-is on your machine, but be careful
as your code will be run against the "latest" Umpled Umple.
-->
<target name="build" >
<ant antfile="build/build.umple.xml" target="precondition" inheritAll="false" />
<antcall target="template.clean" />
<antcall target="template.init" />
<antcall target="template.setVersion" />
<antcall target="compile" />
<!-- Not yet able to get SWT testing working on LINUX, and 3 test cases is not worth the effort -->
<!-- <antcall target="test" /> -->
<antcall target="package" />
<antcall target="template.resetVersion" />
<ant antfile="build/build.umple.xml" target="postcondition" inheritAll="false" />
</target>
<!-- can be run locally as a quick(er) test to see if the build will pass on the server -->
<target name="pre_build" >
<antcall target="compile" />
<antcall target="test" />
</target>
</project>