Files
allwpilib/myRobot/build.gradle
Thad House a06dd25d56 Adds cscore and opencv to wpilib (#332)
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.
2016-11-06 21:47:18 -08:00

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' }
}