Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit 635da9a

Browse files
authored
Merge pull request #34 from brettle/master
Fix build, add Pathfinder lib, and provide a way to add 3rd-party libs
2 parents cf4650b + 84debd1 commit 635da9a

8 files changed

Lines changed: 41 additions & 3 deletions

File tree

Robot2018/.classpath

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
33
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="src" path="test"/>
45
<classpathentry kind="var" path="wpilib" sourcepath="wpilib.sources"/>
56
<classpathentry kind="var" path="networktables" sourcepath="networktables.sources"/>
67
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
78
<classpathentry kind="var" path="opencv" sourcepath="opencv.sources"/>
89
<classpathentry kind="var" path="cscore" sourcepath="cscore.sources"/>
910
<classpathentry kind="var" path="wpiutil" sourcepath="wpiutil.sources"/>
11+
<classpathentry kind="lib" path="lib/Pathfinder-Java-1.8.jar"/>
12+
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
1013
<classpathentry kind="output" path="bin"/>
1114
</classpath>

Robot2018/build.properties

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# Project specific information
22
package=org.usfirst.frc.team199.Robot2018
33
robot.class=${package}.Robot
4-
simulation.world.file=/usr/share/frcsim/worlds/GearsBotDemo.world
4+
simulation.world.file=/usr/share/frcsim/worlds/GearsBotDemo.world
5+
6+
# Tell the FRC Plugin to look for third-party libs (*.jar, and *.so) in the
7+
# "lib" directory instead of in ${user.home}/wpilib/user/java/lib
8+
# so that those libs can be versioned with the code and don't need to
9+
# be manually installed on each developer's machine. The FRC plugin
10+
# will automatically add all jars in the "lib" directory to the
11+
# classpath and will deploy the jars and .so files to the roboRIO along
12+
# with our code.
13+
# NOTE: The libs need to be directly in the "lib" dir, not in a subdir.
14+
userLibs.dir=lib
11.9 KB
Binary file not shown.

Robot2018/lib/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Place all third-party libraries (*.jar and *.so) directly in this directory,
2+
not a subdirectory.
3+
4+
The `userLibs.dir` property in `../build.properties` is set to point to
5+
this directory so that the FRC plugin will look here for third-party libs
6+
(*.jar, and *.so) instead of in `${user.home}/wpilib/user/java/lib`. This
7+
ensures that those libs can be versioned with the code and don't need to
8+
be manually installed on each developer's machine. The FRC plugin will
9+
automatically add all jars in this directory to the classpath and will
10+
deploy the jars and .so files to the roboRIO along with our code.
-4.18 MB
Binary file not shown.

Robot2018/lib/libpathfinderjava.so

36.8 KB
Binary file not shown.

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/RunScript.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class RunScript extends CommandGroup implements RunScriptInterface {
1717

1818
public RunScript(String scriptName) {
19-
ArrayList<String> script = Robot.autoScripts.getOrDefault(scriptName, new ArrayList<String>());
19+
ArrayList<String> script = null; // Robot.autoScripts.getOrDefault(scriptName, new ArrayList<String>());
2020

2121
outerloop:
2222
for(String cmd : script) {
@@ -55,7 +55,7 @@ public RunScript(String scriptName) {
5555
case "end":
5656
break outerloop;
5757
default:
58-
throw new Exception();
58+
// TODO: Handle this case
5959
}
6060
}
6161
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package jaci.pathfinder;
2+
3+
import static org.junit.jupiter.api.Assertions.*;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
class PathfinderTest {
8+
9+
@Test
10+
/** Just a very basic test to ensure that the Pathfinder jar is installed, and we can reference it. **/
11+
void testPathfinder() {
12+
assertNotNull(new Pathfinder());
13+
}
14+
15+
}

0 commit comments

Comments
 (0)