Skip to content

Commit

Permalink
Merge pull request #6 from Team488/fix-everything
Browse files Browse the repository at this point in the history
Port build changes from 2016 robot to fix link errors and other issues
  • Loading branch information
WasabiFan authored Sep 3, 2016
2 parents ca0b9b7 + 5611f1d commit 3e8a486
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ jdk:
- oraclejdk8
script:
- cd CompetitionTemplate
- ant check -f robot-program-build.xml
- ant check -f travis-build.xml
3 changes: 3 additions & 0 deletions CompetitionTemplate/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/bin/
/TeamDatabase
derby.log
/488Logs
4 changes: 2 additions & 2 deletions CompetitionTemplate/lib/log4jConfig/deployLogging.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

<target name="sendConfig" depends="get-target-ip">
<echo>[SendLogConfig] Copying log4j.xml over.</echo>
<scp file="log4j.xml" todir="admin@${target}:/usr/local/natinst/labview/" password="" trust="true"/>
<scp file="log4j.xml" todir="admin@${target}:/" password="" trust="true"/>
</target>

<target name="get-target-ip">
<property name="ant.enable.asserts" value="true"/>
<property name="target" value="roboRIO-${team-number}.local" />
<property name="target" value="roboRIO-${team-number}-FRC.local" />
<echo>Trying Target: ${target}</echo>
<if>
<isreachable host="${target}" timeout="5"/>
Expand Down
18 changes: 9 additions & 9 deletions CompetitionTemplate/robot-program-build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@ simulation.world.file=/usr/share/frcsim/worlds/GearsBotDemo.world
version=current

# Libraries to use
wpilib=${user.home}/wpilib/java/${version}
wpilib.lib=${wpilib}/lib
wpilib.jar=${wpilib.lib}/WPILib.jar
wpilib.sources=${wpilib.lib}/WPILib-sources.jar
networktables.jar=${wpilib.lib}/NetworkTables.jar
networktables.sources=${wpilib.lib}/NetworkTables-sources.jar

commonlib.root=../SeriouslyCommonLib
commonlib.dist=${commonlib.root}/dist
commonlib.libs=${commonlib.root}/lib
commonlib.jar=${commonlib.dist}/XbotCommonLib.jar

wpilib.jar=${commonlib.libs}/WPILib.jar
wpilib.sources=${commonlib.libs}/WPILib-sources.jar
networktables.jar=${commonlib.libs}/NetworkTables.jar
networktables.sources=${commonlib.libs}/NetworkTables-sources.jar

guice.jar=${commonlib.libs}/guice-3.0/guice-3.0-no_aop.jar
guice_assisted.jar=${commonlib.libs}/guice-3.0/guice-assistedinject-3.0.jar
inject.jar=${commonlib.libs}/guice-3.0/javax.inject.jar
log4j.jar=${commonlib.libs}/log4j/log4j-1.2.17.jar
commonsio.jar=${commonlib.libs}/commons-io-2.4/commons-io-2.4.jar
derby.jar=${commonlib.libs}/Derby/derby.jar
derby.jar=${commonlib.libs}/derby/derby.jar
junit.jars=${commonlib.libs}/hamcrest-core-1.3.jar:${commonlib.libs}/junit-4.12.jar

thirdpartyjars=${guice.jar}:${guice_assisted.jar}:${inject.jar}:${derby.jar}:${log4j.jar}:${commonsio.jar}

classpath=${wpilib.jar}:${networktables.jar}:${thirdpartyjars}:${commonlib.jar}

wpilib.ant.dir=${commonlib.libs}/ant

# Build information
jar=RobotProgram.jar
jar=FRCUserProgram.jar
src.dir=src
test.dir=tests
test.src.dir=tests
Expand Down
12 changes: 6 additions & 6 deletions CompetitionTemplate/robot-program-build.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<project name="FRC Deployment" default="deploy">
<project name="FRC Deployment" default="deploy-logs-and-code">

<!-- Note that ant doesn't allow you to override properties, -->
<!-- so the files are listed in order of descending priority. -->
Expand All @@ -19,10 +19,10 @@
<!-- Build JAR for the common lib -->
<ant antfile="${commonlib.root}/commonlib-build.xml" target="jar-with-test-code" inheritAll="false" />

<!-- TODO: Do we want this commented out? -->
<!-- Original commit that made this change said "Something is wrong with deploying the build on my computer, so disabling copying log config" -->
<!-- <ant antfile="../log4jConfig/deployLogging.xml" target="sendConfig" inheritall="false"/> -->

<target name="deploy-logs-and-code" depends="deploy">
<ant antfile="lib/log4jConfig/deployLogging.xml" target="sendConfig" inheritall="false"/>
</target>
<!-- Run the WPILib script to deploy our program (including common lib JAR and custom libs) -->
<import file="${commonlib.root}/wpilib-scripts/wpilib-build.xml" />

Expand All @@ -42,7 +42,7 @@
<batchtest fork="yes" todir="${test.report.dir}">
<formatter type="brief" usefile="false" />
<fileset dir="${test.dest.dir}">
<include name="**/*Test*.class" />
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import xbot.common.command.BaseSubsystem;
import xbot.common.controls.actuators.XSpeedController;
import xbot.common.injection.wpi_factories.WPIFactory;
import xbot.common.properties.PropertyManager;
import xbot.common.properties.XPropertyManager;

@Singleton
public class DriveSubsystem extends BaseSubsystem {
Expand All @@ -20,7 +20,7 @@ public class DriveSubsystem extends BaseSubsystem {
public final XSpeedController rightRearDrive;

@Inject
public DriveSubsystem(WPIFactory factory, PropertyManager propManager) {
public DriveSubsystem(WPIFactory factory, XPropertyManager propManager) {
log.info("Creating DriveSubsystem");

this.leftFrontDrive = factory.getSpeedController(0);
Expand Down
46 changes: 46 additions & 0 deletions CompetitionTemplate/travis-build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Project specific information
package=competition
robot.class=${package}.Robot

version=current

# Libraries to use
commonlib.root=../SeriouslyCommonLib
commonlib.dist=${commonlib.root}/dist
commonlib.libs=${commonlib.root}/lib
commonlib.jar=${commonlib.dist}/XbotCommonLib.jar

wpilib.jar=${commonlib.libs}/WPILib.jar
wpilib.sources=${commonlib.libs}/WPILib-sources.jar
networktables.jar=${commonlib.libs}/NetworkTables.jar
networktables.sources=${commonlib.libs}/NetworkTables-sources.jar

guice.jar=${commonlib.libs}/guice-3.0/guice-3.0-no_aop.jar
guice_assisted.jar=${commonlib.libs}/guice-3.0/guice-assistedinject-3.0.jar
inject.jar=${commonlib.libs}/guice-3.0/javax.inject.jar
log4j.jar=${commonlib.libs}/log4j/log4j-1.2.17.jar
commonsio.jar=${commonlib.libs}/commons-io-2.4/commons-io-2.4.jar
derby.jar=${commonlib.libs}/Derby/derby.jar
junit.jars=${commonlib.libs}/hamcrest-core-1.3.jar:${commonlib.libs}/junit-4.12.jar

thirdpartyjars=${guice.jar}:${guice_assisted.jar}:${inject.jar}:${derby.jar}:${log4j.jar}:${commonsio.jar}

classpath=${wpilib.jar}:${networktables.jar}:${thirdpartyjars}:${commonlib.jar}

wpilib.ant.dir=${commonlib.libs}/ant

# Build information
jar=FRCUserProgram.jar
src.dir=src
test.dir=tests
test.src.dir=tests
test.dest.dir=dist/tests
build.dir=build
build.jars=${build.dir}/jars
test.report.dir=${build.dir}/test-reports
dist.dir=dist
dist.jar=${dist.dir}/${jar}


test.classpath=${classpath}:${junit.jars}:${dist.jar}
test.magic.classpath=${test.classpath}:${test.dest.dir}
6 changes: 6 additions & 0 deletions CompetitionTemplate/travis-build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<project name="Travis testing" default="check">
<property file="travis-build.properties" />
<import file="robot-program-build.xml"/>
</project>
2 changes: 1 addition & 1 deletion SeriouslyCommonLib
Submodule SeriouslyCommonLib updated 33 files
+3 −0 commonlib-build.properties
+4 −4 install_plugins.bat
+ lib/NetworkTables-sources.jar
+ lib/NetworkTables.jar
+ lib/WPILib-sources.jar
+ lib/WPILib.jar
+2 −2 lib/ant/build.properties
+16 −3 src/xbot/common/command/BaseRobot.java
+5 −3 src/xbot/common/controls/sensors/AnalogDistanceSensor.java
+2 −2 src/xbot/common/controls/sensors/Lidar.java
+0 −2 src/xbot/common/controls/sensors/XEncoder.java
+2 −2 src/xbot/common/controls/sensors/adapters/InertialMeasurementUnitAdapter.java
+11 −0 src/xbot/common/controls/sensors/nav6/IMU.java
+12 −0 src/xbot/common/controls/sensors/navx/AHRS.java
+7 −9 src/xbot/common/controls/sensors/wpi_adapters/EncoderWPIAdapter.java
+5 −5 src/xbot/common/injection/wpi_factories/RealWPIFactory.java
+1 −1 src/xbot/common/injection/wpi_factories/WPIFactory.java
+5 −1 src/xbot/common/math/ContiguousDouble.java
+1 −1 src/xbot/common/math/ContiguousHeading.java
+28 −14 src/xbot/common/math/PIDManager.java
+4 −4 src/xbot/common/math/XYPairManager.java
+2 −2 src/xbot/common/properties/BooleanProperty.java
+2 −2 src/xbot/common/properties/DoubleProperty.java
+2 −2 src/xbot/common/properties/Property.java
+2 −2 src/xbot/common/properties/StringProperty.java
+11 −24 src/xbot/common/properties/XPropertyManager.java
+0 −6 tests/edu/wpi/first/wpilibj/MockEncoder.java
+3 −3 tests/xbot/common/controls/sensors/AnalogDistanceSensorTest.java
+3 −3 tests/xbot/common/injection/BaseWPITest.java
+62 −1 tests/xbot/common/injection/wpi_factories/MockWPIFactory.java
+1 −1 tests/xbot/common/injection/wpi_factories/MockWPIFactoryTest.java
+31 −0 tests/xbot/common/math/PIDManagerTest.java
+2 −2 wpilib-scripts/wpilib-build.xml

0 comments on commit 3e8a486

Please sign in to comment.