mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
[build] Gradle Cleanup (#1021)
Cleanup project-wide gradle configuration.
removes native dependencies from java only projects
increases readability
Pass generated headers in setup instead of modifying model
This commit is contained in:
12
build.gradle
12
build.gradle
@@ -21,6 +21,7 @@ apply from: "versioningHelper.gradle"
|
||||
|
||||
ext {
|
||||
wpilibVersion = "2024.1.1-beta-3"
|
||||
wpimathVersion = wpilibVersion
|
||||
openCVversion = "4.8.0-2"
|
||||
joglVersion = "2.4.0-rc-20200307"
|
||||
javalinVersion = "5.6.2"
|
||||
@@ -36,16 +37,11 @@ ext {
|
||||
if (nativeName == "macx64") nativeName = "osxx86-64";
|
||||
if (nativeName == "macarm64") nativeName = "osxarm64";
|
||||
jniPlatform = nativeName
|
||||
println("Building for platform " + jniPlatform)
|
||||
println("Building for platform: " + jniPlatform)
|
||||
println("Using Wpilib: " + wpilibVersion)
|
||||
println("Using OpenCV: " + openCVversion)
|
||||
}
|
||||
|
||||
wpilibTools.deps.wpilibVersion = wpilibVersion
|
||||
|
||||
// Tell gradlerio what version of things to use (that we care about)
|
||||
// See: https://github.com/wpilibsuite/GradleRIO/blob/main/src/main/java/edu/wpi/first/gradlerio/wpi/WPIVersionsExtension.java
|
||||
wpi.getVersions().getOpencvVersion().convention(openCVversion);
|
||||
wpi.getVersions().getWpilibVersion().convention(wpilibVersion);
|
||||
|
||||
spotless {
|
||||
java {
|
||||
target fileTree('.') {
|
||||
|
||||
@@ -1,38 +1,24 @@
|
||||
plugins {
|
||||
id 'edu.wpi.first.WpilibTools' version '1.3.0'
|
||||
}
|
||||
|
||||
import java.nio.file.Path
|
||||
|
||||
apply from: "${rootDir}/shared/common.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation project(':photon-targeting')
|
||||
|
||||
implementation "io.javalin:javalin:$javalinVersion"
|
||||
|
||||
implementation 'org.msgpack:msgpack-core:0.9.0'
|
||||
implementation 'org.msgpack:jackson-dataformat-msgpack:0.9.0'
|
||||
|
||||
// JOGL stuff (currently we only distribute for aarch64, which is Pi 4)
|
||||
implementation "org.jogamp.gluegen:gluegen-rt:$joglVersion"
|
||||
implementation "org.jogamp.jogl:jogl-all:$joglVersion"
|
||||
|
||||
implementation "org.jogamp.gluegen:gluegen-rt:$joglVersion:natives-linux-aarch64"
|
||||
implementation "org.jogamp.jogl:jogl-all:$joglVersion:natives-linux-aarch64"
|
||||
|
||||
// Zip
|
||||
implementation 'org.zeroturnaround:zt-zip:1.14'
|
||||
|
||||
implementation wpilibTools.deps.wpilibJava("apriltag")
|
||||
|
||||
implementation "org.xerial:sqlite-jdbc:3.41.0.0"
|
||||
}
|
||||
|
||||
task writeCurrentVersionJava {
|
||||
task writeCurrentVersion {
|
||||
def versionFileIn = file("${rootDir}/shared/PhotonVersion.java.in")
|
||||
writePhotonVersionFile(versionFileIn, Path.of("$projectDir", "src", "main", "java", "org", "photonvision", "PhotonVersion.java"),
|
||||
versionString)
|
||||
}
|
||||
|
||||
build.dependsOn writeCurrentVersionJava
|
||||
build.dependsOn writeCurrentVersion
|
||||
|
||||
@@ -9,54 +9,14 @@ import java.nio.file.Path
|
||||
ext {
|
||||
nativeName = "photonlib"
|
||||
includePhotonTargeting = true
|
||||
// Include the generated Version file
|
||||
generatedHeaders = "src/generate/native/include"
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/shared/setupBuild.gradle"
|
||||
apply from: "${rootDir}/shared/javacpp/setupBuild.gradle"
|
||||
apply from: "${rootDir}/versioningHelper.gradle"
|
||||
|
||||
|
||||
wpilibTools.deps.wpilibVersion = wpi.versions.wpilibVersion.get()
|
||||
|
||||
def nativeConfigName = 'wpilibNatives'
|
||||
def nativeConfig = configurations.create(nativeConfigName)
|
||||
|
||||
def nativeTasks = wpilibTools.createExtractionTasks {
|
||||
configurationName = nativeConfigName
|
||||
}
|
||||
|
||||
nativeTasks.addToSourceSetResources(sourceSets.main)
|
||||
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("apriltag")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("hal")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
|
||||
|
||||
dependencies {
|
||||
implementation project(":photon-targeting")
|
||||
|
||||
implementation wpilibTools.deps.wpilibJava("wpiutil")
|
||||
implementation wpilibTools.deps.wpilibJava("cameraserver")
|
||||
implementation wpilibTools.deps.wpilibJava("cscore")
|
||||
implementation wpilibTools.deps.wpilibJava("wpinet")
|
||||
implementation wpilibTools.deps.wpilibJava("wpimath")
|
||||
implementation wpilibTools.deps.wpilibJava("ntcore")
|
||||
implementation wpilibTools.deps.wpilibJava("hal")
|
||||
implementation wpilibTools.deps.wpilibJava("wpilibj")
|
||||
implementation wpilibTools.deps.wpilibJava("apriltag")
|
||||
implementation wpilibTools.deps.wpilibOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
|
||||
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: wpi.versions.jacksonVersion.get()
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-core", version: wpi.versions.jacksonVersion.get()
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-databind", version: wpi.versions.jacksonVersion.get()
|
||||
|
||||
implementation group: "org.ejml", name: "ejml-simple", version: wpi.versions.ejmlVersion.get()
|
||||
implementation group: "us.hebi.quickbuf", name: "quickbuf-runtime", version: wpi.versions.quickbufVersion.get();
|
||||
}
|
||||
|
||||
// Include the version file in the distributed sources
|
||||
cppHeadersZip {
|
||||
from('src/generate/native/include') {
|
||||
into '/'
|
||||
@@ -66,8 +26,6 @@ cppHeadersZip {
|
||||
def photonlibFileInput = file("src/generate/photonlib.json.in")
|
||||
ext.photonlibFileOutput = file("$buildDir/generated/vendordeps/photonlib.json")
|
||||
|
||||
def vendorJson = artifacts.add('archives', file("$photonlibFileOutput"))
|
||||
|
||||
task generateVendorJson() {
|
||||
description = "Generates the vendor JSON file"
|
||||
group = "PhotonVision"
|
||||
@@ -103,18 +61,9 @@ task writeCurrentVersion {
|
||||
|
||||
build.mustRunAfter writeCurrentVersion
|
||||
|
||||
model {
|
||||
components {
|
||||
all {
|
||||
it.sources.each {
|
||||
it.exportedHeaders {
|
||||
srcDirs "src/main/native/include"
|
||||
srcDirs "src/generate/native/include"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
def vendorJson = artifacts.add('archives', file("$photonlibFileOutput"))
|
||||
|
||||
model {
|
||||
// Publish the vendordep json
|
||||
publishing {
|
||||
publications {
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) PhotonVision
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "com_vendor_jni_VendorJNI.h"
|
||||
#include "jni.h"
|
||||
|
||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) {
|
||||
// Check to ensure the JNI version is valid
|
||||
|
||||
JNIEnv* env;
|
||||
if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK)
|
||||
return JNI_ERR;
|
||||
|
||||
// In here is also where you store things like class references
|
||||
// if they are ever needed
|
||||
|
||||
return JNI_VERSION_1_6;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved) {}
|
||||
|
||||
/*
|
||||
* Class: com_vendor_jni_VendorJNI
|
||||
* Method: initialize
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_vendor_jni_VendorJNI_initialize
|
||||
(JNIEnv*, jclass)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) PhotonVision
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "driverheader.h"
|
||||
|
||||
extern "C" {
|
||||
void c_doThing(void) {}
|
||||
} // extern "C"
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) PhotonVision
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
extern "C" {
|
||||
void c_doThing(void);
|
||||
} // extern "C"
|
||||
@@ -1,4 +0,0 @@
|
||||
JNI_OnLoad
|
||||
JNI_OnUnload
|
||||
Java_com_vendor_jni_VendorJNI_initialize
|
||||
c_doThing
|
||||
@@ -6,32 +6,20 @@ plugins {
|
||||
id 'edu.wpi.first.WpilibTools' version '1.3.0'
|
||||
}
|
||||
|
||||
evaluationDependsOn(':photon-core')
|
||||
|
||||
mainClassName = 'org.photonvision.Main'
|
||||
|
||||
group 'org.photonvision'
|
||||
version versionString + (project.hasProperty('pionly') ? "-raspi" : "")
|
||||
|
||||
apply from: "${rootDir}/shared/common.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation project(':photon-core')
|
||||
implementation project(':photon-targeting')
|
||||
|
||||
implementation "io.javalin:javalin:$javalinVersion"
|
||||
// Needed for Javalin Runtime Logging
|
||||
implementation "org.slf4j:slf4j-simple:2.0.7"
|
||||
}
|
||||
|
||||
implementation wpilibTools.deps.wpilibJava("wpiutil")
|
||||
implementation wpilibTools.deps.wpilibJava("wpimath")
|
||||
implementation wpilibTools.deps.wpilibJava("wpinet")
|
||||
implementation wpilibTools.deps.wpilibJava("hal")
|
||||
implementation wpilibTools.deps.wpilibJava("ntcore")
|
||||
implementation wpilibTools.deps.wpilibJava("wpilibj")
|
||||
implementation wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
|
||||
group 'org.photonvision'
|
||||
version versionString + (project.hasProperty('pionly') ? "-raspi" : "")
|
||||
|
||||
implementation "org.msgpack:msgpack-core:0.9.0"
|
||||
implementation "org.msgpack:jackson-dataformat-msgpack:0.9.0"
|
||||
application {
|
||||
mainClass = 'org.photonvision.Main'
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
@@ -43,7 +31,6 @@ shadowJar {
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
node {
|
||||
nodeProjectDir = file("${projectDir}/../photon-client")
|
||||
}
|
||||
@@ -58,6 +45,10 @@ tasks.register("buildAndCopyUI") {
|
||||
finalizedBy "copyClientUIToResources"
|
||||
}
|
||||
|
||||
run {
|
||||
environment "PATH_PREFIX", "../"
|
||||
}
|
||||
|
||||
run {
|
||||
if (project.hasProperty("profile")) {
|
||||
jvmArgs=[
|
||||
@@ -70,7 +61,6 @@ run {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
remotes {
|
||||
pi {
|
||||
host = 'photonvision.local'
|
||||
@@ -119,10 +109,6 @@ task findDeployTarget {
|
||||
}
|
||||
}
|
||||
|
||||
run {
|
||||
environment "PATH_PREFIX", "../"
|
||||
}
|
||||
|
||||
task deploy {
|
||||
dependsOn findDeployTarget
|
||||
dependsOn assemble
|
||||
|
||||
@@ -6,45 +6,4 @@ ext {
|
||||
nativeName = "photontargeting"
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/shared/setupBuild.gradle"
|
||||
|
||||
|
||||
wpilibTools.deps.wpilibVersion = wpi.versions.wpilibVersion.get()
|
||||
|
||||
def nativeConfigName = 'wpilibNatives'
|
||||
def nativeConfig = configurations.create(nativeConfigName)
|
||||
|
||||
def nativeTasks = wpilibTools.createExtractionTasks {
|
||||
configurationName = nativeConfigName
|
||||
}
|
||||
|
||||
nativeTasks.addToSourceSetResources(sourceSets.main)
|
||||
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("apriltag")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("hal")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
|
||||
|
||||
dependencies {
|
||||
implementation wpilibTools.deps.wpilibJava("wpiutil")
|
||||
implementation wpilibTools.deps.wpilibJava("cameraserver")
|
||||
implementation wpilibTools.deps.wpilibJava("cscore")
|
||||
implementation wpilibTools.deps.wpilibJava("wpinet")
|
||||
implementation wpilibTools.deps.wpilibJava("wpimath")
|
||||
implementation wpilibTools.deps.wpilibJava("ntcore")
|
||||
implementation wpilibTools.deps.wpilibJava("hal")
|
||||
implementation wpilibTools.deps.wpilibJava("wpilibj")
|
||||
implementation wpilibTools.deps.wpilibJava("apriltag")
|
||||
implementation wpilibTools.deps.wpilibOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
|
||||
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: wpi.versions.jacksonVersion.get()
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-core", version: wpi.versions.jacksonVersion.get()
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-databind", version: wpi.versions.jacksonVersion.get()
|
||||
|
||||
implementation group: "org.ejml", name: "ejml-simple", version: wpi.versions.ejmlVersion.get()
|
||||
implementation group: "us.hebi.quickbuf", name: "quickbuf-runtime", version: wpi.versions.quickbufVersion.get();
|
||||
}
|
||||
apply from: "${rootDir}/shared/javacpp/setupBuild.gradle"
|
||||
|
||||
@@ -7,28 +7,22 @@ java {
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
wpilibTools.deps.wpilibVersion = wpi.versions.wpilibVersion.get()
|
||||
wpilibTools.deps.wpilibVersion = wpilibVersion
|
||||
|
||||
def nativeConfigName = 'wpilibTestNative'
|
||||
def nativeConfig = configurations.create(nativeConfigName)
|
||||
|
||||
def nativeTasks = wpilibTools.createExtractionTasks {
|
||||
configurationName = nativeConfigName
|
||||
}
|
||||
|
||||
nativeTasks.addToSourceSetResources(sourceSets.main)
|
||||
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("apriltag")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("hal")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
|
||||
// Tell gradlerio what version of things to use (that we care about)
|
||||
// See: https://github.com/wpilibsuite/GradleRIO/blob/main/src/main/java/edu/wpi/first/gradlerio/wpi/WPIVersionsExtension.java
|
||||
wpi.getVersions().getOpencvVersion().convention(openCVversion);
|
||||
wpi.getVersions().getWpilibVersion().convention(wpilibVersion);
|
||||
wpi.getVersions().getWpimathVersion().convention(wpimathVersion);
|
||||
|
||||
dependencies {
|
||||
// WPILib deps
|
||||
implementation project(':photon-targeting')
|
||||
|
||||
implementation "io.javalin:javalin:$javalinVersion"
|
||||
|
||||
implementation 'org.msgpack:msgpack-core:0.9.0'
|
||||
implementation 'org.msgpack:jackson-dataformat-msgpack:0.9.0'
|
||||
|
||||
implementation wpilibTools.deps.wpilibJava("wpiutil")
|
||||
implementation wpilibTools.deps.wpilibJava("cameraserver")
|
||||
implementation wpilibTools.deps.wpilibJava("cscore")
|
||||
@@ -40,25 +34,22 @@ dependencies {
|
||||
implementation wpilibTools.deps.wpilibJava("apriltag")
|
||||
implementation wpilibTools.deps.wpilibOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
|
||||
|
||||
// Jackson
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: wpi.versions.jacksonVersion.get()
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-core", version: wpi.versions.jacksonVersion.get()
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-databind", version: wpi.versions.jacksonVersion.get()
|
||||
|
||||
// Apache commons
|
||||
implementation group: "org.apache.commons", name: "commons-lang3", version: "3.12.0"
|
||||
implementation group: "commons-io", name: "commons-io", version: "2.11.0"
|
||||
implementation group: "commons-cli", name: "commons-cli", version: "1.5.0"
|
||||
implementation "org.apache.commons:commons-collections4:4.4"
|
||||
implementation "org.apache.commons:commons-exec:1.3"
|
||||
|
||||
implementation group: "org.ejml", name: "ejml-simple", version: wpi.versions.ejmlVersion.get()
|
||||
implementation group: "us.hebi.quickbuf", name: "quickbuf-runtime", version: wpi.versions.quickbufVersion.get();
|
||||
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
|
||||
implementation "commons-io:commons-io:2.11.0"
|
||||
implementation "commons-cli:commons-cli:1.5.0"
|
||||
implementation "org.apache.commons:commons-lang3:3.12.0"
|
||||
implementation "org.apache.commons:commons-collections4:4.4"
|
||||
implementation "org.apache.commons:commons-exec:1.3"
|
||||
|
||||
// wpilib serde
|
||||
implementation 'us.hebi.quickbuf:quickbuf-runtime:1.3.2'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
@@ -9,11 +9,12 @@ nativeUtils.withCrossLinuxArm64()
|
||||
// Configure WPI dependencies.
|
||||
nativeUtils.wpi.configureDependencies {
|
||||
wpiVersion = wpilibVersion
|
||||
wpimathVersion = wpimathVersion
|
||||
opencvYear = 'frc2024'
|
||||
opencvVersion = openCVversion
|
||||
googleTestYear = "frc2023"
|
||||
googleTestYear = "frc2024"
|
||||
googleTestVersion = "1.14.0-1"
|
||||
niLibVersion = "2024.1.1"
|
||||
googleTestVersion = "1.12.1-2"
|
||||
}
|
||||
|
||||
// Configure warnings and errors
|
||||
|
||||
@@ -97,7 +97,31 @@ test {
|
||||
finalizedBy jacocoTestReport
|
||||
}
|
||||
|
||||
wpilibTools.deps.wpilibVersion = wpi.versions.wpilibVersion.get()
|
||||
|
||||
dependencies {
|
||||
if(project.hasProperty('includePhotonTargeting')) {
|
||||
implementation project(":photon-targeting")
|
||||
}
|
||||
|
||||
implementation wpilibTools.deps.wpilibJava("wpiutil")
|
||||
implementation wpilibTools.deps.wpilibJava("cameraserver")
|
||||
implementation wpilibTools.deps.wpilibJava("cscore")
|
||||
implementation wpilibTools.deps.wpilibJava("wpinet")
|
||||
implementation wpilibTools.deps.wpilibJava("wpimath")
|
||||
implementation wpilibTools.deps.wpilibJava("ntcore")
|
||||
implementation wpilibTools.deps.wpilibJava("hal")
|
||||
implementation wpilibTools.deps.wpilibJava("wpilibj")
|
||||
implementation wpilibTools.deps.wpilibJava("apriltag")
|
||||
implementation wpilibTools.deps.wpilibOpenCvJava("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
|
||||
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: wpi.versions.jacksonVersion.get()
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-core", version: wpi.versions.jacksonVersion.get()
|
||||
implementation group: "com.fasterxml.jackson.core", name: "jackson-databind", version: wpi.versions.jacksonVersion.get()
|
||||
|
||||
implementation group: "org.ejml", name: "ejml-simple", version: wpi.versions.ejmlVersion.get()
|
||||
implementation group: "us.hebi.quickbuf", name: "quickbuf-runtime", version: wpi.versions.quickbufVersion.get();
|
||||
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
|
||||
|
||||
@@ -5,6 +5,26 @@ apply plugin: 'edu.wpi.first.NativeUtils'
|
||||
apply from: "${rootDir}/shared/config.gradle"
|
||||
apply from: "${rootDir}/shared/javacommon.gradle"
|
||||
|
||||
wpilibTools.deps.wpilibVersion = wpi.versions.wpilibVersion.get()
|
||||
|
||||
def nativeConfigName = 'wpilibNatives'
|
||||
def nativeConfig = configurations.create(nativeConfigName)
|
||||
|
||||
def nativeTasks = wpilibTools.createExtractionTasks {
|
||||
configurationName = nativeConfigName
|
||||
}
|
||||
|
||||
nativeTasks.addToSourceSetResources(sourceSets.main)
|
||||
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("ntcore")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("cscore")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("apriltag")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilib("hal")
|
||||
nativeConfig.dependencies.add wpilibTools.deps.wpilibOpenCv("frc" + wpi.frcYear.get(), wpi.versions.opencvVersion.get())
|
||||
|
||||
// Windows specific functionality to export all symbols from a binary automatically
|
||||
nativeUtils {
|
||||
exportsConfigs {
|
||||
@@ -23,6 +43,9 @@ model {
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/native/include'
|
||||
if (project.hasProperty('generatedHeaders')) {
|
||||
srcDir generatedHeaders
|
||||
}
|
||||
include "**/*.h"
|
||||
}
|
||||
}
|
||||
@@ -73,4 +96,4 @@ model {
|
||||
}
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/shared/publish.gradle"
|
||||
apply from: "${rootDir}/shared/javacpp/publish.gradle"
|
||||
Reference in New Issue
Block a user