diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25f8c0f3cc..78aeee5ff3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,23 +68,14 @@ jobs: - name: Install RoboRIO Toolchain run: ./gradlew installRoboRioToolchain # Need to publish to maven local first, so that C++ sim can pick it up - # Still haven't figured out how to make the vendordep file be copied before trying to build examples - name: Publish photonlib to maven local - run: | - chmod +x gradlew - ./gradlew photon-targeting:publishtomavenlocal photon-lib:publishtomavenlocal -x check + run: ./gradlew photon-targeting:publishtomavenlocal photon-lib:publishtomavenlocal -x check - name: Build Java examples working-directory: photonlib-java-examples - run: | - chmod +x gradlew - ./gradlew copyPhotonlib -x check - ./gradlew build + run: ./gradlew build - name: Build C++ examples working-directory: photonlib-cpp-examples - run: | - chmod +x gradlew - ./gradlew copyPhotonlib -x check - ./gradlew build + run: ./gradlew build build-gradle: name: "Gradle Build" runs-on: ubuntu-22.04 @@ -104,9 +95,7 @@ jobs: - name: Install mrcal deps run: sudo apt-get update && sudo apt-get install -y libcholmod3 liblapack3 libsuitesparseconfig5 - name: Gradle Build - run: | - chmod +x gradlew - ./gradlew photon-targeting:build photon-core:build photon-server:build -x check + run: ./gradlew photon-targeting:build photon-core:build photon-server:build -x check - name: Gradle Tests run: ./gradlew testHeadless -i --stacktrace - name: Gradle Coverage @@ -165,7 +154,6 @@ jobs: # Generate the JSON and give it the ""standard""" name maven gives it - run: | - chmod +x gradlew ./gradlew photon-lib:generateVendorJson export VERSION=$(git describe --tags --match=v*) mv photon-lib/build/generated/vendordeps/photonlib.json photon-lib/build/generated/vendordeps/photonlib-$(git describe --tags --match=v*).json @@ -205,9 +193,7 @@ jobs: distribution: temurin architecture: ${{ matrix.architecture }} - run: git fetch --tags --force - - run: | - chmod +x gradlew - ./gradlew photon-targeting:build photon-lib:build -i + - run: ./gradlew photon-targeting:build photon-lib:build -i name: Build with Gradle - run: ./gradlew photon-lib:publish photon-targeting:publish name: Publish @@ -248,13 +234,9 @@ jobs: git config --global --add safe.directory /__w/photonvision/photonvision - name: Build PhotonLib # We don't need to run tests, since we specify only non-native platforms - run: | - chmod +x gradlew - ./gradlew photon-targeting:build photon-lib:build ${{ matrix.build-options }} -i -x test + run: ./gradlew photon-targeting:build photon-lib:build ${{ matrix.build-options }} -i -x test - name: Publish - run: | - chmod +x gradlew - ./gradlew photon-lib:publish photon-targeting:publish ${{ matrix.build-options }} + run: ./gradlew photon-lib:publish photon-targeting:publish ${{ matrix.build-options }} env: ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }} if: github.event_name == 'push' && github.repository_owner == 'photonvision' @@ -350,13 +332,9 @@ jobs: with: name: built-docs path: photon-server/src/main/resources/web/docs - - run: | - chmod +x gradlew - ./gradlew photon-targeting:jar photon-server:shadowJar -PArchOverride=${{ matrix.arch-override }} + - run: ./gradlew photon-targeting:jar photon-server:shadowJar -PArchOverride=${{ matrix.arch-override }} if: ${{ (matrix.arch-override != 'none') }} - - run: | - chmod +x gradlew - ./gradlew photon-server:shadowJar + - run: ./gradlew photon-server:shadowJar if: ${{ (matrix.arch-override == 'none') }} - uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 0105ba89c6..7e710c16f9 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -61,9 +61,7 @@ jobs: with: java-version: 17 distribution: temurin - - run: | - chmod +x gradlew - ./gradlew spotlessCheck + - run: ./gradlew spotlessCheck name: Run spotless client-lint-format: diff --git a/.gitignore b/.gitignore index 29438a5193..f0ea980078 100644 --- a/.gitignore +++ b/.gitignore @@ -131,27 +131,12 @@ New client/photon-client/* *.jfr .DS_Store # *.iml -photon-server/build -photon-server/photon-vision -photon-server/src/main/resources/web -photon-server/src/main/java/org/photonvision/PhotonVersion.java -photon-server/src/main/generated/native/include/org_photonvision_raspi_PicamJNI.h *.bin .gradle .gradle/* photonvision_config -build/spotlessJava -build/* -build -photon-lib/src/main/java/org/photonvision/PhotonVersion.java -photon-lib/bin/main/images/* -/photonlib-java-examples/bin/ -photon-lib/src/generate/native/include/PhotonVersion.h -.gitattributes -lib/* -photon-server/lib/libapriltag.so -photon-server/bin/main/nativelibraries/apriltag/* -photon-server/src/main/resources/nativelibraries/apriltag/* +bin*/ +build*/ photonlib-java-examples/*/vendordeps/* photonlib-cpp-examples/*/vendordeps/* @@ -162,9 +147,6 @@ photonlib-cpp-examples/*/networktables.json.bck photonlib-java-examples/*/networktables.json.bck *.sqlite photon-server/src/main/resources/web/index.html -photon-lib/src/generate/native/cpp/PhotonVersion.cpp - venv - .venv/* .venv diff --git a/build.gradle b/build.gradle index 7b598019bb..aa4d5c9354 100644 --- a/build.gradle +++ b/build.gradle @@ -67,7 +67,7 @@ spotless { java { target fileTree('.') { include '**/*.java' - exclude '**/build/**', '**/build-*/**', "photon-core\\src\\main\\java\\org\\photonvision\\PhotonVersion.java", "photon-lib\\src\\main\\java\\org\\photonvision\\PhotonVersion.java", "**/src/generated/**" + exclude '**/build/**', '**/build-*/**', '**/src/generated/**' } toggleOffOn() googleJavaFormat() diff --git a/docs/source/docs/contributing/building-photon.md b/docs/source/docs/contributing/building-photon.md index ec2c92cbe3..2ced21eb1f 100644 --- a/docs/source/docs/contributing/building-photon.md +++ b/docs/source/docs/contributing/building-photon.md @@ -139,25 +139,7 @@ The `deploy` command is tested against Raspberry Pi coprocessors. Other similar ### Using PhotonLib Builds -The build process includes the following task: - -```{eval-rst} -.. tab-set:: - - .. tab-item:: Linux - - ``./gradlew generateVendorJson`` - - .. tab-item:: macOS - - ``./gradlew generateVendorJson`` - - .. tab-item:: Windows (cmd) - - ``gradlew generateVendorJson`` -``` - -This generates a vendordep JSON of your local build at `photon-lib/build/generated/vendordeps/photonlib.json`. +The build process automatically generates a vendordep JSON of your local build at `photon-lib/build/generated/vendordeps/photonlib.json`. The photonlib source can be published to your local maven repository after building: @@ -247,17 +229,15 @@ You can run one of the many built in examples straight from the command line, to #### Running C++/Java -PhotonLib must first be published to your local maven repository, then the copy PhotonLib task will copy the generated vendordep json file into each example. After that, the simulateJava/simulateNative task can be used like a normal robot project. Robot simulation with attached debugger is technically possible by using simulateExternalJava and modifying the launch script it exports, though not yet supported. +PhotonLib must first be published to your local maven repository. This will also copy the generated vendordep json file into each example. After that, the simulateJava/simulateNative task can be used like a normal robot project. Robot simulation with attached debugger is technically possible by using simulateExternalJava and modifying the launch script it exports, though not yet supported. ``` ~/photonvision$ ./gradlew publishToMavenLocal ~/photonvision$ cd photonlib-java-examples -~/photonvision/photonlib-java-examples$ ./gradlew copyPhotonlib ~/photonvision/photonlib-java-examples$ ./gradlew :simulateJava ~/photonvision$ cd photonlib-cpp-examples -~/photonvision/photonlib-cpp-examples$ ./gradlew copyPhotonlib ~/photonvision/photonlib-cpp-examples$ ./gradlew :simulateNative ``` diff --git a/photon-core/.gitignore b/photon-core/.gitignore index 42904f2cb2..ad3d67bb81 100644 --- a/photon-core/.gitignore +++ b/photon-core/.gitignore @@ -11,5 +11,3 @@ photonvision/* photonvision_config/* photon-server/lib/* photon-server/package-lock.json - -src/main/java/org/photonvision/PhotonVersion.java diff --git a/photon-core/build.gradle b/photon-core/build.gradle index 2a63716349..f238541180 100644 --- a/photon-core/build.gradle +++ b/photon-core/build.gradle @@ -65,9 +65,13 @@ dependencies { } task writeCurrentVersion { - def versionFileIn = file("${rootDir}/shared/PhotonVersion.java.in") - writePhotonVersionFile(versionFileIn, Path.of("$projectDir", "src", "main", "java", "org", "photonvision", "PhotonVersion.java"), - versionString) + doLast { + def versionFileIn = file("${rootDir}/shared/PhotonVersion.java.in") + writePhotonVersionFile(versionFileIn, Path.of("$buildDir", "generated", "java", "org", "photonvision", "PhotonVersion.java"), + versionString) + } } +// https://github.com/wpilibsuite/allwpilib/blob/main/wpilibj/build.gradle#L52 +sourceSets.main.java.srcDir "${buildDir}/generated/java/" -build.dependsOn writeCurrentVersion +compileJava.dependsOn writeCurrentVersion diff --git a/photon-lib/build.gradle b/photon-lib/build.gradle index 5e79ba4cc3..1e2f76106c 100644 --- a/photon-lib/build.gradle +++ b/photon-lib/build.gradle @@ -33,7 +33,7 @@ model { sources { cpp { source { - srcDirs 'src/main/native/cpp', "$buildDir/generated/source/proto/main/cpp", "src/generate/native/cpp" + srcDirs 'src/main/native/cpp', "$buildDir/generated/source/proto/main/cpp", "$buildDir/generated/native/cpp" include '**/*.cpp', '**/*.cc' } exportedHeaders { @@ -161,14 +161,12 @@ task generateVendorJson() { def read = photonlibFileInput.text .replace('${photon_version}', pubVersion) .replace('${frc_year}', frcYear) - .replace('${wpilib_version}', wpilibVersion) photonlibFileOutput.text = read outputs.upToDateWhen { false } } -build.mustRunAfter generateVendorJson -publish.mustRunAfter generateVendorJson +build.dependsOn generateVendorJson task publishVendorJsonToLocalOutputs(type: Copy) { from photonlibFileOutput @@ -182,17 +180,69 @@ task publishVendorJsonToLocalOutputs(type: Copy) { publish.dependsOn it } +task copyVendorJsonToExamples { + outputs.upToDateWhen { false } + jar.finalizedBy it +} + +[ + "photonlib-cpp-examples", + "photonlib-java-examples" +].each { exampleFolder -> + file("${rootDir}/${exampleFolder}") + .listFiles() + .findAll { + return (it.isDirectory() + && !it.isHidden() + && !it.name.startsWith(".") + && it.toPath().resolve("build.gradle").toFile().exists()) + } + .collect { it.name } + .each { exampleVendordepFolder -> + task "copyVendorJsonTo${exampleFolder}-${exampleVendordepFolder}"(type: Copy) { + from photonlibFileOutput + + into "${rootDir}/${exampleFolder}/${exampleVendordepFolder}/vendordeps/" + outputs.upToDateWhen { false } + copyVendorJsonToExamples.dependsOn it + } + } +} + +clean { + [ + "photonlib-cpp-examples", + "photonlib-java-examples" + ].each { exampleFolder -> + file("${rootDir}/${exampleFolder}") + .listFiles() + .findAll { + return (it.isDirectory() + && !it.isHidden() + && !it.name.startsWith(".") + && it.toPath().resolve("build.gradle").toFile().exists()) + } + .collect { it.name } + .each { exampleVendordepFolder -> + delete "${rootDir}/${exampleFolder}/${exampleVendordepFolder}/vendordeps/" + } + } +} + task writeCurrentVersion { - def versionFileIn = file("${rootDir}/shared/PhotonVersion.java.in") - writePhotonVersionFile(versionFileIn, Path.of("$projectDir", "src", "main", "java", "org", "photonvision", "PhotonVersion.java"), - versionString) - versionFileIn = file("${rootDir}/shared/PhotonVersion.cpp.in") - writePhotonVersionFile(versionFileIn, Path.of("$projectDir", "src", "generate", "native", "cpp", "PhotonVersion.cpp"), - versionString) + doLast { + def versionFileIn = file("${rootDir}/shared/PhotonVersion.java.in") + writePhotonVersionFile(versionFileIn, Path.of("$buildDir", "generated", "java", "org", "photonvision", "PhotonVersion.java"), + versionString) + versionFileIn = file("${rootDir}/shared/PhotonVersion.cpp.in") + writePhotonVersionFile(versionFileIn, Path.of("$buildDir", "generated", "native", "cpp", "PhotonVersion.cpp"), + versionString) + } } -build.mustRunAfter writeCurrentVersion -cppHeadersZip.dependsOn writeCurrentVersion +// https://github.com/wpilibsuite/allwpilib/blob/main/wpilibj/build.gradle#L52 +sourceSets.main.java.srcDir "${buildDir}/generated/java/" +compileJava.dependsOn writeCurrentVersion // Building photon-lib requires photon-targeting to generate its proto files. This technically shouldn't be required but is needed for it to build. model { @@ -206,6 +256,7 @@ model { } it.binaries.all { it.tasks.withType(CppCompile) { + it.dependsOn writeCurrentVersion it.dependsOn ":photon-targeting:generateProto" } } @@ -243,7 +294,7 @@ if (!project.hasProperty('copyOfflineArtifacts')) { tasks.named('cppSourcesZip') { dependsOn writeCurrentVersion - from("$projectDir/src/generate/native/cpp") { + from("$buildDir/generated/native/cpp") { into '/' } } @@ -252,7 +303,6 @@ tasks.named('cppSourcesZip') { def zipBaseNameCombined = '_GROUP_org.photonvision_combinedcpp_ID_photonvision-combinedcpp_CLS' task combinedCppSourcesZip(type: Zip) { dependsOn(':photon-lib:cppSourcesZip', ':photon-targeting:cppSourcesZip') - mustRunAfter(':photon-lib:cppHeadersZip', ':photon-targeting:cppHeadersZip') destinationDirectory = file("$buildDir/outputs") archiveBaseName = zipBaseNameCombined @@ -270,7 +320,6 @@ task combinedCppSourcesZip(type: Zip) { } task combinedHeadersZip(type: Zip) { dependsOn(':photon-lib:cppHeadersZip', ':photon-targeting:cppHeadersZip') - mustRunAfter(':photon-lib:cppHeadersZip', ':photon-targeting:cppHeadersZip') destinationDirectory = file("$buildDir/outputs") archiveBaseName = zipBaseNameCombined @@ -316,7 +365,6 @@ def nativeTasks = wpilibTools.createExtractionTasks { nativeTasks.addToSourceSetResources(sourceSets.test) -nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpilibc") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpimath") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpinet") nativeConfig.dependencies.add wpilibTools.deps.wpilib("wpiutil") diff --git a/photon-targeting/.gitignore b/photon-targeting/.gitignore index bad380c878..4faca75e20 100644 --- a/photon-targeting/.gitignore +++ b/photon-targeting/.gitignore @@ -9,5 +9,3 @@ build build/* photonvision/* photonvision_config/* - -src/main/java/org/photonvision/PhotonVersion.java diff --git a/photonlib-cpp-examples/aimandrange/build.gradle b/photonlib-cpp-examples/aimandrange/build.gradle index 43bc834165..17ac6aa235 100644 --- a/photonlib-cpp-examples/aimandrange/build.gradle +++ b/photonlib-cpp-examples/aimandrange/build.gradle @@ -14,8 +14,6 @@ wpi.maven.useDevelopment = false wpi.versions.wpilibVersion = "2025.1.1-beta-1" wpi.versions.wpimathVersion = "2025.1.1-beta-1" -apply from: "${rootDir}/../shared/examples_common.gradle" - // Define my targets (RoboRIO) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { diff --git a/photonlib-cpp-examples/aimattarget/build.gradle b/photonlib-cpp-examples/aimattarget/build.gradle index 43bc834165..17ac6aa235 100644 --- a/photonlib-cpp-examples/aimattarget/build.gradle +++ b/photonlib-cpp-examples/aimattarget/build.gradle @@ -14,8 +14,6 @@ wpi.maven.useDevelopment = false wpi.versions.wpilibVersion = "2025.1.1-beta-1" wpi.versions.wpimathVersion = "2025.1.1-beta-1" -apply from: "${rootDir}/../shared/examples_common.gradle" - // Define my targets (RoboRIO) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { diff --git a/photonlib-cpp-examples/build.gradle b/photonlib-cpp-examples/build.gradle index 6404a00c56..4ff03b6728 100644 --- a/photonlib-cpp-examples/build.gradle +++ b/photonlib-cpp-examples/build.gradle @@ -22,9 +22,5 @@ spotless { } java { target "**/*.java" - targetExclude("photon-core/src/main/java/org/photonvision/PhotonVersion.java") - targetExclude("photon-lib/src/main/java/org/photonvision/PhotonVersion.java") } } - -apply from: "examples.gradle" diff --git a/photonlib-cpp-examples/poseest/build.gradle b/photonlib-cpp-examples/poseest/build.gradle index 43bc834165..17ac6aa235 100644 --- a/photonlib-cpp-examples/poseest/build.gradle +++ b/photonlib-cpp-examples/poseest/build.gradle @@ -14,8 +14,6 @@ wpi.maven.useDevelopment = false wpi.versions.wpilibVersion = "2025.1.1-beta-1" wpi.versions.wpimathVersion = "2025.1.1-beta-1" -apply from: "${rootDir}/../shared/examples_common.gradle" - // Define my targets (RoboRIO) and artifacts (deployable files) // This is added by GradleRIO's backing project DeployUtils. deploy { diff --git a/photonlib-java-examples/aimandrange/build.gradle b/photonlib-java-examples/aimandrange/build.gradle index 9587975151..a7e61ee352 100644 --- a/photonlib-java-examples/aimandrange/build.gradle +++ b/photonlib-java-examples/aimandrange/build.gradle @@ -6,8 +6,6 @@ plugins { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 -apply from: "${rootDir}/../shared/examples_common.gradle" - def ROBOT_MAIN_CLASS = "frc.robot.Main" repositories { diff --git a/photonlib-java-examples/aimattarget/build.gradle b/photonlib-java-examples/aimattarget/build.gradle index 18108a1efc..863bd3d496 100644 --- a/photonlib-java-examples/aimattarget/build.gradle +++ b/photonlib-java-examples/aimattarget/build.gradle @@ -6,8 +6,6 @@ plugins { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 -apply from: "${rootDir}/../shared/examples_common.gradle" - def ROBOT_MAIN_CLASS = "frc.robot.Main" wpi.maven.useDevelopment = true diff --git a/photonlib-java-examples/build.gradle b/photonlib-java-examples/build.gradle index 270e2ab600..4ff03b6728 100644 --- a/photonlib-java-examples/build.gradle +++ b/photonlib-java-examples/build.gradle @@ -2,8 +2,6 @@ plugins { id "com.diffplug.spotless" version "6.1.2" } -apply from: "examples.gradle" - allprojects { repositories { mavenCentral() @@ -24,7 +22,5 @@ spotless { } java { target "**/*.java" - targetExclude("photon-core/src/main/java/org/photonvision/PhotonVersion.java") - targetExclude("photon-lib/src/main/java/org/photonvision/PhotonVersion.java") } } diff --git a/photonlib-java-examples/poseest/build.gradle b/photonlib-java-examples/poseest/build.gradle index 4d1761e7a2..a2d2ce9812 100644 --- a/photonlib-java-examples/poseest/build.gradle +++ b/photonlib-java-examples/poseest/build.gradle @@ -6,8 +6,6 @@ plugins { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 -apply from: "${rootDir}/../shared/examples_common.gradle" - def ROBOT_MAIN_CLASS = "frc.robot.Main" wpi.maven.useDevelopment = true diff --git a/shared/examples_common.gradle b/shared/examples_common.gradle deleted file mode 100644 index 5212307f0f..0000000000 --- a/shared/examples_common.gradle +++ /dev/null @@ -1,20 +0,0 @@ -task copyPhotonlib() { - doFirst { - // Assume publish to maven local has just be run. Kinda curst - - def vendorJsonSrc = new File("${rootDir}", "../photon-lib/build/generated/vendordeps/"); - def vendorJsonDst = new File("${projectDir}/vendordeps/"); - - delete(fileTree(vendorJsonDst) { - exclude '.gitignore' - }) - - println("Copying from ${vendorJsonSrc} to ${vendorJsonDst}") - - copy { - from vendorJsonSrc - into vendorJsonDst - } - } - outputs.upToDateWhen { false } -} diff --git a/shared/javacpp/setupBuild.gradle b/shared/javacpp/setupBuild.gradle deleted file mode 100644 index 05df392020..0000000000 --- a/shared/javacpp/setupBuild.gradle +++ /dev/null @@ -1,106 +0,0 @@ -apply plugin: 'cpp' -apply plugin: 'google-test-test-suite' - -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" + openCVYear, wpi.versions.opencvVersion.get()) - -// Windows specific functionality to export all symbols from a binary automatically -nativeUtils { - exportsConfigs { - "${nativeName}" {} - } -} - -model { - components { - "${nativeName}"(NativeLibrarySpec) { - sources { - cpp { - source { - srcDirs 'src/main/native/cpp', "$buildDir/generated/source/proto/main/cpp" - include '**/*.cpp', '**/*.cc' - } - exportedHeaders { - srcDirs 'src/main/native/include', "$buildDir/generated/source/proto/main/cpp" - if (project.hasProperty('generatedHeaders')) { - srcDir generatedHeaders - } - include "**/*.h" - } - } - } - - binaries.all { - it.tasks.withType(CppCompile) { - it.dependsOn generateProto - } - if(project.hasProperty('includePhotonTargeting')) { - lib project: ':photon-targeting', library: 'photontargeting', linkage: 'shared' - } - } - - nativeUtils.useRequiredLibrary(it, "wpilib_shared") - nativeUtils.useRequiredLibrary(it, "apriltag_shared") - nativeUtils.useRequiredLibrary(it, "opencv_shared") - } - } - testSuites { - "${nativeName}Test"(GoogleTestTestSuiteSpec) { - for(NativeComponentSpec c : $.components) { - if (c.name == nativeName) { - testing c - break - } - } - sources { - cpp { - source { - srcDirs 'src/test/native/cpp' - include '**/*.cpp' - } - exportedHeaders { - srcDirs 'src/test/native/include', "$buildDir/generated/source/proto/main/cpp" - } - } - } - - binaries.all { - it.tasks.withType(CppCompile) { - it.dependsOn generateProto - } - if(project.hasProperty('includePhotonTargeting')) { - lib project: ':photon-targeting', library: 'photontargeting', linkage: 'shared' - } - } - - nativeUtils.useRequiredLibrary(it, "cscore_shared") - nativeUtils.useRequiredLibrary(it, "cameraserver_shared") - nativeUtils.useRequiredLibrary(it, "wpilib_executable_shared") - nativeUtils.useRequiredLibrary(it, "googletest_static") - nativeUtils.useRequiredLibrary(it, "apriltag_shared") - nativeUtils.useRequiredLibrary(it, "opencv_shared") - } - } -} - -apply from: "${rootDir}/shared/javacpp/publish.gradle"