mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
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.
93 lines
1.9 KiB
Groovy
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'
|