-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0015d3
commit 6655b12
Showing
7 changed files
with
193 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
vscode-wpilib/resources/gradle/cppxrp/.vscode/settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "disabled", | ||
"java.import.gradle.enabled": false, | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"bin/": true, | ||
"**/.classpath": true, | ||
"**/.project": true, | ||
"**/.settings": true, | ||
"**/.factorypath": true, | ||
"**/*~": true | ||
}, | ||
"C_Cpp.default.configurationProvider": "vscode-wpilib", | ||
"wpilib.skipSelectSimulateExtension": true | ||
} |
6 changes: 6 additions & 0 deletions
6
vscode-wpilib/resources/gradle/cppxrp/.wpilib/wpilib_preferences.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"enableCppIntellisense": true, | ||
"currentLanguage": "cpp", | ||
"projectYear": "2023", | ||
"teamNumber": -1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
plugins { | ||
id "cpp" | ||
id "google-test-test-suite" | ||
id "edu.wpi.first.GradleRIO" version "###GRADLERIOREPLACE###" | ||
} | ||
|
||
// Simulation configuration (e.g. environment variables). | ||
wpi.sim.addGui().defaultEnabled = true | ||
wpi.sim.addDriverstation() | ||
|
||
//Sets the websocket client remote host. | ||
wpi.sim.envVar("HALSIMWS_HOST", "192.168.42.1") | ||
wpi.sim.envVar("HALSIMWS_FILTERS", "AIO,DIO,DriverStation,Encoder,Gyro,XRPMotor,XRPServo") | ||
wpi.sim.addWebsocketsServer().defaultEnabled = true | ||
wpi.sim.addWebsocketsClient().defaultEnabled = true | ||
|
||
model { | ||
components { | ||
frcUserProgram(NativeExecutableSpec) { | ||
targetPlatform wpi.platforms.desktop | ||
|
||
sources.cpp { | ||
source { | ||
srcDir 'src/main/cpp' | ||
include '**/*.cpp', '**/*.cc' | ||
} | ||
exportedHeaders { | ||
srcDir 'src/main/include' | ||
} | ||
} | ||
|
||
wpi.cpp.enableExternalTasks(it) | ||
|
||
wpi.sim.enable(it) | ||
|
||
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. | ||
wpi.cpp.vendor.cpp(it) | ||
wpi.cpp.deps.wpilib(it) | ||
} | ||
} | ||
testSuites { | ||
frcUserProgramTest(GoogleTestTestSuiteSpec) { | ||
testing $.components.frcUserProgram | ||
|
||
sources.cpp { | ||
source { | ||
srcDir 'src/test/cpp' | ||
include '**/*.cpp' | ||
} | ||
} | ||
|
||
wpi.cpp.enableExternalTasks(it) | ||
|
||
wpi.cpp.vendor.cpp(it) | ||
wpi.cpp.deps.wpilib(it) | ||
wpi.cpp.deps.googleTest(it) | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
vscode-wpilib/resources/gradle/cppxrp/src/test/cpp/main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#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; | ||
} |
30 changes: 30 additions & 0 deletions
30
vscode-wpilib/resources/gradle/javaxrp/.vscode/settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "automatic", | ||
"java.server.launchMode": "Standard", | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"bin/": true, | ||
"**/.classpath": true, | ||
"**/.project": true, | ||
"**/.settings": true, | ||
"**/.factorypath": true, | ||
"**/*~": true | ||
}, | ||
"wpilib.skipSelectSimulateExtension": true, | ||
"java.test.config": [ | ||
{ | ||
"name": "WPIlibUnitTests", | ||
"workingDirectory": "${workspaceFolder}/build/jni/release", | ||
"vmargs": [ "-Djava.library.path=${workspaceFolder}/build/jni/release" ], | ||
"env": { | ||
"LD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release" , | ||
"DYLD_LIBRARY_PATH": "${workspaceFolder}/build/jni/release" | ||
} | ||
}, | ||
], | ||
"java.test.defaultConfig": "WPIlibUnitTests" | ||
} |
6 changes: 6 additions & 0 deletions
6
vscode-wpilib/resources/gradle/javaxrp/.wpilib/wpilib_preferences.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"enableCppIntellisense": false, | ||
"currentLanguage": "java", | ||
"projectYear": "2023", | ||
"teamNumber": -1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
plugins { | ||
id "java" | ||
id "edu.wpi.first.GradleRIO" version "###GRADLERIOREPLACE###" | ||
} | ||
|
||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
|
||
def ROBOT_MAIN_CLASS = "###ROBOTCLASSREPLACE###" | ||
|
||
// Set this to true to enable desktop support. | ||
def includeDesktopSupport = true | ||
|
||
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. | ||
// Also defines JUnit 5. | ||
dependencies { | ||
implementation wpi.java.deps.wpilib() | ||
implementation wpi.java.vendor.java() | ||
|
||
nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) | ||
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) | ||
simulationDebug wpi.sim.enableDebug() | ||
|
||
nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop) | ||
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) | ||
simulationRelease wpi.sim.enableRelease() | ||
|
||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' | ||
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true' | ||
} | ||
|
||
// Simulation configuration (e.g. environment variables). | ||
wpi.sim.addGui().defaultEnabled = true | ||
wpi.sim.addDriverstation() | ||
|
||
//Sets the websocket client remote host. | ||
wpi.sim.envVar("HALSIMWS_HOST", "192.168.42.1") | ||
wpi.sim.envVar("HALSIMWS_FILTERS", "AIO,DIO,DriverStation,Encoder,Gyro,XRPMotor,XRPServo") | ||
wpi.sim.addWebsocketsServer().defaultEnabled = true | ||
wpi.sim.addWebsocketsClient().defaultEnabled = true | ||
|
||
// Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar') | ||
// in order to make them all available at runtime. Also adding the manifest so WPILib | ||
// knows where to look for our Robot Class. | ||
jar { | ||
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } | ||
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) | ||
duplicatesStrategy = DuplicatesStrategy.INCLUDE | ||
} | ||
|
||
wpi.java.configureExecutableTasks(jar) | ||
wpi.java.configureTestTasks(test) | ||
|
||
// Configure string concat to always inline compile | ||
tasks.withType(JavaCompile) { | ||
options.compilerArgs.add '-XDstringConcat=inline' | ||
} |