forked from filipekt/JDEECoVisualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
103 lines (85 loc) · 4.1 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
<project name="JDEECoVisualizer" default="just_dist">
<description>
The DEECo component model is a novel component model for design and
development of Cyber-Physical Systems like software systems embedded in
vehicles, systems for smart infrastructure, etc. There are already
demonstration implementations of such systems using DEECo.
The goal of the thesis is to design and develop a visualization tool for data
collected from a DEECo-based implementation of a smart infrastructure for
e.g. cars. The tool has to be able to visualize the infrastructure, DEECo
components together with their internal DEECo knowledge. The tool has to be
implemented in Java.
</description>
<!-- Check if the Java version is less than 7 -->
<condition property="old_java">
<or>
<equals arg1="${ant.java.version}" arg2="1.1"/>
<equals arg1="${ant.java.version}" arg2="1.2"/>
<equals arg1="${ant.java.version}" arg2="1.3"/>
<equals arg1="${ant.java.version}" arg2="1.4"/>
<equals arg1="${ant.java.version}" arg2="1.5"/>
<equals arg1="${ant.java.version}" arg2="1.6"/>
</or>
</condition>
<!-- If the Java version is less than 7, then stop -->
<fail if="old_java"
message="Unsupported Java version: ${ant.java.version}. Make sure that the Java version is 1.7 or greater." />
<!-- Check if the Ant version is at least 1.8.2 -->
<antversion property="antversion" atleast="1.8.2"/>
<!-- If the Ant version is less than 1.8.2, then stop -->
<fail unless="antversion" message="Please upgrade to Ant version 1.8.2 or newer" />
<!-- Set the property java7 if the Java version is 7 -->
<condition property="java7">
<equals arg1="${ant.java.version}" arg2="1.7"/>
</condition>
<property name="src" value="src" />
<property name="bin" value="bin" />
<property name="build" value="build" />
<property name="dist" value="dist" />
<property name="res" value="resources" />
<property name="plugins" value="plugins" />
<target name="clean" description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
<target name="init" depends="clean">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<!-- Compile the sources if the current JVM version is 7. Compiles the java code
from ${src} into ${build} -->
<target name="compile-java7" depends="init" description="compile the source " if="java7">
<javac compiler="modern" encoding="UTF-8" srcdir="${src}" destdir="${build}"
source="1.7" target="1.7" includeAntRuntime="true" />
</target>
<!-- Compile the sources if the current JVM version is 8 or later. Compiles the
java code from ${src} into ${build} -->
<target name="compile-java8plus" depends="init" description="compile the source " unless="java7">
<javac compiler="modern" encoding="UTF-8" srcdir="${src}" destdir="${build}"
source="1.7" target="1.7" includeAntRuntime="false" />
</target>
<!-- Compile the sources. The actual compilation is delegated to specialized tasks,
depending on the version of the JVM -->
<target name="compile" depends="compile-java8plus,compile-java7" description="compile the source " />
<!-- Package the built application to a JAR file in the ${dist} directory -->
<target name="dist" depends="compile" description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- Create a manifest specifying the main class -->
<manifest file="${build}/MANIFEST.MF">
<attribute name="Main-Class" value="cz.filipekt.jdcv.Visualizer" />
</manifest>
<!-- Put everything in ${build} into the specified jar file -->
<jar jarfile="${dist}/${ant.project.name}.jar" manifest="${build}/MANIFEST.MF" >
<fileset dir="${build}" />
<mappedresources>
<fileset dir="${res}" />
<globmapper from="*" to="${res}/*"/>
</mappedresources>
</jar>
</target>
<target name="just_dist" depends="dist">
<delete dir="${build}" />
</target>
</project>