-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
54 lines (48 loc) · 1.99 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Travis CI" default="test" basedir=".">
<!-- Variables globales -->
<property name="src" location="src" />
<property name="build" location="build" />
<property name="test" location="test" />
<property name="junit" location="lib/junit-4.10.jar" />
<property name="checkstyle.lib" location="lib/checkstyle-5.6-all.jar" />
<property name="checkstyle.checks" location="MIW_checkstyle.xml" />
<!-- Se resuelven las dependencias -->
<path id="classpath.test">
<pathelement location="${build}/main" />
<pathelement location="${build}/test" />
<pathelement location="${junit}" />
</path>
<!-- Creando directorios... -->
<target name="init">
<mkdir dir="${build}/main" />
<mkdir dir="${build}/test" />
</target>
<!-- Ejecutar checkstyle, salida en fichero XML -->
<target name="checkstyle">
<taskdef resource="checkstyletask.properties" classpath="${checkstyle.lib}" />
<checkstyle config="${checkstyle.checks}" failureProperty="checkstyle.failure" failOnViolation="false">
<formatter type="xml" usefile="false" />
<fileset dir="${src}" includes="**/*.java" />
</checkstyle>
</target>
<!-- compilar... -->
<target name="compila" description="Compila">
<javac includeantruntime="false" srcdir="${src}" destdir="${build}/main" classpathref="classpath.test" />
<javac includeantruntime="false" srcdir="${test}" destdir="${build}/test" classpathref="classpath.test" />
</target>
<!-- Principal... -->
<target name="test" depends="init, checkstyle, compila" description="Integracion Continua">
<echo message="Integracion Continua..." />
<junit printsummary="on" fork="yes" haltonfailure="true">
<classpath refid="classpath.test" />
<batchtest fork="yes">
<formatter type="brief" usefile="false" />
<fileset dir="${test}">
<include name="**/SumaTest.java" />
<!-- <include name="**/*Test*.java" /> -->
</fileset>
</batchtest>
</junit>
</target>
</project>