mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
Unit tests now run using shared wpilib as well, since we had to add a ton of sharedl ibraries anyway. Test scripts also updated to work properly.
91 lines
1.9 KiB
Groovy
91 lines
1.9 KiB
Groovy
apply plugin: 'java'
|
|
apply plugin: 'application'
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
|
|
evaluationDependsOn(':wpilibj')
|
|
|
|
mainClassName = 'edu.wpi.first.wpilibj.RobotBase'
|
|
|
|
buildscript {
|
|
repositories { jcenter() }
|
|
dependencies {
|
|
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
|
|
}
|
|
}
|
|
|
|
def wpilibj = project(':wpilibj')
|
|
|
|
dependencies {
|
|
compile wpilibj
|
|
compile files(wpilibj.sourceSets.test.output.classesDir)
|
|
compile 'edu.wpi.first.wpilib.networktables.java:NetworkTables:+:arm'
|
|
compile 'edu.wpi.first.wpilib.networktables.java:NetworkTables:+:arm'
|
|
compile 'edu.wpi.cscore.java:cscore:+:arm'
|
|
}
|
|
|
|
def nativeDirectory = "$buildDir/output"
|
|
|
|
clean {
|
|
delete nativeDirectory
|
|
}
|
|
|
|
task copyRobotLibraries(type: Copy) {
|
|
description = 'Copies all native libraries to an easy to find folder'
|
|
group = 'WPILib'
|
|
destinationDir = file(nativeDirectory)
|
|
dependsOn shadowJar
|
|
dependsOn ':hal:build'
|
|
dependsOn ':wpilibj:build'
|
|
|
|
from (shadowJar) {
|
|
into '/'
|
|
}
|
|
|
|
project(':wpilibj').model {
|
|
binaries {
|
|
withType(SharedLibraryBinarySpec) { spec ->
|
|
from(spec.sharedLibraryFile) {
|
|
into '/'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
project(':hal').model {
|
|
binaries {
|
|
withType(SharedLibraryBinarySpec) { spec ->
|
|
from(spec.sharedLibraryFile) {
|
|
into '/'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
defineNetworkTablesProperties()
|
|
defineWpiUtilProperties()
|
|
defineCsCoreProperties()
|
|
|
|
from (file(netSharedLib)) {
|
|
into '/'
|
|
}
|
|
|
|
from (file(wpiUtilSharedLib)) {
|
|
into '/'
|
|
}
|
|
|
|
from (file(csLibArmLocation).path) {
|
|
include '**/*so.3.1'
|
|
include '**/libcscore.so'
|
|
include '**/libopencv_java310.so'
|
|
into '/'
|
|
}
|
|
|
|
}
|
|
|
|
|
|
build.dependsOn copyRobotLibraries
|
|
|
|
jar {
|
|
manifest { attributes 'Robot-Class': 'MyRobot' }
|
|
}
|