-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
153 lines (126 loc) · 6.06 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
<?xml version="1.0" encoding="utf-8" ?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="Test" basedir="." default="test">
<target name="definir_propiedades">
<property name="src" value="src"/>
<property name="tests" value="tests"/>
<property name="build" value="build" />
<property name="libs" value="libs" />
<property name="src.out.dir" location="${build}/src" />
<property name="tests.out.dir" location="${build}/tests"/>
<property name="reports.out.dir" location="${build}/reports" />
<property name="reports.xml.dir" location="${reports.out.dir}/junit-xml" />
<property name="reports.html.dir" location="${reports.out.dir}/junit-html" />
<property name="tests.main" value="tests/jumast.fiuba.algoIII.tp2.Main"/>
<property name="jar.dest" value="app.jar"></property>
<path id="classpath">
<fileset dir="${libs}">
<include name="*.jar"/>
</fileset>
<pathelement location="${build}"/>
<pathelement location="${tests.out.dir}"/>
</path>
<path id="tests.classpath">
<fileset dir="${libs}">
<include name="*.jar"/>
</fileset>
<pathelement location="${src.out.dir}"/>
<pathelement location="${tests.out.dir}"/>
</path>
</target>
<target name="setup" depends="definir_propiedades, resolve">
<delete dir="${build}"/>
<mkdir dir="${build}"/>
<mkdir dir="${src.out.dir}"/>
<mkdir dir="${tests.out.dir}"/>
<mkdir dir="${reports.out.dir}"/>
<mkdir dir="${reports.xml.dir}" />
<mkdir dir="${reports.html.dir}" />
</target>
<target name="compilar.aplicacion.sin.deps">
<javac srcdir="${src}" destdir="${src.out.dir}" includeantruntime="false" debug="yes">
<classpath refid="classpath"/>
</javac>
</target>
<target name="compilar.tests.sin.deps">
<javac srcdir="${tests}" destdir="${tests.out.dir}" includeantruntime="false" debug="yes">
<classpath refid="tests.classpath"/>
</javac>
</target>
<target name="compilar.todo" depends="setup, compilar.aplicacion.sin.deps, compilar.tests.sin.deps"/>
<target name="ejecutar.tests.con.reportes" depends="compilar.todo">
<junit fork="yes" failureproperty="test.failure" forkmode="once" showoutput="true">
<classpath refid="tests.classpath"/>
<formatter type="xml"/>
<!--<test name="${testcase}" todir="${reports.xml.dir}" if="testcase" />-->
<batchtest todir="${reports.xml.dir}" unless="testcase">
<fileset dir="${tests.out.dir}" includes="**/*Test.class" />
<fileset dir="${tests.out.dir}" includes="**/*Prueba.class" />
<formatter type="plain" usefile="false"/>
</batchtest>
</junit>
<fail message="Pruebas fallidas" if="test.failure" />
<junitreport todir="${reports.xml.dir}">
<fileset dir="${reports.xml.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${reports.html.dir}" />
</junitreport>
</target>
<target name="ejecutar.tests.sin.reportes" depends="compilar.todo">
<junit fork="yes" failureproperty="test.failure" showoutput="false" logfailedtests="false">
<classpath refid="tests.classpath"/>
<batchtest todir="${reports.xml.dir}" unless="testcase">
<fileset dir="${tests.out.dir}" includes="**/*Test.class" />
<formatter type="plain" usefile="false"/>
</batchtest>
</junit>
<fail message="Pruebas fallidas" if="test.failure" />
</target>
<target name="test" depends="ejecutar.tests.sin.reportes"/>
<!-- Ivy customization -->
<property name="ivy.install.version" value="2.2.0" />
<property name="ivy.jar.dir" value="libs" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<available property="skip.download" file="${ivy.jar.file}"/>
<!-- End of 'Ivy customization -->
<!-- Ivy installation -->
<target name="download-ivy" unless="skip.download">
<mkdir dir="${ivy.jar.dir}" />
<!-- download Ivy from web site so that it can be used even
without any special installation -->
<echo message="installing ivy..." />
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true" />
</target>
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar" />
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
</target>
<!-- End of 'Ivy installation -->
<!--Resolve dependencies-->
<target name="resolve" depends="install-ivy" description="--> retrieve dependencies with ivy">
<ivy:retrieve conf="build" pattern="${libs}/[artifact]-[type]-[revision].[ext]" />
<ivy:retrieve conf="analysis" pattern="${libs}/analysis/[artifact](-[classifier]).[ext]"/>
</target>
<!-- End of 'Resolve dependencies -->
<target name="empaquetar" depends="setup, compilar.aplicacion.sin.deps">
<copy todir="build/src" >
<fileset dir="src/">
<include name="**/*.wav" />
<include name="**/*.fxml" />
<include name="**/*.css" />
<include name="**/*.png" />
<include name="**/*.jpg" />
<include name="**/*.jpeg" />
</fileset>
</copy>
<jar destfile="build/dist/algo3.jar" basedir="build/src"/>
</target>
<target name="jugar" depends="empaquetar">
<java classname="vista.Main" fork="true">
<classpath refid="classpath" />
<classpath location="${build}/dist/algo3.jar" />
</java>
</target>
</project>