Change files with CRLF line endings to LF (#2022)

This commit is contained in:
Tyler Veness
2019-11-01 20:26:05 -07:00
committed by Peter Johnson
parent 6f159d1426
commit 0b3821eba3
3 changed files with 152 additions and 152 deletions

View File

@@ -1,95 +1,95 @@
plugins {
id 'cpp'
id 'java'
id 'com.google.protobuf' version '0.8.8'
id 'edu.wpi.first.NativeUtils'
}
description = "A C++ and Java library to pass FRC Simulation Messages in and out of Gazebo."
/* The simulation does not run on real hardware; so we always skip Athena */
ext.skiplinuxathena = true
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 */
def protobuf_version = ""
try {
protobuf_version = "pkg-config --modversion protobuf".execute().text.trim()
println "Protobuf version is [${protobuf_version}]"
} catch(Exception ex) {
}
if (!protobuf_version?.trim()) {
println "Protobuf is not available. (pkg-config --modversion protobuf failed)"
protobuf_version = "+"
if (project.hasProperty("makeSim")) {
/* Force the build even though we did not find protobuf. */
println "makeSim set. Forcing build - failure likely."
}
else {
ext.skip_gz_msgs = true
println "Skipping gz_msgs."
}
}
tasks.whenTaskAdded { task ->
task.onlyIf { !project.hasProperty('skip_gz_msgs') }
}
dependencies {
compile "com.google.protobuf:protobuf-java:${protobuf_version}"
compile "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 */
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protobuf_version}"
}
generatedFilesBaseDir = "$buildDir/generated"
generateProtoTasks {
all().each { task ->
task.builtins {
cpp {
outputSubDir = 'simulation/gz_msgs'
}
}
}
}
}
model {
components {
gz_msgs(NativeLibrarySpec) {
sources {
cpp {
source {
srcDir "$buildDir/generated/main/simulation/gz_msgs"
builtBy tasks.generateProto
}
exportedHeaders {
srcDir "src/include"
srcDir "$buildDir/generated/main"
}
}
}
/* We must compile with -fPIC to link the static library into an so */
binaries {
all {
cppCompiler.args "-fPIC"
}
}
}
}
}
plugins {
id 'cpp'
id 'java'
id 'com.google.protobuf' version '0.8.8'
id 'edu.wpi.first.NativeUtils'
}
description = "A C++ and Java library to pass FRC Simulation Messages in and out of Gazebo."
/* The simulation does not run on real hardware; so we always skip Athena */
ext.skiplinuxathena = true
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 */
def protobuf_version = ""
try {
protobuf_version = "pkg-config --modversion protobuf".execute().text.trim()
println "Protobuf version is [${protobuf_version}]"
} catch(Exception ex) {
}
if (!protobuf_version?.trim()) {
println "Protobuf is not available. (pkg-config --modversion protobuf failed)"
protobuf_version = "+"
if (project.hasProperty("makeSim")) {
/* Force the build even though we did not find protobuf. */
println "makeSim set. Forcing build - failure likely."
}
else {
ext.skip_gz_msgs = true
println "Skipping gz_msgs."
}
}
tasks.whenTaskAdded { task ->
task.onlyIf { !project.hasProperty('skip_gz_msgs') }
}
dependencies {
compile "com.google.protobuf:protobuf-java:${protobuf_version}"
compile "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 */
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protobuf_version}"
}
generatedFilesBaseDir = "$buildDir/generated"
generateProtoTasks {
all().each { task ->
task.builtins {
cpp {
outputSubDir = 'simulation/gz_msgs'
}
}
}
}
}
model {
components {
gz_msgs(NativeLibrarySpec) {
sources {
cpp {
source {
srcDir "$buildDir/generated/main/simulation/gz_msgs"
builtBy tasks.generateProto
}
exportedHeaders {
srcDir "src/include"
srcDir "$buildDir/generated/main"
}
}
}
/* We must compile with -fPIC to link the static library into an so */
binaries {
all {
cppCompiler.args "-fPIC"
}
}
}
}
}

View File

@@ -1,40 +1,40 @@
if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxraspbian') && !project.hasProperty('onlylinuxaarch64bionic')) {
description = "A plugin that creates a simulation gui"
ext {
includeWpiutil = true
pluginName = 'halsim_gui'
}
apply plugin: 'google-test-test-suite'
ext {
staticGtestConfigs = [:]
}
staticGtestConfigs["${pluginName}Test"] = []
apply from: "${rootDir}/shared/googletest.gradle"
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
model {
binaries {
all {
nativeUtils.useRequiredLibrary(it, 'imgui_static')
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.raspbian || it.targetPlatform.name == nativeUtils.wpi.platforms.aarch64bionic) {
it.buildable = false
return
}
if (it.targetPlatform.operatingSystem.isWindows()) {
it.linker.args << 'Gdi32.lib' << 'Shell32.lib'
} else if (it.targetPlatform.operatingSystem.isMacOsX()) {
it.linker.args << '-framework' << 'Cocoa' << '-framework' << 'IOKit' << '-framework' << 'CoreFoundation' << '-framework' << 'CoreVideo'
} else {
it.linker.args << '-lX11' << '-lvulkan'
}
}
}
}
}
if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxraspbian') && !project.hasProperty('onlylinuxaarch64bionic')) {
description = "A plugin that creates a simulation gui"
ext {
includeWpiutil = true
pluginName = 'halsim_gui'
}
apply plugin: 'google-test-test-suite'
ext {
staticGtestConfigs = [:]
}
staticGtestConfigs["${pluginName}Test"] = []
apply from: "${rootDir}/shared/googletest.gradle"
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
model {
binaries {
all {
nativeUtils.useRequiredLibrary(it, 'imgui_static')
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.raspbian || it.targetPlatform.name == nativeUtils.wpi.platforms.aarch64bionic) {
it.buildable = false
return
}
if (it.targetPlatform.operatingSystem.isWindows()) {
it.linker.args << 'Gdi32.lib' << 'Shell32.lib'
} else if (it.targetPlatform.operatingSystem.isMacOsX()) {
it.linker.args << '-framework' << 'Cocoa' << '-framework' << 'IOKit' << '-framework' << 'CoreFoundation' << '-framework' << 'CoreVideo'
} else {
it.linker.args << '-lX11' << '-lvulkan'
}
}
}
}
}

View File

@@ -1,17 +1,17 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#include <hal/HAL.h>
#include "gtest/gtest.h"
int main(int argc, char** argv) {
HAL_Initialize(500, 0);
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;
}
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#include <hal/HAL.h>
#include "gtest/gtest.h"
int main(int argc, char** argv) {
HAL_Initialize(500, 0);
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;
}