Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. plugins {
  2. id 'idea'
  3. id "org.jetbrains.kotlin.jvm" version "1.3.20"
  4. id "edu.wpi.first.GradleRIO" version "2019.4.1"
  5. }
  6.  
  7. def ROBOT_MAIN_CLASS = "frc.team1984.robot.MainKt"
  8.  
  9. // Define my targets (RoboRIO) and artifacts (deployable files)
  10. // This is added by GradleRIO's backing project EmbeddedTools.
  11. deploy {
  12. targets {
  13. roboRIO("roborio") {
  14. // Team number is loaded either from the .wpilib/wpilib_preferences.json
  15. // or from command line. If not found an exception will be thrown.
  16. // You can use getTeamOrDefault(team) instead of getTeamNumber if you
  17. // want to store a team number in this file.
  18. team = frc.getTeamNumber()
  19. }
  20. }
  21. artifacts {
  22. frcJavaArtifact('frcJava') {
  23. targets << "roborio"
  24. // Debug can be overridden by command line, for use with VSCode
  25. debug = frc.getDebugOrDefault(false)
  26. }
  27. // Built in artifact to deploy arbitrary files to the roboRIO.
  28. fileTreeArtifact('frcStaticFileDeploy') {
  29. // The directory below is the local directory to deploy
  30. files = fileTree(dir: 'src/main/deploy')
  31. // Deploy to RoboRIO target, into /home/lvuser/deploy
  32. targets << "roborio"
  33. directory = '/home/lvuser/deploy'
  34. }
  35. }
  36. }
  37.  
  38. repositories {
  39. mavenCentral()
  40. jcenter()
  41. }
  42.  
  43. // Defining my dependencies. In this case, WPILib (+ friends)
  44. dependencies {
  45. compile wpi.deps.wpilib()
  46. compile wpi.deps.vendor.java()
  47. nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio)
  48. nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
  49.  
  50. // We need to add the Kotlin stdlib in order to use most Kotlin language features.
  51. compile "org.jetbrains.kotlin:kotlin-stdlib"
  52. compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1'
  53. compile 'com.google.code.gson:gson:2.8.5'
  54. }
  55.  
  56. // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar')
  57. // in order to make them all available at runtime. Also adding the manifest so WPILib
  58. // knows where to look for our Robot Class.
  59. jar {
  60. from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
  61. manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
  62. }
  63.  
  64. wrapper {
  65. gradleVersion = '5.0'
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement