Squashed 'third_party/allwpilib_2019/' content from commit bd05dfa1c

Change-Id: I2b1c2250cdb9b055133780c33593292098c375b7
git-subtree-dir: third_party/allwpilib_2019
git-subtree-split: bd05dfa1c7cca74c4fac451e7b9d6a37e7b53447
diff --git a/wpilibcIntegrationTests/build.gradle b/wpilibcIntegrationTests/build.gradle
new file mode 100644
index 0000000..0dea400
--- /dev/null
+++ b/wpilibcIntegrationTests/build.gradle
@@ -0,0 +1,106 @@
+import org.gradle.language.base.internal.ProjectLayout
+
+apply plugin: 'cpp'
+apply plugin: 'visual-studio'
+apply plugin: 'edu.wpi.first.NativeUtils'
+apply plugin: ExtraTasks
+
+apply from: '../shared/config.gradle'
+
+ext {
+    sharedCvConfigs = [wpilibcIntegrationTests: []]
+    staticCvConfigs = [:]
+    useJava = false
+    useCpp = true
+    staticGtestConfigs = [wpilibcIntegrationTests: []]
+}
+
+apply from: "${rootDir}/shared/opencv.gradle"
+
+apply from: "${rootDir}/shared/googletest.gradle"
+
+ext {
+    chipObjectComponents = ['wpilibcIntegrationTests']
+    netCommComponents = ['wpilibcIntegrationTests']
+    useNiJava = false
+}
+
+apply from: "${rootDir}/shared/nilibraries.gradle"
+
+model {
+    components {
+        wpilibcIntegrationTests(NativeExecutableSpec) {
+            targetBuildTypes 'debug'
+            baseName = 'FRCUserProgram'
+            binaries.all { binary ->
+                if (binary.targetPlatform.architecture.name == 'athena') {
+                    binary.sources {
+                        athenaCpp(CppSourceSet) {
+                            source {
+                                srcDirs = ['src/main/native/cpp']
+                                includes = ['**/*.cpp']
+                            }
+                            exportedHeaders {
+                                srcDirs = ['src/main/native/include']
+                                includes = ['**/*.h']
+                            }
+                        }
+                    }
+                    binary.tasks.withType(CppCompile) {
+                        cppCompiler.args "-Wno-missing-field-initializers"
+                        cppCompiler.args "-Wno-unused-variable"
+                        cppCompiler.args "-Wno-error=deprecated-declarations"
+                    }
+                    lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
+                    lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
+                    lib project: ':cscore', library: 'cscore', linkage: 'shared'
+                    lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
+                    lib project: ':cscore', library: 'cscoreJNIShared', linkage: 'shared'
+                    project(':hal').addHalDependency(binary, 'shared')
+                    project(':hal').addHalJniDependency(binary)
+                    lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
+                    lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
+                } else {
+                    binary.sources {
+                        simCpp(CppSourceSet) {
+                            source {
+                                srcDirs 'src/main/native/dt'
+                                includes = ['**/*.cpp']
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+def testOutputFolder = file("${project(':').buildDir}/integrationTestFiles")
+
+model {
+    tasks {
+        copyWpilibCTestLibrariesToOutput(Copy) {
+            def task = it
+            $.binaries.each {
+                if (it in NativeExecutableBinarySpec && it.targetPlatform.architecture.name == 'athena') {
+                    def installTask = it.tasks.install
+                    task.dependsOn installTask
+                    task.from(installTask.executableFile) {
+                        into '/cpp'
+                    }
+                    installTask.libs.each {
+                        task.from(it) {
+                            into '/libs'
+                        }
+                    }
+                }
+            }
+            destinationDir testOutputFolder
+        }
+        // This is in a separate if statement because of what I would assume is a bug in grade.
+        // Will file an issue on their side.
+        if (!project.hasProperty('skipAthena')) {
+            build.dependsOn copyWpilibCTestLibrariesToOutput
+        }
+    }
+}