Files
allwpilib/myRobot/build.gradle
Fred Silberberg d48aac5beb Gradle Update (#372)
This does a major cleanup on our gradle files, primarily converting all instances of manual dependency downloading to use the correct configuration-based method, which has the advantage of being both less code and more safe.
2016-11-24 23:44:35 -08:00

93 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 ntcoreDep('java', 'arm')
compile cscoreDep('java', 'arm')
compile 'org.opencv:opencv-java:+'
}
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' }
}
jar.dependsOn ':wpilibj:build'