mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
103 lines
3.1 KiB
Groovy
103 lines
3.1 KiB
Groovy
import org.gradle.language.base.internal.ProjectLayout
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
apply plugin: 'cpp'
|
|
apply plugin: 'java'
|
|
apply plugin: 'visual-studio'
|
|
apply plugin: 'edu.wpi.first.NativeUtils'
|
|
|
|
apply from: '../config.gradle'
|
|
|
|
dependencies {
|
|
compile project(':wpilibj')
|
|
compile 'edu.wpi.first.wpiutil:wpiutil-java:+'
|
|
compile 'edu.wpi.first.ntcore:ntcore-java:+'
|
|
}
|
|
|
|
model {
|
|
dependencyConfigs {
|
|
wpiutil(DependencyConfig) {
|
|
groupId = 'edu.wpi.first.wpiutil'
|
|
artifactId = 'wpiutil-cpp'
|
|
headerClassifier = 'headers'
|
|
ext = 'zip'
|
|
version = '+'
|
|
sharedConfigs = [ FRCUserProgram: [] ]
|
|
}
|
|
ntcore(DependencyConfig) {
|
|
groupId = 'edu.wpi.first.ntcore'
|
|
artifactId = 'ntcore-cpp'
|
|
headerClassifier = 'headers'
|
|
ext = 'zip'
|
|
version = '+'
|
|
sharedConfigs = [ FRCUserProgram: [] ]
|
|
}
|
|
cscore(DependencyConfig) {
|
|
groupId = 'edu.wpi.first.cscore'
|
|
artifactId = 'cscore-cpp'
|
|
headerClassifier = 'headers'
|
|
ext = 'zip'
|
|
version = '+'
|
|
sharedConfigs = [ FRCUserProgram: [] ]
|
|
}
|
|
opencv(DependencyConfig) {
|
|
groupId = 'org.opencv'
|
|
artifactId = 'opencv-cpp'
|
|
headerClassifier = 'headers'
|
|
ext = 'zip'
|
|
version = '3.2.0'
|
|
sharedConfigs = [ FRCUserProgram: [] ]
|
|
}
|
|
}
|
|
components {
|
|
FRCUserProgram(NativeExecutableSpec) {
|
|
sources {
|
|
cpp {
|
|
source {
|
|
srcDirs = ['src/main/native/cpp']
|
|
}
|
|
exportedHeaders {
|
|
srcDirs = ['src/main/native/headers']
|
|
}
|
|
}
|
|
}
|
|
binaries.all { binary->
|
|
project(':ni-libraries').addNiLibrariesToLinker(binary)
|
|
project(':hal').addHalCompilerArguments(binary)
|
|
project(':hal').addHalToLinker(binary)
|
|
project(':wpilibc').addWpilibCCompilerArguments(binary)
|
|
project(':wpilibc').addWpilibCToLinker(binary)
|
|
}
|
|
}
|
|
}
|
|
tasks {
|
|
runCpp(Exec) {
|
|
def found = false
|
|
$.components.each {
|
|
if (it in NativeExecutableSpec && it.name == 'FRCUserProgram') {
|
|
it.binaries.each {
|
|
if (!found) {
|
|
def arch = it.targetPlatform.architecture.name
|
|
if (arch == 'x86-64' || arch == 'x86') {
|
|
dependsOn it.tasks.install
|
|
commandLine it.tasks.install.runScript
|
|
found = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
installAthena(Task) {
|
|
$.binaries.each {
|
|
if (it in NativeExecutableBinarySpec && it.targetPlatform.architecture.name == 'athena') {
|
|
dependsOn it.tasks.install
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|