mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
committed by
GitHub
parent
1b0c5af86e
commit
951c038f19
@@ -1,23 +1,12 @@
|
||||
import edu.wpi.first.toolchain.NativePlatforms
|
||||
|
||||
plugins {
|
||||
id 'edu.wpi.first.NativeUtils' version '2021.1.1'
|
||||
}
|
||||
apply plugin: "java"
|
||||
apply plugin: "cpp"
|
||||
apply plugin: "edu.wpi.first.NativeUtils"
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'cpp'
|
||||
apply plugin: 'edu.wpi.first.NativeUtils'
|
||||
apply from: "${rootDir}/shared/config.gradle"
|
||||
|
||||
// This adds all of the WPILib dependencies.
|
||||
nativeUtils.addWpiNativeUtils()
|
||||
nativeUtils {
|
||||
wpi {
|
||||
configureDependencies {
|
||||
wpiVersion = "2021.1.2"
|
||||
opencvVersion = "3.4.7-5"
|
||||
wpimathVersion = "2021.1.2"
|
||||
}
|
||||
}
|
||||
dependencyConfigs {
|
||||
gui {
|
||||
groupId = "edu.wpi.first.halsim"
|
||||
@@ -25,7 +14,7 @@ nativeUtils {
|
||||
headerClassifier = "headers"
|
||||
sourceClassifier = "sources"
|
||||
ext = "zip"
|
||||
version = "2021.1.2"
|
||||
version = wpilibVersion
|
||||
sharedPlatforms << "osxx86-64" << "linuxx86-64" << "windowsx86-64"
|
||||
}
|
||||
}
|
||||
@@ -38,56 +27,50 @@ nativeUtils {
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = 'https://frcmaven.wpi.edu:443/artifactory/release'
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
exampleFile = new File("$projectDir/src/main/java/org/photonlib/examples/examples.json")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':photon-lib')
|
||||
implementation project(':photon-targeting')
|
||||
implementation project(":photon-lib")
|
||||
implementation project(":photon-targeting")
|
||||
|
||||
implementation 'edu.wpi.first.cscore:cscore-java:2021.+'
|
||||
implementation 'edu.wpi.first.cameraserver:cameraserver-java:2021.+'
|
||||
implementation 'edu.wpi.first.ntcore:ntcore-java:2021.+'
|
||||
implementation 'edu.wpi.first.wpilibj:wpilibj-java:2021.+'
|
||||
implementation 'edu.wpi.first.wpiutil:wpiutil-java:2021.+'
|
||||
implementation 'edu.wpi.first.wpimath:wpimath-java:2021.+'
|
||||
implementation 'edu.wpi.first.hal:hal-java:2021.+'
|
||||
implementation "edu.wpi.first.cscore:cscore-java:$wpilibVersion"
|
||||
implementation "edu.wpi.first.cameraserver:cameraserver-java:$wpilibVersion"
|
||||
implementation "edu.wpi.first.ntcore:ntcore-java:$wpilibVersion"
|
||||
implementation "edu.wpi.first.wpilibj:wpilibj-java:$wpilibVersion"
|
||||
implementation "edu.wpi.first.wpiutil:wpiutil-java:$wpilibVersion"
|
||||
implementation "edu.wpi.first.wpimath:wpimath-java:$wpilibVersion"
|
||||
implementation "edu.wpi.first.hal:hal-java:$wpilibVersion"
|
||||
implementation "org.ejml:ejml-simple:0.38"
|
||||
implementation "com.fasterxml.jackson.core:jackson-annotations:2.10.0"
|
||||
implementation "com.fasterxml.jackson.core:jackson-core:2.10.0"
|
||||
implementation "com.fasterxml.jackson.core:jackson-databind:2.10.0"
|
||||
implementation 'edu.wpi.first.thirdparty.frc2020.opencv:opencv-java:3.4.7-3'
|
||||
implementation "edu.wpi.first.thirdparty.frc2020.opencv:opencv-java:3.4.7-3"
|
||||
}
|
||||
|
||||
model {
|
||||
components {
|
||||
all {
|
||||
nativeUtils.useAllPlatforms(it)
|
||||
}
|
||||
dev(NativeExecutableSpec) {
|
||||
targetBuildTypes 'debug'
|
||||
targetBuildTypes "debug"
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'src/dev/native/cpp'
|
||||
include '**/*.cpp'
|
||||
srcDirs "src/dev/native/cpp"
|
||||
include "**/*.cpp"
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/dev/native/include'
|
||||
srcDirs "src/dev/native/include"
|
||||
}
|
||||
}
|
||||
}
|
||||
binaries.all { binary ->
|
||||
nativeUtils.useRequiredLibrary(binary, 'wpilib_executable_shared')
|
||||
nativeUtils.useRequiredLibrary(binary, 'opencv_shared')
|
||||
nativeUtils.useRequiredLibrary(binary, 'halsim_gui')
|
||||
nativeUtils.useRequiredLibrary(binary, "wpilib_executable_shared")
|
||||
nativeUtils.useRequiredLibrary(binary, "opencv_shared")
|
||||
|
||||
if (binary.targetPlatform.name == NativePlatforms.desktop) {
|
||||
nativeUtils.useRequiredLibrary(binary, "halsim_gui")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,13 +85,13 @@ model {
|
||||
def arch = it.targetPlatform.name
|
||||
if (arch == NativePlatforms.desktop) {
|
||||
found = true
|
||||
def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib'
|
||||
def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + "lib"
|
||||
|
||||
def doFirstTask = { task ->
|
||||
def extensions = ''
|
||||
def extensions = ""
|
||||
it.tasks.install.installDirectory.get().getAsFile().eachFileRecurse {
|
||||
def name = it.name
|
||||
if (!(name.endsWith('.dll') || name.endsWith('.so') || name.endsWith('.dylib'))) {
|
||||
if (!(name.endsWith(".dll") || name.endsWith(".so") || name.endsWith(".dylib"))) {
|
||||
return
|
||||
}
|
||||
def file = it
|
||||
@@ -116,8 +99,8 @@ model {
|
||||
extensions += file.absolutePath + File.pathSeparator
|
||||
}
|
||||
}
|
||||
if (extensions != '') {
|
||||
task.environment 'HALSIM_EXTENSIONS', extensions
|
||||
if (extensions != "") {
|
||||
task.environment "HALSIM_EXTENSIONS", extensions
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,13 +109,13 @@ model {
|
||||
main = "org.photonlib.examples." + entry.foldername + ".Main"
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
run.dependsOn it.tasks.install
|
||||
run.systemProperty 'java.library.path', filePath
|
||||
run.environment 'LD_LIBRARY_PATH', filePath
|
||||
run.systemProperty "java.library.path", filePath
|
||||
run.environment "LD_LIBRARY_PATH", filePath
|
||||
run.workingDir filePath
|
||||
doFirst { doFirstTask(run) }
|
||||
|
||||
if (org.gradle.internal.os.OperatingSystem.current().isMacOsX()) {
|
||||
run.jvmArgs = ['-XstartOnFirstThread']
|
||||
run.jvmArgs = ["-XstartOnFirstThread"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user