-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
93 lines (75 loc) · 2.59 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import edu.wpi.first.gradlerio.GradleRIOPlugin
import edu.wpi.first.gradlerio.frc.FRCJavaArtifact
import edu.wpi.first.gradlerio.frc.RoboRIO
import edu.wpi.first.toolchain.NativePlatforms
import jaci.gradle.deploy.artifact.ArtifactsExtension
import jaci.gradle.deploy.artifact.FileTreeArtifact
import jaci.gradle.deploy.target.TargetsExtension
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-serialization:1.3.41")
}
}
plugins {
kotlin("jvm") version "1.3.41"
id("edu.wpi.first.GradleRIO") version "2019.3.2"
}
apply(plugin = "kotlinx-serialization")
val kMainRobotClass = "frc.team4069.robot.RobotKt"
deploy {
targets {
roboRIO()
}
artifacts {
frcJavaArtifact()
frcStaticFileDeploy()
}
}
repositories {
jcenter()
mavenCentral()
mavenLocal()
maven { setUrl("http://dl.bintray.com/kyonifer/maven") }
maven { setUrl("https://jitpack.io") }
}
dependencies {
// Kotlin Standard Library and Coroutines
compile(kotlin("stdlib"))
compile("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.1.0")
compile("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.11.1")
// compile("com.github.FRCTeam4069:SaturnLibrary:2020.0.0-2")
compile("frc.team4069.saturn.lib:wpi:2020.0.0")
compile("frc.team4069.saturn.lib:vendorCTRE:2020.0.0")
compile("frc.team4069.saturn.lib:vendorREV:2020.0.0")
compile("com.github.Oblarg", "Oblog", "2.12.7")
compile("com.fazecast:jSerialComm:2.5.1")
// WPILib
wpi.deps.wpilib().forEach { compile(it) }
wpi.deps.vendor.java().forEach { compile(it) }
wpi.deps.vendor.jni(NativePlatforms.roborio).forEach { nativeZip(it) }
wpi.deps.vendor.jni(NativePlatforms.desktop).forEach { nativeDesktopZip(it) }
}
tasks.jar {
doFirst {
from(configurations.compile.get().map {
if(it.isDirectory) it else zipTree(it)
})
manifest(GradleRIOPlugin.javaManifest(kMainRobotClass))
}
}
tasks.withType<Wrapper>().configureEach {
gradleVersion = "5.0"
}
fun TargetsExtension.roboRIO() =
target("roboRIO", RoboRIO::class.java, closureOf<RoboRIO> { team = 4069; timeout = 1000 })
fun ArtifactsExtension.frcJavaArtifact() =
artifact("frcJava", FRCJavaArtifact::class.java, closureOf<FRCJavaArtifact> { targets.add("roboRIO") })
fun ArtifactsExtension.frcStaticFileDeploy() =
fileTreeArtifact("frcStaticFileDeploy", closureOf<FileTreeArtifact> {
setFiles(fileTree("src/main/deploy"))
targets.add("roboRIO")
directory = "/home/lvuser/deploy"
})