-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
99 lines (88 loc) · 4.58 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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="NBodyProblem" default="run" basedir=".">
<property name="projet.sources.dir" value="src"/>
<property name="projet.bin.dir" value="bin"/>
<property name="projet.lib.dir" value="lib"/>
<property name="projet.javadoc.dir" value="docs"/>
<property name="projet.jar.dir" value="dist"/>
<property name="main.class" value="gui.Main" />
<path id="projet.classpath">
<fileset dir="${projet.lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement location="${projet.bin.dir}"/>
</path>
<target name="copy" description="Copie des fichiers statiques">
<copy todir="${projet.bin.dir}/gui/">
<fileset dir="${projet.sources.dir}/gui/">
<include name="*.css"/>
</fileset>
</copy>
<copy todir="${projet.bin.dir}/gui/">
<fileset dir="${projet.sources.dir}/gui/">
<include name="*.jpg"/>
</fileset>
</copy>
</target>
<target name="compile" description="Compilation des classes" depends="copy">
<javac Encoding="utf-8" srcdir="${projet.sources.dir}" destdir="${projet.bin.dir}" debug="on" optimize="off" deprecation="on" includeantruntime="false" modulepath="${projet.lib.dir}">
<classpath refid="projet.classpath"/>
<compilerarg value="--add-modules" />
<compilerarg value="javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web" />
</javac>
</target>
<target name="run" description="Execution" depends="compile">
<java classname="${main.class}" fork="true" modulepath="${projet.lib.dir}">
<classpath refid="projet.classpath"/>
<jvmarg value="--add-modules" />
<jvmarg value="javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web" />
<!-- <jvmarg value="-Djavafx.verbose=true" /> -->
</java>
</target>
<target name="runpackage" description="Execution" depends="packaging">
<java jar="${projet.jar.dir}/${ant.project.name}.jar" fork="true" modulepath="${projet.lib.dir}">
<jvmarg value="--add-modules" />
<jvmarg value="javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web" />
</java>
</target>
<target name="doc">
<javadoc Encoding="utf-8" windowtitle="${ant.project.name}" useexternalfile="true" use="true" access="private" sourcepath="${projet.sources.dir}" destdir="${projet.javadoc.dir}">
<fileset dir="${projet.sources.dir}" defaultexcludes="yes">
<include name="*.java" />
</fileset>
<classpath refid="projet.classpath"/>
</javadoc>
</target>
<target name="packaging" depends="compile">
<jar jarfile="${projet.jar.dir}/${ant.project.name}.jar" basedir="${projet.bin.dir}">
<zipgroupfileset dir="${projet.lib.dir}" includes="*.jar" />
<manifest>
<attribute name="Manifest-Version" value="1.0" />
<attribute name="Created-By" value="AGBODJAN Wilfried 21914933, LETELLIER Guillaume 21804030, MORLAY Antoine 21803153, PIGNARD Alexandre 21701890" />
<attribute name="Main-Class" value="${main.class}" />
</manifest>
</jar>
</target>
<macrodef name="javaTestExec">
<attribute name="file" />
<sequential>
<java classname="@{file}" fork="true" modulepath="${projet.lib.dir}">
<classpath refid="projet.classpath"/>
<jvmarg value="-ea" />
</java>
</sequential>
</macrodef>
<target name="test" depends="compile">
<javaTestExec file="math_physics.math.test.MatrixAssert" />
<javaTestExec file="math_physics.math.test.Vector3DAssert" />
<javaTestExec file="math_physics.physics.test.FormulaAssert" />
<javaTestExec file="math_physics.physics.test.MacroObjectAssert" />
<javaTestExec file="barnes_hut.test.OctalAssert" />
<javaTestExec file="barnes_hut.test.BHTreeAssert" />
<javaTestExec file="barnes_hut.test.BHMacroObjectAssert" />
</target>
<target name="full" depends="packaging,doc,run">
<echo message="Compilation, exécution, packaging et création de la documentation du projet ${ant.project.name}" />
</target>
</project>
<!-- Ajouts possibles : gestion des collisions -->