Skip to content

Instantly share code, notes, and snippets.

@ThomasJClark
Created January 27, 2015 00:50
Show Gist options
  • Save ThomasJClark/0ed21bc24c395aa2e9b4 to your computer and use it in GitHub Desktop.
Save ThomasJClark/0ed21bc24c395aa2e9b4 to your computer and use it in GitHub Desktop.
WPILib grade build
plugins {
id "java"
id 'org.hidetake.ssh' version '0.4.5'
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
def wpilibDir = System.env['HOME'] + '/wpilib/java/current'
repositories {
mavenCentral()
flatDir {
dirs wpilibDir + '/lib'
}
}
dependencies {
compile name: 'NetworkTables'
compile name: 'WPILib'
}
remotes {
roboRIO {
host = 'roboRIO-' + team + '.local'
user = 'admin'
password = ''
}
}
ssh.settings {
knownHosts = allowAnyHosts
}
jar {
baseName = 'FRCUserProgram'
manifest {
attributes 'Main-Class': 'edu.wpi.first.wpilibj.RobotBase',
'Robot-Class': robotClass
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
task deploy(dependsOn: 'jar') << {
description = "Deploy the user program to the roboRIO"
ssh.run {
session(remotes.roboRIO) {
put jar.archivePath, '/home/lvuser'
put wpilibDir + '/ant/robotCommand', '/home/lvuser'
execute '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r'
}
}
}
# Use this file to set your main class and team number
robotClass = org.usfirst.frc.team190.robot.Robot
team = 190
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment