-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.xml
149 lines (136 loc) · 5.31 KB
/
default.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="NU17-FRamework" default="compile">
<property name="wpilib" value="wpilib"/>
<property name="userLibs.dir" value="${wpilib}/userLibs"/>
<property file="build.properties"/>
<property file="${wpilib}/ant/build.properties"/>
<property file="${wpilib}/ant/ni_image.properties"/>
<property name="ivy.install.version" value="2.1.0-rc2"/>
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME"/>
</condition>
<property name="ivy.home" value="${user.home}/.ant"/>
<property name="ivy.jar.dir" value="${ivy.home}/lib"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<target name="init-checkstyle">
<path id="checkstyle.lib.path">
<fileset dir="lib" includes="*.jar"/>
</path>
<!-- Sevntu custom checks are retrieved by Ivy into lib folder and will be accessible to checkstyle-->
<taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"
classpathref="checkstyle.lib.path"/>
</target>
<target name="checkstyle"
description="Generates a report of code convention violations."
depends="init-checkstyle">
<!-- See http://checkstyle.sourceforge.net/anttask.html for full options of using checkstyle with ant-->
<checkstyle config="docs/google_checks.xml"
failureProperty="checkstyle.failure"
failOnViolation="true"
maxWarnings="0">
<formatter type="plain"/>
<fileset dir="src" includes="**/*.java"/>
<fileset dir="test" includes="**/*.java"/>
</checkstyle>
<fail message="Style failure detected, check." if="checkstyle.failure"/>
</target>
<target name="compile" description="Try to override WPILib's compile step"
depends="compileFRamework">
<mkdir dir="${build.dir}"/>
<path id="classpath.path">
<fileset dir="${userLibs.dir}" includes="*.jar"/>
<fileset file="${wpilib.jar}"/>
<fileset file="${networktables.jar}"/>
<fileset file="${opencv.jar}"/>
<fileset file="${cscore.jar}"/>
<fileset dir="${userLibs}" erroronmissingdir="false"/>
<fileset dir="lib/"
includes="*.jar"/> <!-- include everything, I did not remove wpi's specific includes-->
<pathelement path="FRamework/build"/>
</path>
<pathconvert property="classpathProp" refid="classpath.path"/>
<echo>[athena-compile] Compiling ${src.dir} with classpath=${classpathProp} to ${build.dir}
</echo>
<javac srcdir="${src.dir}"
destdir="${build.dir}"
includeAntRuntime="no"
includeJavaRuntime="no"
classpathref="classpath.path"
target="${ant.java.version}"
source="${ant.java.version}"
compiler="javac${ant.java.version}"
debug="true">
</javac>
</target>
<target name="test" depends="compile">
<path id="classpath.path">
<fileset dir="${userLibs}" erroronmissingdir="false"/>
<fileset dir="lib/"
includes="*.jar"/> <!-- include everything, I did not remove wpi's specific includes-->
<pathelement path="FRamework/build"/>
</path>
<javac srcdir="${test.dir}"
destdir="${build.dir}"
includeAntRuntime="no"
includeJavaRuntime="no"
classpathref="classpath.path"
target="1.8"
source="1.8"
compiler="javac1.8"
debug="true">
</javac>
<junit haltonfailure="no" failureproperty="test.failed">
<classpath location="${build.dir}"/>
<!-- Make sure these two libraries are included -->
<classpath location="lib/junit-4.12.jar"/>
<classpath location="lib/hamcrest-core-1.3.jar"/>
<classpath refid="classpath.path"/>
<batchtest>
<fileset dir="test">
<include name="**/*Test*"/>
</fileset>
</batchtest>
<formatter type="brief" usefile="false"/>
</junit>
<fail message="Test failure detected, check test results." if="test.failed"/>
</target>
<target name="jar" depends="compile">
<echo>[athena-jar] Making jar ${dist.jar}.</echo>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${build.jars}"/>
<echo>[athena-jar] Copying jars to ${build.jars}.</echo>
<copy todir="${build.jars}" flatten="true">
<path refid="classpath.path"/>
</copy>
<jar destfile="${dist.jar}" update="false">
<manifest>
<attribute name="Main-Class" value="edu.wpi.first.wpilibj.RobotBase"/>
<attribute name="Robot-Class" value="${robot.class}"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${build.dir}" includes="**/*.class"/>
<fileset dir="FRamework/build" includes="**/*.class"/>
<zipgroupfileset dir="${build.jars}"/>
</jar>
</target>
<import file="${wpilib.ant.dir}/build.xml"/>
<target name="compileFRamework">
<echo>Installing FRamework and compiling dependencies</echo>
<subant target="compile">
<fileset dir="FRamework/" includes="build.xml"/>
</subant>
</target>
<target name="deploy-native-libs" depends="get-target-ip">
<scp todir="${adminUsername}@${target}:${native-lib.target-dir}"
password="${adminPassword}"
trust="true">
<fileset dir="wpilib/userLibs/" includes="*.so*"/>
</scp>
<sshexec host="${target}"
username="${adminUsername}"
password="${adminPassword}"
trust="true"
command="chmod -R +x ${native-lib.target-dir}"
/>
</target>
</project>