[build] Add spotless for other files (#3007)

Adds spotless formatting for Gradle, xml, md, and gitignore files.

yml linting is not performed as it requires a dependency on npm.
This commit is contained in:
Austin Shalit
2020-12-30 16:17:20 -08:00
committed by GitHub
parent 8651aa73e8
commit 65b2359b27
39 changed files with 879 additions and 662 deletions

View File

@@ -231,7 +231,7 @@ jobs:
github.ref == 'refs/heads/master'
run: cd combiner && ./gradlew publish -Pallwpilib
env:
RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE'
RUN_AZURE_ARTIFACTORY_RELEASE: "TRUE"
ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: Combine (Release)
@@ -240,7 +240,7 @@ jobs:
startsWith(github.ref, 'refs/tags/v')
run: cd combiner && ./gradlew publish -Pallwpilib -PreleaseRepoPublish
env:
RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE'
RUN_AZURE_ARTIFACTORY_RELEASE: "TRUE"
ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- uses: actions/upload-artifact@v2

View File

@@ -1,27 +1,27 @@
## Publishing Third Party Dependencies
Currently the 3rd party deps are imgui, opencv, and google test
For publishing these dependencies, the version needs to be manually updated in the publish.gradle file of their respective repository.
Then, in the azure build for the dependency you want to build for, manually start a pipeline build (As of current, this is the `Run Pipeline` button).
A variable needs to be added called `RUN_AZURE_ARTIFACTORY_RELEASE`, with a value of `true`. Then when the pipeline gets started, the final build outputs will be updated to artifactory.
To use newer versions of C++ dependencies, in `shared/config.gradle`, update the version related to the specific dependency.
For Java dependencies, there is likely a file related to the specific dependency in the shared folder. Update the version in there.
Note, changing artifact locations (This includes changing the artifact year currently, I have an issue open to change this) requires updating the `native-utils` plugin
## Publishing allwpilib
allwpilib publishes to the development repo on every push to master. To publish a release build, upload a new tag, and a release will automatically be built and published.
## Publishing desktop tools
Desktop tools publish to the development repo on every push to master. To publish a release build, upload a new tag, and a release will automatically be built and published.
## Publishing VS Code
Before publishing, make sure to update the gradlerio version in `vscode-wpilib/resources/gradle/version.txt` Also make sure the gradle wrapper version matches the wrapper required by gradlerio.
Upon pushing a tag, a release will be built, and the files will be uploaded to the releases on GitHub. For publishing to the marketplace, you need a Microsoft account and to be added as a maintainer.
## Publishing GradleRIO
Before publishing, make sure to update the version in build.gradle. Publishing must happen locally, using the command `./gradlew publishPlugin`. This does require your API key for publishing to be set.
## Building the installer
Update the GradleRIO version in gradle.properties, and in the scripts folder in vscode, update the vscode extension. Then push, it will build the installer on azure.
## Publishing Third Party Dependencies
Currently the 3rd party deps are imgui, opencv, and google test
For publishing these dependencies, the version needs to be manually updated in the publish.gradle file of their respective repository.
Then, in the azure build for the dependency you want to build for, manually start a pipeline build (As of current, this is the `Run Pipeline` button).
A variable needs to be added called `RUN_AZURE_ARTIFACTORY_RELEASE`, with a value of `true`. Then when the pipeline gets started, the final build outputs will be updated to artifactory.
To use newer versions of C++ dependencies, in `shared/config.gradle`, update the version related to the specific dependency.
For Java dependencies, there is likely a file related to the specific dependency in the shared folder. Update the version in there.
Note, changing artifact locations (This includes changing the artifact year currently, I have an issue open to change this) requires updating the `native-utils` plugin
## Publishing allwpilib
allwpilib publishes to the development repo on every push to master. To publish a release build, upload a new tag, and a release will automatically be built and published.
## Publishing desktop tools
Desktop tools publish to the development repo on every push to master. To publish a release build, upload a new tag, and a release will automatically be built and published.
## Publishing VS Code
Before publishing, make sure to update the gradlerio version in `vscode-wpilib/resources/gradle/version.txt` Also make sure the gradle wrapper version matches the wrapper required by gradlerio.
Upon pushing a tag, a release will be built, and the files will be uploaded to the releases on GitHub. For publishing to the marketplace, you need a Microsoft account and to be added as a maintainer.
## Publishing GradleRIO
Before publishing, make sure to update the version in build.gradle. Publishing must happen locally, using the command `./gradlew publishPlugin`. This does require your API key for publishing to be set.
## Building the installer
Update the GradleRIO version in gradle.properties, and in the scripts folder in vscode, update the vscode extension. Then push, it will build the installer on azure.

View File

@@ -50,7 +50,7 @@ The following build options are available:
## Build Setup
The WPILib CMake build does not allow in source builds. Because the `build` directory is used by Gradle, we recommend a `buildcmake` directory in the root. This folder is included in the gitignore.
The WPILib CMake build does not allow in source builds. Because the `build` directory is used by Gradle, we recommend a `build-cmake` directory in the root. This folder is included in the gitignore.
Once you have a build folder, run CMake configuration in that build directory with the following command.

View File

@@ -4,88 +4,88 @@ trigger:
batch: true
branches:
include:
- master
- master
stages:
- stage: Build
jobs:
- job: IntegrationTests
displayName: Integration Tests
pool:
vmImage: 'Ubuntu 16.04'
- stage: Build
jobs:
- job: IntegrationTests
displayName: Integration Tests
pool:
vmImage: "Ubuntu 16.04"
container:
image: wpilib/roborio-cross-ubuntu:2021-18.04
container:
image: wpilib/roborio-cross-ubuntu:2021-18.04
timeoutInMinutes: 0
timeoutInMinutes: 0
steps:
- task: Gradle@2
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
tasks: 'copyWpilibJIntegrationTestJarToOutput copyWpilibCTestLibrariesToOutput'
options: '-Ponlylinuxathena -PbuildServer'
steps:
- task: Gradle@2
condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')))
inputs:
workingDirectory: ""
gradleWrapperFile: "gradlew"
gradleOptions: "-Xmx3072m"
publishJUnitResults: false
testResultsFiles: "**/TEST-*.xml"
tasks: "copyWpilibJIntegrationTestJarToOutput copyWpilibCTestLibrariesToOutput"
options: "-Ponlylinuxathena -PbuildServer"
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'Integration Tests'
targetPath: 'build/integrationTestFiles'
- task: PublishPipelineArtifact@0
inputs:
artifactName: "Integration Tests"
targetPath: "build/integrationTestFiles"
- stage: TestBench
displayName: Test Bench
jobs:
- job: Cpp
displayName: C++
pool: RoboRioConnections
timeoutInMinutes: 30
workspace:
clean: all
steps:
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'Integration Tests'
targetPath: 'build/integrationTestFiles'
- stage: TestBench
displayName: Test Bench
jobs:
- job: Cpp
displayName: C++
pool: RoboRioConnections
timeoutInMinutes: 30
workspace:
clean: all
steps:
- task: DownloadPipelineArtifact@0
inputs:
artifactName: "Integration Tests"
targetPath: "build/integrationTestFiles"
- task: ShellScript@2
displayName: Run C++ Tests
inputs:
scriptPath: test-scripts/deploy-and-run-test-on-robot.sh
args: 'cpp -A "--gtest_output=xml:/home/admin/testResults/cppreport.xml"'
- task: ShellScript@2
displayName: Run C++ Tests
inputs:
scriptPath: test-scripts/deploy-and-run-test-on-robot.sh
args: 'cpp -A "--gtest_output=xml:/home/admin/testResults/cppreport.xml"'
- task: PublishTestResults@2
displayName: Publish C++ Test Results
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '*.xml'
testRunTitle: 'C++ Test Report'
searchFolder: '$(System.DefaultWorkingDirectory)/test-reports'
- task: PublishTestResults@2
displayName: Publish C++ Test Results
inputs:
testResultsFormat: "JUnit"
testResultsFiles: "*.xml"
testRunTitle: "C++ Test Report"
searchFolder: "$(System.DefaultWorkingDirectory)/test-reports"
- job: Java
pool: RoboRioConnections
timeoutInMinutes: 30
workspace:
clean: all
steps:
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'Integration Tests'
targetPath: 'build/integrationTestFiles'
- job: Java
pool: RoboRioConnections
timeoutInMinutes: 30
workspace:
clean: all
steps:
- task: DownloadPipelineArtifact@0
inputs:
artifactName: "Integration Tests"
targetPath: "build/integrationTestFiles"
- task: ShellScript@2
displayName: Run Java Tests
inputs:
scriptPath: test-scripts/deploy-and-run-test-on-robot.sh
args: 'java'
- task: ShellScript@2
displayName: Run Java Tests
inputs:
scriptPath: test-scripts/deploy-and-run-test-on-robot.sh
args: "java"
- task: PublishTestResults@2
displayName: Publish Java Test Results
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '*.xml'
testRunTitle: 'Java Test Report'
searchFolder: '$(System.DefaultWorkingDirectory)/test-reports'
- task: PublishTestResults@2
displayName: Publish Java Test Results
inputs:
testResultsFormat: "JUnit"
testResultsFiles: "*.xml"
testRunTitle: "Java Test Report"
searchFolder: "$(System.DefaultWorkingDirectory)/test-reports"

View File

@@ -118,8 +118,12 @@ subprojects {
String path = task.getLinkedFile().getAsFile().get().getAbsolutePath()
exec {
workingDir rootDir
def args = ["sh", "-c", "codesign --force --strict --timestamp --options=runtime " +
"--verbose -s ${project.findProperty("developerID")} ${path}"]
def args = [
"sh",
"-c",
"codesign --force --strict --timestamp --options=runtime " +
"--verbose -s ${project.findProperty("developerID")} ${path}"
]
commandLine args
}
}
@@ -136,13 +140,42 @@ spotless {
java {
target fileTree('.') {
include '**/*.java'
exclude '**/manualTests/**', '**/build*/**'
exclude '**/build/**', '**/build-*/**'
}
googleJavaFormat()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
groovyGradle {
target fileTree('.') {
include '**/*.gradle'
exclude '**/build/**', '**/build-*/**'
}
greclipse()
indentWithSpaces(4)
trimTrailingWhitespace()
endWithNewline()
}
format 'xml', {
target fileTree('.') {
include '**/*.xml'
exclude '**/build/**', '**/build-*/**'
}
eclipseWtp('xml')
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
format 'misc', {
target fileTree('.') {
include '**/*.md', '**/.gitignore'
exclude '**/build/**', '**/build-*/**'
}
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
}
wrapper {

View File

@@ -20,9 +20,9 @@ dependencies {
ext {
sharedCvConfigs = [cameraserver : [],
cameraserverBase: [],
cameraserverDev : [],
cameraserverTest: []]
cameraserverBase: [],
cameraserverDev : [],
cameraserverTest: []]
staticCvConfigs = [:]
useJava = true
useCpp = true
@@ -32,14 +32,32 @@ apply from: "${rootDir}/shared/opencv.gradle"
nativeUtils.exportsConfigs {
cameraserver {
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x86ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
x64ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
}
}

View File

@@ -52,10 +52,10 @@ model {
}
}
binaries.all { binary ->
lib project: ':cameraserver', library: 'cameraserver', linkage: 'static'
lib project: ':ntcore', library: 'ntcore', linkage: 'static'
lib project: ':cscore', library: 'cscore', linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
lib project: ':cameraserver', library: 'cameraserver', linkage: 'static'
lib project: ':ntcore', library: 'ntcore', linkage: 'static'
lib project: ':cscore', library: 'cscore', linkage: 'static'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
}
}
}

View File

@@ -60,12 +60,12 @@ model {
ext {
sharedCvConfigs = [cscore : [],
cscoreBase: [],
cscoreDev : [],
cscoreTest: [],
cscoreJNIShared: []]
cscoreBase: [],
cscoreDev : [],
cscoreTest: [],
cscoreJNIShared: []]
staticCvConfigs = [cscoreJNI: [],
cscoreJNICvStatic: []]
cscoreJNICvStatic: []]
useJava = true
useCpp = true
cvStaticBuild = true
@@ -127,27 +127,45 @@ def examplesMap = [:];
File examplesTree = file("$projectDir/examples")
examplesTree.list(new FilenameFilter() {
@Override
public boolean accept(File current, String name) {
return new File(current, name).isDirectory();
}
}).each {
sharedCvConfigs.put(it, [])
examplesMap.put(it, [])
}
@Override
public boolean accept(File current, String name) {
return new File(current, name).isDirectory();
}
}).each {
sharedCvConfigs.put(it, [])
examplesMap.put(it, [])
}
apply from: "${rootDir}/shared/opencv.gradle"
nativeUtils.exportsConfigs {
cscore {
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x86ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
x64ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
}
cscoreJNI {
x86SymbolFilter = { symbols ->

View File

@@ -39,7 +39,7 @@ cppProjectZips.add(project(':wpilibNewCommands').cppHeadersZip)
doxygen {
executables {
doxygen version : '1.8.18',
baseURI : 'https://frcmaven.wpi.edu/artifactory/generic-release-mirror/doxygen'
baseURI : 'https://frcmaven.wpi.edu/artifactory/generic-release-mirror/doxygen'
}
}

View File

@@ -30,14 +30,32 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
nativeUtils.exportsConfigs {
glass {
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x86ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
x64ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
}
}

View File

@@ -29,10 +29,14 @@ model {
// Get path to binary.
exec {
workingDir rootDir
def args = ["sh", "-c", "codesign --force --strict --deep " +
"--timestamp --options=runtime " +
"--verbose -s ${project.findProperty("developerID")} " +
"$project.buildDir/outputs/bundles/Glass.app/"]
def args = [
"sh",
"-c",
"codesign --force --strict --deep " +
"--timestamp --options=runtime " +
"--verbose -s ${project.findProperty("developerID")} " +
"$project.buildDir/outputs/bundles/Glass.app/"
]
commandLine args
}
}

View File

@@ -129,14 +129,32 @@ cppHeadersZip {
nativeUtils.exportsConfigs {
hal {
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x86ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
x64ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
}
halJNI {
x86SymbolFilter = { symbols ->
@@ -152,9 +170,9 @@ model {
binaries {
all {
if (!(it instanceof NativeBinarySpec)) return
if (it.component.name != 'hal' && it.component.name != 'halBase') return
if (it.targetPlatform.name != nativeUtils.wpi.platforms.roborio) return
nativeUtils.useRequiredLibrary(it, 'netcomm_shared', 'chipobject_shared', 'visa_shared')
if (it.component.name != 'hal' && it.component.name != 'halBase') return
if (it.targetPlatform.name != nativeUtils.wpi.platforms.roborio) return
nativeUtils.useRequiredLibrary(it, 'netcomm_shared', 'chipobject_shared', 'visa_shared')
}
}
}

View File

@@ -1,91 +1,91 @@
import org.gradle.nativeplatform.toolchain.internal.msvcpp.VisualStudioLocator
import org.gradle.internal.os.OperatingSystem
import org.gradle.util.VersionNumber
plugins {
id 'cpp'
id 'maven-publish'
}
if (OperatingSystem.current().isWindows()) {
def outputsFolder = file("$buildDir/outputs")
def baseArtifactId = 'runtime'
def artifactGroupId = "edu.wpi.first.msvc"
def zipBaseName = "_GROUP_edu_wpi_first_msvc_ID_runtime_CLS"
def vsLocator = gradle.services.get(VisualStudioLocator)
def vsLocation = vsLocator.locateAllComponents().first()
def visualCppVersion = vsLocation.visualCpp.version
def vsDirectory = vsLocation.visualStudioDir
def runtimeLocation = file("$vsDirectory\\VC\\Redist\\MSVC")
def runtimeVerNumber = null
runtimeLocation.eachFile {
def verNumber = VersionNumber.parse(it.name)
if (verNumber.major == visualCppVersion.major && verNumber.minor == visualCppVersion.minor) {
runtimeVerNumber = verNumber
}
}
if (runtimeVerNumber != null) {
runtimeLocation = file("$runtimeLocation\\$runtimeVerNumber")
def x86Folder = null
file("$runtimeLocation\\x86").eachFile {
if (it.name.endsWith('.CRT')) {
x86Folder = it
}
}
def x64Folder = null
file("$runtimeLocation\\x64").eachFile {
if (it.name.endsWith('.CRT')) {
x64Folder = it
}
}
def x86ZipTask = tasks.create('x86RuntimeZip', Zip) {
destinationDirectory = outputsFolder
archiveBaseName = zipBaseName
classifier = 'x86'
from x86Folder
}
def x64ZipTask = tasks.create('x64RuntimeZip', Zip) {
destinationDirectory = outputsFolder
archiveBaseName = zipBaseName
classifier = 'x64'
from x64Folder
}
addTaskToCopyAllOutputs(x86ZipTask)
addTaskToCopyAllOutputs(x64ZipTask)
build.dependsOn x86ZipTask
build.dependsOn x64ZipTask
publishing {
publications {
runtime(MavenPublication) {
artifact x86ZipTask
artifact x64ZipTask
artifactId = "${baseArtifactId}"
groupId artifactGroupId
version wpilibVersioning.version.get()
}
}
}
}
}
import org.gradle.nativeplatform.toolchain.internal.msvcpp.VisualStudioLocator
import org.gradle.internal.os.OperatingSystem
import org.gradle.util.VersionNumber
plugins {
id 'cpp'
id 'maven-publish'
}
if (OperatingSystem.current().isWindows()) {
def outputsFolder = file("$buildDir/outputs")
def baseArtifactId = 'runtime'
def artifactGroupId = "edu.wpi.first.msvc"
def zipBaseName = "_GROUP_edu_wpi_first_msvc_ID_runtime_CLS"
def vsLocator = gradle.services.get(VisualStudioLocator)
def vsLocation = vsLocator.locateAllComponents().first()
def visualCppVersion = vsLocation.visualCpp.version
def vsDirectory = vsLocation.visualStudioDir
def runtimeLocation = file("$vsDirectory\\VC\\Redist\\MSVC")
def runtimeVerNumber = null
runtimeLocation.eachFile {
def verNumber = VersionNumber.parse(it.name)
if (verNumber.major == visualCppVersion.major && verNumber.minor == visualCppVersion.minor) {
runtimeVerNumber = verNumber
}
}
if (runtimeVerNumber != null) {
runtimeLocation = file("$runtimeLocation\\$runtimeVerNumber")
def x86Folder = null
file("$runtimeLocation\\x86").eachFile {
if (it.name.endsWith('.CRT')) {
x86Folder = it
}
}
def x64Folder = null
file("$runtimeLocation\\x64").eachFile {
if (it.name.endsWith('.CRT')) {
x64Folder = it
}
}
def x86ZipTask = tasks.create('x86RuntimeZip', Zip) {
destinationDirectory = outputsFolder
archiveBaseName = zipBaseName
classifier = 'x86'
from x86Folder
}
def x64ZipTask = tasks.create('x64RuntimeZip', Zip) {
destinationDirectory = outputsFolder
archiveBaseName = zipBaseName
classifier = 'x64'
from x64Folder
}
addTaskToCopyAllOutputs(x86ZipTask)
addTaskToCopyAllOutputs(x64ZipTask)
build.dependsOn x86ZipTask
build.dependsOn x64ZipTask
publishing {
publications {
runtime(MavenPublication) {
artifact x86ZipTask
artifact x64ZipTask
artifactId = "${baseArtifactId}"
groupId artifactGroupId
version wpilibVersioning.version.get()
}
}
}
}
}

View File

@@ -77,7 +77,6 @@ deploy {
postdeploy << { ctx ->
ctx.execute('chmod +x myRobotCpp')
}
}
nativeArtifact('myRobotCppStatic') {
@@ -136,9 +135,7 @@ dependencies {
implementation project(':wpilibNewCommands')
}
def simProjects = [
'halsim_gui'
]
def simProjects = ['halsim_gui']
model {
components {

View File

@@ -7,14 +7,32 @@ apply from: "${rootDir}/shared/jni/setupBuild.gradle"
nativeUtils.exportsConfigs {
ntcore {
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x86ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
x64ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
}
ntcoreJNI {
x86SymbolFilter = { symbols ->

View File

@@ -18,10 +18,13 @@ public class Client {
NetworkTable.setPort(10000);
NetworkTable.setClientMode();
NetworkTable nt = NetworkTable.getTable("");
try { Thread.sleep(2000); } catch (InterruptedException e) {}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
}
try {
System.out.println("Got foo: " + nt.getNumber("foo"));
} catch(TableKeyNotDefinedException ex) {
} catch (TableKeyNotDefinedException ex) {
}
nt.putBoolean("bar", false);
nt.setFlags("bar", NetworkTable.PERSISTENT);
@@ -38,6 +41,9 @@ public class Client {
strs[0] = "Hello";
strs[1] = "World";
nt.putStringArray("strarray", strs);
try { Thread.sleep(10000); } catch (InterruptedException e) {}
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
}
}
}

View File

@@ -18,13 +18,19 @@ public class Server {
NetworkTable.setPort(10000);
NetworkTable.setServerMode();
NetworkTable nt = NetworkTable.getTable("");
try { Thread.sleep(1000); } catch (InterruptedException e) {}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
nt.putNumber("foo", 0.5);
nt.setFlags("foo", NetworkTable.PERSISTENT);
nt.putNumber("foo2", 0.5);
nt.putNumber("foo2", 0.7);
nt.putNumber("foo2", 0.6);
nt.putNumber("foo2", 0.5);
try { Thread.sleep(10000); } catch (InterruptedException e) {}
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
}
}
}

View File

@@ -5,16 +5,16 @@ nativeUtils.withRoboRIO()
nativeUtils.withRaspbian()
nativeUtils.withBionic()
nativeUtils {
wpi {
configureDependencies {
wpiVersion = "-1"
niLibVersion = "2020.10.1"
opencvVersion = "3.4.7-5"
googleTestVersion = "1.9.0-5-437e100-1"
imguiVersion = "1.76-10"
wpimathVersion = "-1"
wpi {
configureDependencies {
wpiVersion = "-1"
niLibVersion = "2020.10.1"
opencvVersion = "3.4.7-5"
googleTestVersion = "1.9.0-5-437e100-1"
imguiVersion = "1.76-10"
wpimathVersion = "-1"
}
}
}
}
nativeUtils.wpi.addWarnings()
@@ -26,7 +26,7 @@ nativeUtils.enableSourceLink()
nativeUtils.platformConfigs.each {
if (it.name.contains('windows')) return
it.linker.args << '-Wl,-rpath,\'$ORIGIN\''
it.linker.args << '-Wl,-rpath,\'$ORIGIN\''
if (it.name == 'osxx86-64') {
it.linker.args << "-headerpad_max_install_names"
}
@@ -99,7 +99,7 @@ ext.createComponentZipTasks = { components, names, base, type, project, func ->
if (it in NativeLibrarySpec && stringNames.contains(it.name)) {
it.binaries.each {
if (!it.buildable) return
def target = nativeUtils.getPublishClassifier(it)
def target = nativeUtils.getPublishClassifier(it)
if (configMap.containsKey(target)) {
configMap.get(target).add(it)
} else {

View File

@@ -1,21 +1,21 @@
model {
tasks {
def ts = $.testSuites
project.tasks.register('testDesktopCpp') { testTask->
def systemArch = getCurrentArch()
def found = false
ts.each {
if (it in GoogleTestTestSuiteSpec && it.name == "${nativeName}Test") {
it.binaries.each {
if (found) return
def arch = it.targetPlatform.name
if (arch == systemArch && it.buildType.name == 'debug') {
testTask.dependsOn it.tasks.run
found = true
}
}
}
}
}
}
}
model {
tasks {
def ts = $.testSuites
project.tasks.register('testDesktopCpp') { testTask->
def systemArch = getCurrentArch()
def found = false
ts.each {
if (it in GoogleTestTestSuiteSpec && it.name == "${nativeName}Test") {
it.binaries.each {
if (found) return
def arch = it.targetPlatform.name
if (arch == systemArch && it.buildType.name == 'debug') {
testTask.dependsOn it.tasks.run
found = true
}
}
}
}
}
}
}

View File

@@ -1,3 +1,3 @@
tasks.register('testDesktopJava') {
dependsOn test
dependsOn test
}

View File

@@ -65,7 +65,10 @@ addTaskToCopyAllOutputs(cppHeadersZip)
model {
publishing {
def taskList = createComponentZipTasks($.components, [nativeName, "${nativeName}JNIShared"], zipBaseName, Zip, project, includeStandardZipFormat)
def taskList = createComponentZipTasks($.components, [
nativeName,
"${nativeName}JNIShared"
], zipBaseName, Zip, project, includeStandardZipFormat)
def jniTaskList = createComponentZipTasks($.components, ["${nativeName}JNI"], jniBaseName, Jar, project, { task, value ->
value.each { binary ->

View File

@@ -117,7 +117,6 @@ model {
}
include '**/*.h'
}
}
}
binaries.all {

View File

@@ -13,7 +13,7 @@ ext.createGenerateResourcesTask = { name, prefix, namespace, project ->
generatedOutputDir.mkdirs()
inputDir.eachFile { inputFile ->
if (inputFile.name.startsWith('.')) return
def fileBytes = inputFile.bytes
def fileBytes = inputFile.bytes
def outputFile = file("$generatedOutputDir/${inputFile.name}.cpp")
def funcName = "GetResource_" + inputFile.name.replaceAll('[^a-zA-Z0-9]', '_')
outputFile.withWriter { out ->

View File

@@ -56,7 +56,6 @@ model {
cpp.lib library: "${component.name}", linkage: "static"
}
}
}
/* TODO: Finish writing the test case */
@@ -97,7 +96,7 @@ model {
// project(':gmock').addGmockToLinker(it)
//}
//else {
buildable = false
buildable = false
//}
}
}

View File

@@ -13,11 +13,9 @@ ext.skiplinuxraspbian = true
apply from: "${rootDir}/shared/config.gradle"
/* Use a sort of poor man's autoconf to find the protobuf development
files; on Debian, those are supplied by libprotobuf-dev.
This should get skipped on Windows.
TODO: Add Windows support for the simulation code */
files; on Debian, those are supplied by libprotobuf-dev.
This should get skipped on Windows.
TODO: Add Windows support for the simulation code */
def protobuf_version = ""
try {
@@ -41,14 +39,14 @@ tasks.whenTaskAdded { task ->
}
dependencies {
implementation "com.google.protobuf:protobuf-java:${protobuf_version}"
implementation "com.google.protobuf:protoc:${protobuf_version}"
implementation "com.google.protobuf:protobuf-java:${protobuf_version}"
implementation "com.google.protobuf:protoc:${protobuf_version}"
}
/* There is a nice gradle plugin for protobuf, and the protoc tool
is included; using it simplifies our build process.
The trick is that we have to use the same version as the system
copy of libprotobuf-dev */
is included; using it simplifies our build process.
The trick is that we have to use the same version as the system
copy of libprotobuf-dev */
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protobuf_version}"

View File

@@ -35,7 +35,6 @@ def gz_msgs_project = project(":simulation:gz_msgs")
if (!gz_msgs_project.hasProperty('skip_gz_msgs') && !project.hasProperty('skip_frc_plugins')) {
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
}
model {

View File

@@ -28,7 +28,6 @@ if (!project.hasProperty('onlylinuxathena')) {
}
lib project: ":simulation:halsim_ws_core", library: "halsim_ws_core", linkage: "static"
}
}
}

View File

@@ -41,7 +41,6 @@ if (!project.hasProperty('onlylinuxathena')) {
binaries.all {
project(':hal').addHalDependency(it, 'shared')
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
}
appendDebugPathToBinaries(binaries)
}

View File

@@ -63,7 +63,6 @@ model {
}
}
}
}
tasks.withType(RunTestExecutable) {

View File

@@ -2,90 +2,77 @@
<!DOCTYPE
module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the Google coding conventions from Google Java Style
that can be found at https://google.github.io/styleguide/javaguide.html.
Checkstyle is very configurable. Be sure to read the documentation at
http://checkstyle.sf.net (or in your downloaded distribution).
To completely disable a check, just comment it out or delete it from the file.
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
-->
<!-- Checkstyle configuration that checks the Google coding conventions from
Google Java Style that can be found at https://google.github.io/styleguide/javaguide.html.
Checkstyle is very configurable. Be sure to read the documentation at http://checkstyle.sf.net
(or in your downloaded distribution). To completely disable a check, just
comment it out or delete it from the file. Authors: Max Vetrenko, Ruslan
Diachenko, Roman Ivanov. -->
<module name="Checker">
<property name="charset"
value="UTF-8" />
<property name="severity"
value="error" />
<property name="charset" value="UTF-8" />
<property name="severity" value="error" />
<module name="SuppressionFilter">
<property name="file"
value="${config_loc}/suppressions.xml" />
<property name="file" value="${config_loc}/suppressions.xml" />
</module>
<property name="fileExtensions"
value="java, properties, xml" />
<!-- Checks for whitespace -->
<property name="fileExtensions" value="java, properties, xml" />
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="FileTabCharacter">
<property name="eachLine"
value="true" />
<property name="eachLine" value="true" />
</module>
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="100"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
<property name="fileExtensions" value="java" />
<property name="max" value="100" />
<property name="ignorePattern"
value="^package.*|^import.*|a href|href|http://|https://|ftp://" />
</module>
<module name="NewlineAtEndOfFile" />
<module name="SuppressWarningsFilter" />
<module name="TreeWalker">
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
<property name="offCommentFormat"
value="CHECKSTYLE.OFF\: ([\w\|]+)" />
<property name="onCommentFormat"
value="CHECKSTYLE.ON\: ([\w\|]+)" />
<property name="checkFormat" value="$1" />
</module>
<module name="SuppressWarningsHolder" />
<module name="OuterTypeFilename" />
<module name="IllegalTokenText">
<property name="tokens"
value="STRING_LITERAL, CHAR_LITERAL" />
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL" />
<property name="format"
value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)" />
value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)" />
<property name="message"
value="Avoid using corresponding octal or Unicode escape." />
value="Avoid using corresponding octal or Unicode escape." />
</module>
<module name="IllegalTokenText">
<property name="tokens"
value="NUM_INT,NUM_LONG"/>
<property name="format"
value="^0[^lx]"/>
<property name="ignoreCase"
value="true"/>
<property name="tokens" value="NUM_INT,NUM_LONG" />
<property name="format" value="^0[^lx]" />
<property name="ignoreCase" value="true" />
<property name="message"
value="Forbid leading zeros in an integer literal, other than zero and a hex literal." />
value="Forbid leading zeros in an integer literal, other than zero and a hex literal." />
</module>
<module name="IllegalTokenText">
<property name="tokens"
value="NUM_DOUBLE,NUM_FLOAT"/>
<property name="format"
value="(^\.|\.$)"/>
<property name="ignoreCase"
value="true"/>
<property name="tokens" value="NUM_DOUBLE,NUM_FLOAT" />
<property name="format" value="(^\.|\.$)" />
<property name="ignoreCase" value="true" />
<property name="message"
value="Must use leading and trailing zero in floating point numbers." />
value="Must use leading and trailing zero in floating point numbers." />
</module>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters"
value="true" />
<property name="allowByTailComment"
value="true" />
<property name="allowNonPrintableEscapes"
value="true" />
value="true" />
<property name="allowByTailComment" value="true" />
<property name="allowNonPrintableEscapes" value="true" />
</module>
<module name="CustomImportOrder">
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true"/>
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
<property name="tokens" value="IMPORT, STATIC_IMPORT, PACKAGE_DEF"/>
<property name="sortImportsInGroupAlphabetically"
value="true" />
<property name="separateLineBetweenGroups" value="true" />
<property name="customImportOrderRules"
value="STATIC###THIRD_PARTY_PACKAGE" />
<property name="tokens"
value="IMPORT, STATIC_IMPORT, PACKAGE_DEF" />
</module>
<module name="AvoidStarImport" />
<module name="RedundantImport" />
@@ -93,59 +80,59 @@ module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
<module name="OneTopLevelClass" />
<module name="NoLineWrap" />
<module name="EmptyBlock">
<property name="option"
value="TEXT" />
<property name="option" value="TEXT" />
<property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH" />
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH" />
</module>
<module name="NeedBraces" />
<module name="LeftCurly">
<property name="tokens"
value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
INTERFACE_DEF, LAMBDA, LITERAL_CATCH, LITERAL_DEFAULT,
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF,
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF,
OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF"/>
OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF" />
</module>
<module name="RightCurly">
<property name="id" value="RightCurlySame"/>
<property name="id" value="RightCurlySame" />
<property name="tokens"
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
LITERAL_DO"/>
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
LITERAL_DO" />
</module>
<module name="RightCurly">
<property name="id" value="RightCurlyAlone"/>
<property name="option" value="alone"/>
<property name="id" value="RightCurlyAlone" />
<property name="option" value="alone" />
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF, INTERFACE_DEF, RECORD_DEF,
COMPACT_CTOR_DEF"/>
COMPACT_CTOR_DEF" />
</module>
<module name="SuppressionXpathSingleFilter">
<!-- suppresion is required till https://github.com/checkstyle/checkstyle/issues/7541 -->
<property name="id" value="RightCurlyAlone"/>
<property name="query" value="//RCURLY[parent::SLIST[count(./*)=1]
or preceding-sibling::*[last()][self::LCURLY]]"/>
<property name="id" value="RightCurlyAlone" />
<property name="query"
value="//RCURLY[parent::SLIST[count(./*)=1]
or preceding-sibling::*[last()][self::LCURLY]]" />
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="ignoreEnhancedForColon" value="false"/>
<property name="allowEmptyConstructors" value="true" />
<property name="allowEmptyLambdas" value="true" />
<property name="allowEmptyMethods" value="true" />
<property name="allowEmptyTypes" value="true" />
<property name="allowEmptyLoops" value="true" />
<property name="ignoreEnhancedForColon" value="false" />
<property name="tokens"
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR,
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR,
BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND,
LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY,
LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED,
LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN,
NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR,
SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND" />
<message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)" />
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
value="WhitespaceAround: ''{0}'' is not preceded with whitespace." />
</module>
<module name="WhitespaceAfter" />
<module name="OneStatementPerLine" />
@@ -161,163 +148,150 @@ module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
<module name="ModifierOrder" />
<module name="RedundantModifier" />
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields"
value="true" />
<property name="allowNoEmptyLineBetweenFields" value="true" />
</module>
<module name="SeparatorWrap">
<property name="tokens"
value="DOT" />
<property name="option"
value="nl" />
<property name="tokens" value="DOT" />
<property name="option" value="nl" />
</module>
<module name="SeparatorWrap">
<property name="tokens"
value="COMMA" />
<property name="option"
value="EOL" />
<property name="tokens" value="COMMA" />
<property name="option" value="EOL" />
</module>
<module name="PackageName">
<property name="format"
value="^[a-z]+(\.[a-z][a-z0-9]*)*$" />
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$" />
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''." />
value="Package name ''{0}'' must match pattern ''{1}''." />
</module>
<module name="TypeName">
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''." />
value="Type name ''{0}'' must match pattern ''{1}''." />
</module>
<module name="MemberName">
<property name="format"
value="^(m_[a-z]([a-zA-Z0-9]*)|value)$" />
value="^(m_[a-z]([a-zA-Z0-9]*)|value)$" />
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''." />
value="Member name ''{0}'' must match pattern ''{1}''." />
</module>
<module name="ParameterName">
<property name="format"
value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''." />
value="Parameter name ''{0}'' must match pattern ''{1}''." />
</module>
<module name="LambdaParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
<property name="format"
value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
<message key="name.invalidPattern"
value="Lambda parameter name ''{0}'' must match pattern ''{1}''." />
</module>
<module name="CatchParameterName">
<property name="format"
value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
<message key="name.invalidPattern"
value="Catch parameter name ''{0}'' must match pattern ''{1}''." />
value="Catch parameter name ''{0}'' must match pattern ''{1}''." />
</module>
<module name="LocalVariableName">
<property name="tokens"
value="VARIABLE_DEF" />
<property name="tokens" value="VARIABLE_DEF" />
<property name="format"
value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
<property name="allowOneCharVarInForLoop"
value="true" />
value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$" />
<property name="allowOneCharVarInForLoop" value="true" />
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''." />
value="Local variable name ''{0}'' must match pattern ''{1}''." />
</module>
<module name="ClassTypeParameterName">
<property name="format"
value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''." />
value="Class type name ''{0}'' must match pattern ''{1}''." />
</module>
<module name="MethodTypeParameterName">
<property name="format"
value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''." />
value="Method type name ''{0}'' must match pattern ''{1}''." />
</module>
<module name="InterfaceTypeParameterName">
<property name="format"
value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)" />
<message key="name.invalidPattern"
value="Interface type name ''{0}'' must match pattern ''{1}''." />
value="Interface type name ''{0}'' must match pattern ''{1}''." />
</module>
<module name="NoFinalizer" />
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace." />
value="GenericWhitespace ''{0}'' is followed by whitespace." />
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace." />
value="GenericWhitespace ''{0}'' is preceded with whitespace." />
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace." />
value="GenericWhitespace ''{0}'' should followed by whitespace." />
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace." />
value="GenericWhitespace ''{0}'' is not preceded with whitespace." />
</module>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal"
value="false" />
<property name="allowedAbbreviationLength"
value="4" />
<property name="ignoreFinal" value="false" />
<property name="allowedAbbreviationLength" value="4" />
</module>
<module name="OverloadMethodsDeclarationOrder" />
<module name="VariableDeclarationUsageDistance" />
<module name="MethodParamPad" />
<module name="TypecastParenPad" />
<module name="OperatorWrap">
<property name="option"
value="NL" />
<property name="option" value="NL" />
<property name="tokens"
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR " />
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR " />
</module>
<module name="AnnotationLocation">
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF" />
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF" />
</module>
<module name="AnnotationLocation">
<property name="tokens"
value="VARIABLE_DEF" />
<property name="tokens" value="VARIABLE_DEF" />
<property name="allowSamelineMultipleAnnotations"
value="true" />
value="true" />
</module>
<module name="MissingOverride" />
<module name="NonEmptyAtclauseDescription" />
<module name="JavadocTagContinuationIndentation" />
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )" />
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )" />
</module>
<module name="JavadocParagraph" />
<module name="AtclauseOrder">
<property name="tagOrder"
value="@param, @return, @throws, @deprecated" />
value="@param, @return, @throws, @deprecated" />
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF" />
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF" />
</module>
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF"/>
<property name="scope" value="public" />
<property name="allowMissingParamTags" value="true" />
<property name="allowMissingReturnTag" value="true" />
<property name="allowedAnnotations" value="Override, Test" />
<property name="tokens"
value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF" />
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="public"/>
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF,
COMPACT_CTOR_DEF"/>
<property name="scope" value="public" />
<property name="minLineCount" value="2" />
<property name="allowedAnnotations" value="Override, Test" />
<property name="tokens"
value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF,
COMPACT_CTOR_DEF" />
</module>
<module name="MethodName">
<property name="format"
value="^[a-z][a-z0-9][a-zA-Z0-9_]*$" />
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$" />
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''." />
value="Method name ''{0}'' must match pattern ''{1}''." />
</module>
<!-- https://github.com/checkstyle/checkstyle/issues/4052 -->
<!-- <module name="SingleLineJavadoc">
<property name="ignoreInlineTags"
value="false" />
</module> -->
<!-- <module name="SingleLineJavadoc"> <property name="ignoreInlineTags"
value="false" /> </module> -->
<module name="EmptyCatchBlock">
<property name="exceptionVariableName"
value="expected" />
<property name="exceptionVariableName" value="expected" />
</module>
<module name="CommentsIndentation" />
<module name="PackageDeclaration"/>
<module name="PackageDeclaration" />
</module>
</module>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<ruleset name="WPILibRuleset"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>PMD Ruleset for WPILib</description>
@@ -28,7 +28,7 @@
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod">
<properties>
<property name="violationSuppressRegex"
value=".*'.*Arguments\(\)'.*" />
value=".*'.*Arguments\(\)'.*" />
</properties>
</rule>
@@ -67,19 +67,17 @@
<exclude name="AvoidUsingShortType" />
</rule>
<rule name="UnnecessaryCastRule"
language="java"
message="Avoid unnecessary casts"
class="net.sourceforge.pmd.lang.java.rule.migrating.UnnecessaryCastRule"
externalInfoUrl="https://github.com/pmd/pmd/blob/master/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/migrating/UnnecessaryCastRule.java" />
<rule name="UnnecessaryCastRule" language="java"
message="Avoid unnecessary casts"
class="net.sourceforge.pmd.lang.java.rule.migrating.UnnecessaryCastRule"
externalInfoUrl="https://github.com/pmd/pmd/blob/master/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/migrating/UnnecessaryCastRule.java" />
<!-- Custom Rules -->
<rule name="UseRequireNonNull"
message="Use Objects.requireNonNull() instead of throwing a NullPointerException yourself."
language="java"
class="net.sourceforge.pmd.lang.rule.XPathRule">
message="Use Objects.requireNonNull() instead of throwing a NullPointerException yourself."
language="java" class="net.sourceforge.pmd.lang.rule.XPathRule">
<description>Use Objects.requireNonNull() instead of throwing a
NullPointerException yourself.</description>
NullPointerException yourself.</description>
<properties>
<property name="xpath">
<value>

View File

@@ -4,11 +4,10 @@ suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress files=".*sim.*"
checks="(LineLength|EmptyLineSeparator|ParameterName|ImportOrder|AbbreviationAsWordInName|JavadocMethod|NoFinalizer)" />
<suppress files=".*test.*"
checks="MissingJavadocMethod" />
checks="(LineLength|EmptyLineSeparator|ParameterName|ImportOrder|AbbreviationAsWordInName|JavadocMethod|NoFinalizer)" />
<suppress files=".*test.*" checks="MissingJavadocMethod" />
<suppress files=".*wpilibjIntegrationTests.*"
checks="MissingJavadocMethod" />
checks="MissingJavadocMethod" />
<suppress files=".*JNI.*"
checks="(LineLength|EmptyLineSeparator|ParameterName|MissingJavadocMethod)" />
checks="(LineLength|EmptyLineSeparator|ParameterName|MissingJavadocMethod)" />
</suppressions>

View File

@@ -17,14 +17,32 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
nativeUtils.exportsConfigs {
wpigui {
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x86ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
x64ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
}
}

View File

@@ -1,99 +1,117 @@
ext {
nativeName = 'wpilibNewCommands'
devMain = 'edu.wpi.first.wpilibj.commands.DevMain'
}
evaluationDependsOn(':ntcore')
evaluationDependsOn(':cscore')
evaluationDependsOn(':hal')
evaluationDependsOn(':wpimath')
evaluationDependsOn(':wpilibc')
evaluationDependsOn(':cameraserver')
evaluationDependsOn(':wpilibj')
apply from: "${rootDir}/shared/javacpp/setupBuild.gradle"
dependencies {
implementation project(':wpiutil')
implementation project(':ntcore')
implementation project(':cscore')
implementation project(':hal')
implementation project(':wpimath')
implementation project(':wpilibj')
devImplementation project(':wpiutil')
devImplementation project(':ntcore')
devImplementation project(':cscore')
devImplementation project(':hal')
devImplementation project(':wpimath')
devImplementation project(':wpilibj')
testImplementation 'com.google.guava:guava:19.0'
testImplementation 'org.mockito:mockito-core:2.27.0'
}
nativeUtils.exportsConfigs {
wpilibNewCommands {
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
}
}
model {
components {}
binaries {
all {
if (!it.buildable || !(it instanceof NativeBinarySpec)) {
return
}
lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
project(':hal').addHalDependency(it, 'shared')
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
if (it.component.name == "${nativeName}Dev") {
lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
project(':hal').addHalJniDependency(it)
}
if (it instanceof GoogleTestTestSuiteBinarySpec) {
nativeUtils.useRequiredLibrary(it, 'opencv_shared')
lib project: ':cscore', library: 'cscore', linkage: 'shared'
}
if ((it instanceof NativeExecutableBinarySpec || it instanceof GoogleTestTestSuiteBinarySpec) && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'netcomm_shared', 'chipobject_shared', 'visa_shared', 'ni_runtime_shared')
}
}
}
tasks {
def c = $.components
def found = false
def systemArch = getCurrentArch()
c.each {
if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") {
it.binaries.each {
if (!found) {
def arch = it.targetPlatform.name
if (arch == systemArch) {
def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib'
found = true
}
}
}
}
}
}
}
test {
testLogging {
outputs.upToDateWhen {false}
showStandardStreams = true
}
}
ext {
nativeName = 'wpilibNewCommands'
devMain = 'edu.wpi.first.wpilibj.commands.DevMain'
}
evaluationDependsOn(':ntcore')
evaluationDependsOn(':cscore')
evaluationDependsOn(':hal')
evaluationDependsOn(':wpimath')
evaluationDependsOn(':wpilibc')
evaluationDependsOn(':cameraserver')
evaluationDependsOn(':wpilibj')
apply from: "${rootDir}/shared/javacpp/setupBuild.gradle"
dependencies {
implementation project(':wpiutil')
implementation project(':ntcore')
implementation project(':cscore')
implementation project(':hal')
implementation project(':wpimath')
implementation project(':wpilibj')
devImplementation project(':wpiutil')
devImplementation project(':ntcore')
devImplementation project(':cscore')
devImplementation project(':hal')
devImplementation project(':wpimath')
devImplementation project(':wpilibj')
testImplementation 'com.google.guava:guava:19.0'
testImplementation 'org.mockito:mockito-core:2.27.0'
}
nativeUtils.exportsConfigs {
wpilibNewCommands {
x86ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
x64ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
}
}
model {
components {}
binaries {
all {
if (!it.buildable || !(it instanceof NativeBinarySpec)) {
return
}
lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
project(':hal').addHalDependency(it, 'shared')
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
if (it.component.name == "${nativeName}Dev") {
lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
project(':hal').addHalJniDependency(it)
}
if (it instanceof GoogleTestTestSuiteBinarySpec) {
nativeUtils.useRequiredLibrary(it, 'opencv_shared')
lib project: ':cscore', library: 'cscore', linkage: 'shared'
}
if ((it instanceof NativeExecutableBinarySpec || it instanceof GoogleTestTestSuiteBinarySpec) && it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(it, 'netcomm_shared', 'chipobject_shared', 'visa_shared', 'ni_runtime_shared')
}
}
}
tasks {
def c = $.components
def found = false
def systemArch = getCurrentArch()
c.each {
if (it in NativeExecutableSpec && it.name == "${nativeName}Dev") {
it.binaries.each {
if (!found) {
def arch = it.targetPlatform.name
if (arch == systemArch) {
def filePath = it.tasks.install.installDirectory.get().toString() + File.separatorChar + 'lib'
found = true
}
}
}
}
}
}
}
test {
testLogging {
outputs.upToDateWhen {false}
showStandardStreams = true
}
}

View File

@@ -30,14 +30,32 @@ dependencies {
nativeUtils.exportsConfigs {
wpilibOldCommands {
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x86ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
x64ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
}
}
@@ -55,8 +73,8 @@ model {
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
if (it.component.name == "${nativeName}Dev") {
lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
project(':hal').addHalJniDependency(it)
lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
project(':hal').addHalJniDependency(it)
}
if (it instanceof GoogleTestTestSuiteBinarySpec) {

View File

@@ -62,14 +62,32 @@ apply from: "${rootDir}/shared/googletest.gradle"
nativeUtils.exportsConfigs {
wpilibc {
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x86ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
x64ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
}
}
@@ -79,7 +97,10 @@ model {
sources {
cpp {
source {
srcDirs = ['src/main/native/cpp', "$buildDir/generated/cpp"]
srcDirs = [
'src/main/native/cpp',
"$buildDir/generated/cpp"
]
include '**/*.cpp'
}
exportedHeaders {

View File

@@ -17,22 +17,22 @@ ext.templatesMap = [:]
File examplesTree = file("$projectDir/src/main/cpp/examples")
examplesTree.list(new FilenameFilter() {
@Override
public boolean accept(File current, String name) {
return new File(current, name).isDirectory();
}
}).each {
examplesMap.put(it, [])
}
@Override
public boolean accept(File current, String name) {
return new File(current, name).isDirectory();
}
}).each {
examplesMap.put(it, [])
}
File templatesTree = file("$projectDir/src/main/cpp/templates")
templatesTree.list(new FilenameFilter() {
@Override
public boolean accept(File current, String name) {
return new File(current, name).isDirectory();
}
}).each {
templatesMap.put(it, [])
}
@Override
public boolean accept(File current, String name) {
return new File(current, name).isDirectory();
}
}).each {
templatesMap.put(it, [])
}
nativeUtils.platformConfigs.named(nativeUtils.wpi.platforms.roborio).configure {
cppCompiler.args.remove('-Wno-error=deprecated-declarations')

View File

@@ -12,14 +12,32 @@ apply from: "${rootDir}/shared/jni/setupBuild.gradle"
nativeUtils.exportsConfigs {
wpimath {
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x86ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
x64ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
}
}

View File

@@ -146,26 +146,44 @@ ext {
def examplesMap = [:];
file("$projectDir/examples").list(new FilenameFilter() {
@Override
public boolean accept(File current, String name) {
return new File(current, name).isDirectory();
}
}).each {
examplesMap.put(it, [])
}
@Override
public boolean accept(File current, String name) {
return new File(current, name).isDirectory();
}
}).each {
examplesMap.put(it, [])
}
apply from: "${rootDir}/shared/jni/setupBuild.gradle"
nativeUtils.exportsConfigs {
wpiutil {
x86ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x64ExcludeSymbols = ['_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
'_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
'_TI3?AVout_of_range', '_CT??_R0?AVbad_cast']
x86ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
x64ExcludeSymbols = [
'_CT??_R0?AV_System_error',
'_CT??_R0?AVexception',
'_CT??_R0?AVfailure',
'_CT??_R0?AVruntime_error',
'_CT??_R0?AVsystem_error',
'_CTA5?AVfailure',
'_TI5?AVfailure',
'_CT??_R0?AVout_of_range',
'_CTA3?AVout_of_range',
'_TI3?AVout_of_range',
'_CT??_R0?AVbad_cast'
]
}
}
@@ -210,7 +228,9 @@ model {
sources {
cpp {
source {
srcDirs = ['src/netconsoleServer/native/cpp']
srcDirs = [
'src/netconsoleServer/native/cpp'
]
includes = ['**/*.cpp']
}
}
@@ -227,7 +247,9 @@ model {
sources {
cpp {
source {
srcDirs = ['src/netconsoleTee/native/cpp']
srcDirs = [
'src/netconsoleTee/native/cpp'
]
includes = ['**/*.cpp']
}
}