-
Notifications
You must be signed in to change notification settings - Fork 0
/
iaf-generated-build.xml
executable file
·244 lines (214 loc) · 9.63 KB
/
iaf-generated-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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<project name="ingenias" default="run" basedir="." >
<property environment="env"/>
<property file="${user.home}/.m2/maven.properties"/>
<property file="maven-build.properties"/>
<property name="maven.build.dir" value="target"/>
<property name="maven.build.outputDir" value="${maven.build.dir}/classes"/>
<property name="maven.build.srcDir.0" value="src/main/java"/>
<property name="maven.build.resourceDir.0" value="src/main/resources"/>
<property name="maven.build.testOutputDir" value="${maven.build.dir}/test-classes"/>
<property name="maven.build.testDir.0" value="src/test/java"/>
<property name="maven.build.testResourceDir.0" value="src/test/resources"/>
<property name="maven.test.reports" value="${maven.build.dir}/test-reports"/>
<property name="maven.reporting.outputDirectory" value="${maven.build.dir}/site"/>
<property name="maven.repo.local" value="${user.home}/.m2/repository"/>
<property name="maven.settings.offline" value="false"/>
<property name="maven.settings.interactiveMode" value="true"/>
<property name="maven.src.dir" value="${env.M2_HOME}"/>
<property name="pom.dir" value="."/>
<target name="init" unless="env.M2_HOME">
<echo message="You need to set the M2_HOME variable to the path of your Maven install folder."/>
<echo message="Linux: you can invoke this with 'env M2_HOME=WRITE_HERE_THE_HOME_OF_MAVEN ant WHATEVER_TARGET'"/>
<echo message="Windows: find the MyComputer icon in your desktop or your start menu, click on properties, then advanced tab, then environment variables."/>
<fail status="1" />
</target>
<target name="generateclasspathfrommaven" unless="maven.classpath.present">
<maven basedir="${pom.dir}" goal="validate" resultproperty="maven.build.result" options="-e -Dbuild.for.prod=false -Djavac.debug=true -Djavac.optimize=false"/>
</target>
<target name="getclasspathfrommaven" depends="init">
<available file="target/classpath.txt" type="file"
property="maven.classpath.present"/>
<antcall target="generateclasspathfrommaven"/>
<loadfile srcFile="target/classpath.txt" property="mavenclasspath" />
<loadfile srcFile="target/classpathingenias.txt" property="ingeniasmavenclasspath" />
</target>
<!--
This is the macro definition for maven Ant task
-->
<!-- from http://tsrini.blogspot.com.es/2010/07/call-maven-task-from-ant.html-->
<macrodef name="maven">
<attribute name="options" default="" />
<attribute name="goal" />
<attribute name="basedir" />
<attribute name="resultproperty" default="maven.result" />
<element name="args" implicit="true" optional="true" />
<sequential>
<java classname="org.codehaus.classworlds.Launcher" fork="true" dir="@{basedir}" resultproperty="@{resultproperty}">
<jvmarg value="-Xmx512m" />
<classpath>
<fileset dir="${maven.src.dir}/boot">
<include name="*.jar" />
</fileset>
<fileset dir="${maven.src.dir}/lib">
<include name="*.jar" />
</fileset>
</classpath>
<sysproperty key="classworlds.conf" value="${maven.src.dir}/bin/m2.conf" />
<sysproperty key="maven.home" value="${maven.src.dir}" />
<arg line="--batch-mode @{options} @{goal}" />
</java>
</sequential>
</macrodef>
<target name="compileproject" depends="getclasspathfrommaven">
<maven basedir="${pom.dir}" goal="compile" resultproperty="maven.build.result" options="-e -Dbuild.for.prod=false -Djavac.debug=true -Djavac.optimize=false"/>
</target>
<!-- Targets to run simulations defined in the system -->
<!-- *********************** -->
<!-- Node SimpleMicrogridDeployment -->
<!-- *********************** -->
<!-- Runs a MAS created with the jade module and contained in the node SimpleMicrogridDeployment -->
<target name="runSimpleMicrogridDeploymentProdStandAlone" depends="compileproject">
<mkdir dir="target/jade"/>
<java fork="true" failonerror="true" maxmemory="128m"
classname="ingenias.jade.MainSimpleMicrogridDeploymentProdStandAlone">
<arg line="60000"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
<target name="runSimpleMicrogridDeployment" depends="compileproject">
<java fork="true" failonerror="true" maxmemory="128m"
classname="ingenias.jade.MainSimpleMicrogridDeployment">
<arg line="60000"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
<target name="runPauseSimpleMicrogridDeployment" depends="compileproject">
<java fork="true" failonerror="true" maxmemory="128m"
classname="ingenias.jade.MainSimpleMicrogridDeployment">
<arg line="60000 pause"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
<target name="runjadeSimpleMicrogridDeployment" depends="getclasspathfrommaven">
<mkdir dir="target/jade"/>
<java fork="true" failonerror="true" maxmemory="128m"
classname="jade.Boot">
<arg line="-gui -port 60000 -mtp 'jade.mtp.http.MessageTransportProtocol(http://127.0.0.1:60001/acc)' -file-dir target/jade/"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
<target name="runfederatedjadeSimpleMicrogridDeployment" depends="getclasspathfrommaven">
<mkdir dir="target/jade"/>
<java fork="true" failonerror="true" maxmemory="128m"
classname="jade.Boot">
<arg line="-gui -port 60000 -mtp 'jade.mtp.http.MessageTransportProtocol(http://127.0.0.1:60001/acc)' -file-dir target/jade subDF:jade.domain.df federator:jade.misc.DFFederatorAgent(resources/DFFederatorAgent.properties)"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
<target name="debugSimpleMicrogridDeployment" depends="compileproject">
<java fork="true" failonerror="true" maxmemory="256m"
classname="ingenias.jade.MainSimpleMicrogridDeployment">
<jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,address=60005,server=y,suspend=n"/>
<arg line="60000"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
<!-- *********************** -->
<!-- Node -->
<!-- *********************** -->
<!-- Runs a MAS created with the jade module and contained in the node -->
<target name="runProdStandAlone" depends="compileproject">
<mkdir dir="target/jade"/>
<java fork="true" failonerror="true" maxmemory="128m"
classname="ingenias.jade.MainProdStandAlone">
<arg line="60000"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
<target name="run" depends="compileproject">
<java fork="true" failonerror="true" maxmemory="128m"
classname="ingenias.jade.Main">
<arg line="60000"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
<target name="runPause" depends="compileproject">
<java fork="true" failonerror="true" maxmemory="128m"
classname="ingenias.jade.Main">
<arg line="60000 pause"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
<target name="runjade" depends="getclasspathfrommaven">
<mkdir dir="target/jade"/>
<java fork="true" failonerror="true" maxmemory="128m"
classname="jade.Boot">
<arg line="-gui -port 60000 -mtp 'jade.mtp.http.MessageTransportProtocol(http://127.0.0.1:60001/acc)' -file-dir target/jade/"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
<target name="runfederatedjade" depends="getclasspathfrommaven">
<mkdir dir="target/jade"/>
<java fork="true" failonerror="true" maxmemory="128m"
classname="jade.Boot">
<arg line="-gui -port 60000 -mtp 'jade.mtp.http.MessageTransportProtocol(http://127.0.0.1:60001/acc)' -file-dir target/jade subDF:jade.domain.df federator:jade.misc.DFFederatorAgent(resources/DFFederatorAgent.properties)"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
<target name="debug" depends="compileproject">
<java fork="true" failonerror="true" maxmemory="256m"
classname="ingenias.jade.Main">
<jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,address=60005,server=y,suspend=n"/>
<arg line="60000"/>
<classpath>
<pathelement path="${maven.build.outputDir}" />
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
</classpath>
</java>
</target>
</project>