-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
189 lines (140 loc) · 7.2 KB
/
build.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
<project name="No Magic MagicDraw IFML Plugin" default="all" basedir=".">
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="bin" location="bin"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<target name="clean">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${bin}" erroronmissingdir="false"/>
<fileset dir="${build}" erroronmissingdir="false"/>
<fileset dir="${dist}" erroronmissingdir="false"/>
</delete>
<delete quiet="true">
<fileset dir="." includes="magicdraw-plugins-ifml-*.zip"/>
</delete>
</target>
<target name="init" depends="clean">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<!-- Create the dist directory structure used to stage the plugin files -->
<mkdir dir="${dist}/data/resourcemanager"/>
<mkdir dir="${dist}/data/defaults/data/reports"/>
<mkdir dir="${dist}/plugins/com.nomagic.magicdraw.plugins.ifml/lib"/>
<mkdir dir="${dist}/profiles"/>
</target>
<target name="compile" depends="init">
<!-- Create the time stamp -->
<tstamp/>
<path id="master-classpath">
<fileset dir="C:\Program Files\Cameo Enterprise Architecture\lib">
<include name="jsr305.jar"/>
<include name="md_api.jar"/>
<include name="md_common.jar"/>
<include name="md_common_api.jar"/>
<include name="md_foundation_1.0.jar"/>
<include name="md.jar"/>
<include name="jide-grids.jar"/>
<include name="org.eclipse.emf.ecore_2.7.0.v20110513-1719.jar"/>
<include name="org.eclipse.emf.common_2.7.0.v20110513-1719.jar"/>
<include name="javax_jmi-1_0-fr.jar"/>
<include name="uml2.jar"/>
<include name="log4j-1.2.15.jar"/>
</fileset>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<replace file="${src}/com/nomagic/magicdraw/plugins/ifml/MagicDrawIfmlPlugin.java"
token="@@@compile-timestamp@@@" value="${DSTAMP}-${TSTAMP}"/>
<replace file="${src}/com/nomagic/magicdraw/plugins/ifml/MagicDrawIfmlPlugin.java"
token="@@@debug-flag@@@" value="disabled"/>
<javac includeantruntime="false" srcdir="${src}" destdir="${build}">
<classpath refid="master-classpath"/>
</javac>
<replaceregexp file="${src}/com/nomagic/magicdraw/plugins/ifml/MagicDrawIfmlPlugin.java"
preservelastmodified="true"
match="Compiled at (.*)\."
replace="Compiled at @@@compile-timestamp@@@ (debug=@@@debug-flag@@@)\."/>
</target>
<target name="debug-compile" depends="init">
<!-- Create the time stamp -->
<tstamp/>
<path id="master-classpath">
<fileset dir="C:\Program Files\Cameo Enterprise Architecture\lib">
<include name="jsr305.jar"/>
<include name="md_api.jar"/>
<include name="md_common.jar"/>
<include name="md_common_api.jar"/>
<include name="md_foundation_1.0.jar"/>
<include name="md.jar"/>
<include name="jide-grids.jar"/>
<include name="org.eclipse.emf.ecore_2.7.0.v20110513-1719.jar"/>
<include name="org.eclipse.emf.common_2.7.0.v20110513-1719.jar"/>
<include name="javax_jmi-1_0-fr.jar"/>
<include name="uml2.jar"/>
<include name="log4j-1.2.15.jar"/>
</fileset>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<replace file="${src}/com/nomagic/magicdraw/plugins/ifml/MagicDrawIfmlPlugin.java"
preservelastmodified="true"
token="@@@compile-timestamp@@@" value="${DSTAMP}-${TSTAMP}"/>
<replace file="${src}/com/nomagic/magicdraw/plugins/ifml/MagicDrawIfmlPlugin.java"
preservelastmodified="true"
token="@@@debug-flag@@@" value="enabled"/>
<javac includeantruntime="false" srcdir="${src}" destdir="${build}" debug="true">
<classpath refid="master-classpath"/>
</javac>
<replaceregexp file="${src}/com/nomagic/magicdraw/plugins/ifml/MagicDrawIfmlPlugin.java"
preservelastmodified="true"
match="Compiled at (.*)\."
replace="Compiled at @@@compile-timestamp@@@ (debug=@@@debug-flag@@@)\."/>
</target>
<target name="dist" depends="compile">
<jar destfile="${dist}/plugins/com.nomagic.magicdraw.plugins.ifml/magicdraw-plugins-ifml.jar"
basedir="${build}" whenmanifestonly="fail"/>
<copy file="${src}/plugins/com.nomagic.magicdraw.plugins.ifml/plugin.xml"
todir="${dist}/plugins/com.nomagic.magicdraw.plugins.ifml"/>
<copy file="${src}/data/resourcemanager/MDR_Plugin_comnomagicmagidrawpluginsimfl_98989_descriptor.xml"
todir="${dist}/data/resourcemanager"/>
<replace preservelastmodified="true"
file="${dist}/data/resourcemanager/MDR_Plugin_comnomagicmagidrawpluginsimfl_98989_descriptor.xml"
token="@@@timestamp@@@" value="${DSTAMP}-${TSTAMP}"/>
<copy todir="${dist}/plugins/com.nomagic.magicdraw.plugins.ifml/lib">
<fileset dir="lib"/>
</copy>
<copy todir="${dist}/profiles">
<fileset dir="${src}/profiles"/>
</copy>
<copy todir="${dist}/data">
<fileset dir="${src}/data"/>
</copy>
<zip destfile="magicdraw-plugins-ifml-${DSTAMP}-${TSTAMP}.zip" basedir="${dist}"/>
</target>
<target name="debug-dist" depends="debug-compile">
<jar destfile="${dist}/plugins/com.nomagic.magicdraw.plugins.ifml/magicdraw-plugins-ifml.jar"
basedir="${build}" whenmanifestonly="fail"/>
<copy file="${src}/plugins/com.nomagic.magicdraw.plugins.ifml/plugin.xml"
todir="${dist}/plugins/com.nomagic.magicdraw.plugins.ifml"/>
<copy file="${src}/data/resourcemanager/MDR_Plugin_comnomagicmagidrawpluginsimfl_98989_descriptor.xml"
todir="${dist}/data/resourcemanager"/>
<replace preservelastmodified="true"
file="${dist}/data/resourcemanager/MDR_Plugin_comnomagicmagidrawpluginsimfl_98989_descriptor.xml"
token="@@@timestamp@@@" value="${DSTAMP}-${TSTAMP}"/>
<copy todir="${dist}/plugins/com.nomagic.magicdraw.plugins.ifml/lib">
<fileset dir="lib"/>
</copy>
<copy todir="${dist}/profiles">
<fileset dir="${src}/profiles"/>
</copy>
<copy todir="${dist}/data">
<fileset dir="${src}/data"/>
</copy>
<zip destfile="magicdraw-plugins-ifml-${DSTAMP}-${TSTAMP}.zip" basedir="${dist}"/>
</target>
<target name="all" depends="dist"/>
<target name="debug-all" depends="debug-dist"/>
</project>