Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. plugins {
  2. id "java"
  3. id 'org.hidetake.ssh' version '0.4.5'
  4. }
  5.  
  6. sourceCompatibility = '1.8'
  7. targetCompatibility = '1.8'
  8.  
  9. def wpilibDir = System.env['HOME'] + '/wpilib/java/current'
  10.  
  11. repositories {
  12. mavenCentral()
  13.  
  14. flatDir {
  15. dirs wpilibDir + '/lib'
  16. }
  17. }
  18.  
  19. dependencies {
  20. compile name: 'NetworkTables'
  21. compile name: 'WPILib'
  22. }
  23.  
  24. remotes {
  25. roboRIO {
  26. host = 'roboRIO-' + team + '.local'
  27. user = 'admin'
  28. password = ''
  29. }
  30. }
  31.  
  32. ssh.settings {
  33. knownHosts = allowAnyHosts
  34. }
  35.  
  36. jar {
  37. baseName = 'FRCUserProgram'
  38.  
  39. manifest {
  40. attributes 'Main-Class': 'edu.wpi.first.wpilibj.RobotBase',
  41. 'Robot-Class': robotClass
  42. }
  43.  
  44. from {
  45. configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
  46. }
  47. }
  48.  
  49. task deploy(dependsOn: 'jar') << {
  50. description = "Deploy the user program to the roboRIO"
  51.  
  52. ssh.run {
  53. session(remotes.roboRIO) {
  54. put jar.archivePath, '/home/lvuser'
  55. put wpilibDir + '/ant/robotCommand', '/home/lvuser'
  56. execute '. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r'
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement