-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
188 lines (170 loc) · 10.8 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="adam_logics" default="jar" xmlns:if="ant:if" xmlns:unless="ant:unless">
<!-- For building the standalone version: the jars in libs.res have to start with ${libfolder}/ and
the classes have to start with ${dependenciesfolder}, or ${frameworkfolder}. -->
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%% PROPERTIES %%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<dirname property="logics.basedir" file="${ant.file.adam_logics}"/>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%% IMPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<property name="subproject.basedir" value="${logics.basedir}"/>
<property file="${subproject.basedir}/build.properties" prefix="adam"/>
<!-- get the correct folder for the dependencies depending on whether we build it as the main project of as a dependency itselve -->
<available file="${adam.dependenciesfolder.asMainProject}/" type="dir" property="isMainProject"/>
<available file="${adam.dependenciesfolder.asDependency}" type="dir" property="isDependency"/>
<property if:set="isMainProject" name="dependenciesfolder" value="${adam.dependenciesfolder.asMainProject}"/>
<property if:set="isDependency" name="dependenciesfolder" value="${adam.dependenciesfolder.asDependency}"/>
<!-- now load the property file again to correctly expand the ${dependencyfolder}. Standard ant doesn't allow overwriting properties,
thus, we loaded it above with a prefix -->
<property file="${subproject.basedir}/build.properties"/>
<import file="${frameworkfolder}/build_macros.xml" optional="false"/>
<include file="${frameworkfolder}/build_targets.xml" as="logics.fu" optional="false"/>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%% PATHs %%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<union id="logics.jar.res">
<!-- <zipfileset includes="**/*.class" src="${mainfolder}/lib/apt/apt.jar"/>
<zipfileset includes="**/*.stg" src="${mainfolder}/lib/apt/apt.jar"/>-->
<!-- <zipfileset includes="**/*.class" src="${logics.basedir}/lib/apt/apt-module.jar"/>
<zipfileset includes="**/*.class" src="${logics.basedir}/lib/apt/apt-lib.jar"/>
<zipfileset includes="**/*.class" src="${logics.basedir}/lib/apt/apt-io.jar"/>
<zipfileset includes="**/*.stg" src="${logics.basedir}/lib/apt/apt-io.jar"/>-->
</union>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%% PROPERTIES %%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<target name="loadProperties">
<property file="${subproject.basedir}/build.properties"/>
</target>
<path id="antlr.class.path">
<pathelement location="${libfolder}/antlr-4.5.1/antlr-4.5.1-complete.jar" />
</path>
<!-- %%%%%%%%%%%%%%%%%%%%%%%% LTL %%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<!-- Only run the antlr target if some .g file is newer than generated-src/antlr.stamp (which the antlr target touches) -->
<target name="antlr.flowLTL.checkforchanges">
<uptodate property="antlr.flowLTL.nochanges" targetfile="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowltl/antlr/antlr.stamp">
<srcfiles dir="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowltl/" includes="**/*.g4"/>
</uptodate>
</target>
<!-- Antlr4 is called here -->
<target name="antlr.flowLTL" depends="antlr.flowLTL.checkforchanges" unless="antlr.flowLTL.nochanges">
<macrodef name="call-antlr">
<attribute name="name" />
<sequential>
<java classpathref="antlr.class.path" classname="org.antlr.v4.Tool" fork="true" failonerror="true">
<arg value="-o"/>
<arg path="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowltl/antlr"/>
<arg value="-package"/>
<arg value="uniolunisaar.adam.logic.parser.logics.flowltl.antlr"/>
<arg line="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowltl/@{name}"/>
</java>
</sequential>
</macrodef>
<call-antlr name="FlowLTLFormat.g4" />
<!-- Touch the time stamp file which antlr.checkforchanges checks for -->
<touch file="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowltl/antlr/antlr.stamp" mkdirs="true"/>
</target>
<!-- %%%%%%%%%%%%%%%%%%%%%%%% CTL %%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<!-- %%%%%%%%%%%%%%%%%%%%%%%% CTL separate %%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<!-- Only run the antlr target if some .g file is newer than generated-src/antlr.stamp (which the antlr target touches) -->
<target name="antlr.flowCTLSeparate.checkforchanges">
<uptodate property="antlr.flowCTLSeparate.nochanges" targetfile="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/separate/antlr/antlr.stamp">
<srcfiles dir="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/separate" includes="**/*.g4"/>
</uptodate>
</target>
<!-- Antlr4 is called here -->
<target name="antlr.flowCTLSeparate" depends="antlr.flowCTLSeparate.checkforchanges" unless="antlr.flowCTLSeparate.nochanges">
<macrodef name="call-antlr">
<attribute name="name" />
<sequential>
<java classpathref="antlr.class.path" classname="org.antlr.v4.Tool" fork="true" failonerror="true">
<arg value="-o"/>
<arg path="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/separate/antlr"/>
<arg value="-package"/>
<arg value="uniolunisaar.adam.logic.parser.logics.flowctl.separate.antlr"/>
<arg line="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/separate/@{name}"/>
</java>
</sequential>
</macrodef>
<call-antlr name="FlowCTLSeparateFormat.g4" />
<!-- Touch the time stamp file which antlr.checkforchanges checks for -->
<touch file="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/separate/antlr/antlr.stamp" mkdirs="true"/>
</target>
<!-- %%%%%%%%%%%%%%%%%%%%%%%% CTL nested %%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<!-- Only run the antlr target if some .g file is newer than generated-src/antlr.stamp (which the antlr target touches) -->
<target name="antlr.flowCTLNested.checkforchanges">
<uptodate property="antlr.flowCTLNested.nochanges" targetfile="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/nested/antlr/antlr.stamp">
<srcfiles dir="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/nested" includes="**/*.g4"/>
</uptodate>
</target>
<!-- Antlr4 is called here -->
<target name="antlr.flowCTLNested" depends="antlr.flowCTLNested.checkforchanges" unless="antlr.flowCTLNested.nochanges">
<macrodef name="call-antlr">
<attribute name="name" />
<sequential>
<java classpathref="antlr.class.path" classname="org.antlr.v4.Tool" fork="true" failonerror="true">
<arg value="-o"/>
<arg path="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/nested/antlr"/>
<arg value="-package"/>
<arg value="uniolunisaar.adam.logic.parser.logics.flowctl.nested.antlr"/>
<arg line="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/nested/@{name}"/>
</java>
</sequential>
</macrodef>
<call-antlr name="FlowCTLNestedFormat.g4" />
<!-- Touch the time stamp file which antlr.checkforchanges checks for -->
<touch file="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/nested/antlr/antlr.stamp" mkdirs="true"/>
</target>
<!-- %%%%%%%%%%%%%%%%%%%%%%%% FlowCTL the for all fragment %%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<!-- Only run the antlr target if some .g file is newer than generated-src/antlr.stamp (which the antlr target touches) -->
<target name="antlr.flowCTLForAll.checkforchanges">
<uptodate property="antlr.flowCTLForAll.nochanges" targetfile="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/forall/antlr/antlr.stamp">
<srcfiles dir="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/forall" includes="**/*.g4"/>
</uptodate>
</target>
<!-- Antlr4 is called here -->
<target name="antlr.flowCTLForAll" depends="antlr.flowCTLForAll.checkforchanges" unless="antlr.flowCTLForAll.nochanges">
<macrodef name="call-antlr">
<attribute name="name" />
<sequential>
<java classpathref="antlr.class.path" classname="org.antlr.v4.Tool" fork="true" failonerror="true">
<arg value="-o"/>
<arg path="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/forall/antlr"/>
<arg value="-package"/>
<arg value="uniolunisaar.adam.logic.parser.logics.flowctl.forall.antlr"/>
<arg line="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/forall/@{name}"/>
</java>
</sequential>
</macrodef>
<call-antlr name="FlowCTLForAllFormat.g4" />
<!-- Touch the time stamp file which antlr.checkforchanges checks for -->
<touch file="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/forall/antlr/antlr.stamp" mkdirs="true"/>
</target>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%% DELEGATES %%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<target name="test" depends="loadProperties,antlr.flowLTL,antlr.flowCTLSeparate, antlr.flowCTLNested, antlr.flowCTLForAll" description="Runs all tests">
<antcall target="logics.fu.test"/>
<!--<ant antfile="${logics.basedir}/build_logics.xml" target="test"></ant> -->
</target>
<target name="test-method" depends="loadProperties,antlr.flowLTL,antlr.flowCTLSeparate, antlr.flowCTLNested, antlr.flowCTLForAll" description="Runs the tests of a specific method">
<antcall target="logics.fu.test-method"/>
</target>
<target name="test-class" depends="loadProperties,antlr.flowLTL,antlr.flowCTLSeparate, antlr.flowCTLNested, antlr.flowCTLForAll" description="Runs the tests of a specific class">
<antcall target="logics.fu.test-class"/>
</target>
<target name="javac" depends="loadProperties,antlr.flowLTL,antlr.flowCTLSeparate, antlr.flowCTLNested, antlr.flowCTLForAll" description="Compiles the module">
<antcall target="logics.fu.javac"/>
</target>
<target name="jar" depends="loadProperties,antlr.flowLTL,antlr.flowCTLSeparate, antlr.flowCTLNested, antlr.flowCTLForAll" description="Builds a jar with all its dependencies">
<antcall target="logics.fu.jar"/>
</target>
<target name="jar-standalone" depends="loadProperties,antlr.flowLTL,antlr.flowCTLSeparate, antlr.flowCTLNested, antlr.flowCTLForAll" description="Builds a jar with all its dependencies">
<antcall target="logics.fu.jar-standalone"/>
</target>
<target name="javadoc" depends="loadProperties,antlr.flowLTL,antlr.flowCTLSeparate, antlr.flowCTLNested, antlr.flowCTLForAll" description="Creates the JavaDoc of this package.">
<antcall target="logics.fu.javadoc"/>
</target>
<target name="clean" depends="loadProperties" description="Cleans all temporary files.">
<antcall target="logics.fu.clean"/>
</target>
<target name="clean-all" depends="loadProperties" description="Cleans all temporary files including the reports">
<delete dir="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowltl/antlr" failonerror="false"/>
<delete dir="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/separate/antlr" failonerror="false"/>
<delete dir="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/nested/antlr" failonerror="false"/>
<delete dir="${srcfolder}/uniolunisaar/adam/logic/parser/logics/flowctl/forall/antlr" failonerror="false"/>
<antcall target="logics.fu.clean-all"/>
</target>
</project>