-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·101 lines (92 loc) · 3.76 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
<project name="mainp-ingenias" default="run" basedir="." >
<import file="iaf-generated-build.xml" as="iafmavenbuild" />
<property name="specfile" value="src/main/spec/specification.xml"/>
<!-- Compiles code generated by a JADE Module and tests it -->
<target name="edit" depends="getclasspathfrommaven">
<java fork="true" failonerror="true" maxmemory="512m"
classname="ingenias.editor.IDE">
<jvmarg value="-Xmx1024m"/>
<arg line="${specfile}"/>
<classpath>
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
<pathelement path="${maven.build.outputDir}" />
</classpath>
</java>
</target>
<!-- Specification uploading -->
<target name="noneedverifyupdatedspec" unless="temp.spec.present">
<echo message="Your specification does not need to be updated. No changes were detected in the src/main/javagensrc folder"/>
</target>
<target name="verifyupdatedspec" if="temp.spec.present">
<!-- verify the generation works and does not destroys code-->
<delete dir="target/tmp/javagensrc"/>
<mkdir dir="target/tmp/javagensrc"/>
<mkdir dir="target/classes"/>
<java failonerror="true" maxmemory="128m"
classname="ingenias.codeproc.IAFGenerator">
<arg line="${specfile}.idkbak . target/tmp/javagensrc target/tmp/javapermsrc true"/>
<classpath>
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
<pathelement path="${maven.build.outputDir}" />
</classpath>
</java>
<!-- check that it compiles-->
<javac destdir="${maven.build.outputDir}"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
target="1.6"
verbose="false"
fork="false"
source="1.6">
<src>
<pathelement location="${maven.build.srcDir.0}"/>
<pathelement location="src/main/javapermsrc"/>
<pathelement location="target/tmp/javagensrc"/>
</src>
<classpath>
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
<pathelement path="${maven.build.outputDir}" />
</classpath>
</javac>
<!-- TODO: compare generated files in target/tmp/javagensrc against those stored in src/main/javagensrc -->
<!-- replaces the original file because everything works fine-->
<copy file="${specfile}.idkbak" tofile="${specfile}"/>
<delete dir="target/tmp/javagensrc"/>
<delete file="${specfile}.idkbak"/>
<!-- overwrites the spec to restore the consistence between javagensrc and the currently modified spec -->
<antcall target="compileproject"/>
</target>
<target name="updatespec" depends="getclasspathfrommaven">
<!-- uploads code to an specification-->
<delete file="${specfile}.idkbak"/>
<java fork="true" failonerror="true" maxmemory="128m"
classname="ingenias.module.CodeUploader">
<arg line="${specfile} src/main/javagensrc ${specfile}.idkbak"/>
<classpath>
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
<pathelement path="${maven.build.outputDir}" />
</classpath>
</java>
<!-- check there is a new spec, because if no changes are required, no new specs are produced -->
<available file="${specfile}.idkbak" type="file" property="temp.spec.present"/>
<antcall target="verifyupdatedspec"/>
<antcall target="noneedverifyupdatedspec"/>
</target>
<target name="htmldoc" depends="getclasspathfrommaven">
<java fork="true" failonerror="true" maxmemory="128m"
classname="ingenias.codeproc.HTMLDocumentGenerator">
<arg line="${specfile} target"/>
<classpath>
<pathelement path="${ingeniasmavenclasspath}" />
<pathelement path="${mavenclasspath}" />
<pathelement path="${maven.build.outputDir}" />
</classpath>
</java>
</target>
</project>