Brian Silverman | 890a32a | 2018-03-11 15:41:56 -0700 | [diff] [blame] | 1 | //input parameters |
| 2 | def beta = project.hasProperty('beta') ? project.beta : false |
| 3 | |
| 4 | //defaults |
| 5 | ext.wpiDepYear = 2018 |
| 6 | ext.wpiDeps = "wpi-dependencies-2018.gradle" |
| 7 | ext.FRCToolChainYear = 2018 |
| 8 | ext.wpilibjDep = 'edu.wpi.first.wpilibj:wpilibj-java:+' |
| 9 | ext.javaNetTablesDep = 'edu.wpi.first.ntcore:ntcore-java:+' |
| 10 | |
| 11 | if(beta) |
| 12 | { |
| 13 | |
| 14 | } |
| 15 | |
| 16 | |
| 17 | |
| 18 | //Choose which dependencies gradle to use |
| 19 | if(wpiDepYear == 2017) |
| 20 | { |
| 21 | wpiDeps = "wpi-dependencies-2017.gradle" |
| 22 | wpilibjDep = 'edu.wpi.first.wpilibj:athena:+' |
| 23 | javaNetTablesDep = 'edu.wpi.first.wpilib.networktables.java:NetworkTables:+:arm' |
| 24 | println "[INFO] Using 2017 WPI dependencies" |
| 25 | } |
| 26 | else if (wpiDepYear == 2018) |
| 27 | { |
| 28 | wpiDeps = "wpi-dependencies-2018.gradle" |
| 29 | wpilibjDep = 'edu.wpi.first.wpilibj:wpilibj-java:+' |
| 30 | javaNetTablesDep = 'edu.wpi.first.ntcore:ntcore-java:+' |
| 31 | println "[INFO] Using 2018 WPI dependencies" |
| 32 | } |
| 33 | |
| 34 | ext.toolChainVers = null |
| 35 | ext.instToolChain = null |
| 36 | |
| 37 | toolChainVers = new File('C:/frc/version.txt') |
| 38 | if(toolChainVers.exists()){instToolChain = toolChainVers.text} |
| 39 | else {println "[INFO] Toolchain version not found"} |
| 40 | |
| 41 | |
| 42 | //Choose the path for your FRC Toolchain |
| 43 | if(FRCToolChainYear == 2018) |
| 44 | { |
| 45 | if(instToolChain != null && instToolChain != '2018'){throw new GradleException('2018 FRC Toolchain Not Installed')} |
| 46 | println "[INFO] Using 2018 FRC Toolchain" |
| 47 | } |
| 48 | else if(FRCToolChainYear == 2017) |
| 49 | { |
| 50 | if(instToolChain != null && instToolChain != '2017'){throw new GradleException('2017 FRC Toolchain Not Installed')} |
| 51 | println "[INFO] Using 2017 FRC Toolchain" |
| 52 | } |
| 53 | //default to PATH otherwise |