Skip to content

Commit 6cd43a8

Browse files
committed
Initial commit
0 parents  commit 6cd43a8

24 files changed

+1226
-0
lines changed

.gitignore

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# Created by https://www.gitignore.io/api/c++,java,linux,macos,gradle,windows,visualstudiocode
2+
3+
### C++ ###
4+
# Prerequisites
5+
*.d
6+
7+
# Compiled Object files
8+
*.slo
9+
*.lo
10+
*.o
11+
*.obj
12+
13+
# Precompiled Headers
14+
*.gch
15+
*.pch
16+
17+
# Compiled Dynamic libraries
18+
*.so
19+
*.dylib
20+
*.dll
21+
22+
# Fortran module files
23+
*.mod
24+
*.smod
25+
26+
# Compiled Static libraries
27+
*.lai
28+
*.la
29+
*.a
30+
*.lib
31+
32+
# Executables
33+
*.exe
34+
*.out
35+
*.app
36+
37+
### Java ###
38+
# Compiled class file
39+
*.class
40+
41+
# Log file
42+
*.log
43+
44+
# BlueJ files
45+
*.ctxt
46+
47+
# Mobile Tools for Java (J2ME)
48+
.mtj.tmp/
49+
50+
# Package Files #
51+
*.jar
52+
*.war
53+
*.nar
54+
*.ear
55+
*.zip
56+
*.tar.gz
57+
*.rar
58+
59+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
60+
hs_err_pid*
61+
62+
### Linux ###
63+
*~
64+
65+
# temporary files which can be created if a process still has a handle open of a deleted file
66+
.fuse_hidden*
67+
68+
# KDE directory preferences
69+
.directory
70+
71+
# Linux trash folder which might appear on any partition or disk
72+
.Trash-*
73+
74+
# .nfs files are created when an open file is removed but is still being accessed
75+
.nfs*
76+
77+
### macOS ###
78+
# General
79+
.DS_Store
80+
.AppleDouble
81+
.LSOverride
82+
83+
# Icon must end with two \r
84+
Icon
85+
86+
# Thumbnails
87+
._*
88+
89+
# Files that might appear in the root of a volume
90+
.DocumentRevisions-V100
91+
.fseventsd
92+
.Spotlight-V100
93+
.TemporaryItems
94+
.Trashes
95+
.VolumeIcon.icns
96+
.com.apple.timemachine.donotpresent
97+
98+
# Directories potentially created on remote AFP share
99+
.AppleDB
100+
.AppleDesktop
101+
Network Trash Folder
102+
Temporary Items
103+
.apdisk
104+
105+
### VisualStudioCode ###
106+
.vscode/*
107+
!.vscode/settings.json
108+
!.vscode/tasks.json
109+
!.vscode/launch.json
110+
!.vscode/extensions.json
111+
112+
### Windows ###
113+
# Windows thumbnail cache files
114+
Thumbs.db
115+
ehthumbs.db
116+
ehthumbs_vista.db
117+
118+
# Dump file
119+
*.stackdump
120+
121+
# Folder config file
122+
[Dd]esktop.ini
123+
124+
# Recycle Bin used on file shares
125+
$RECYCLE.BIN/
126+
127+
# Windows Installer files
128+
*.cab
129+
*.msi
130+
*.msix
131+
*.msm
132+
*.msp
133+
134+
# Windows shortcuts
135+
*.lnk
136+
137+
### Gradle ###
138+
.gradle
139+
/build/
140+
141+
# Ignore Gradle GUI config
142+
gradle-app.setting
143+
144+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
145+
!gradle-wrapper.jar
146+
147+
# Cache of project
148+
.gradletasknamecache
149+
150+
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
151+
# gradle/wrapper/gradle-wrapper.properties
152+
153+
# # VS Code Specific Java Settings
154+
.classpath
155+
.project
156+
.settings/
157+
bin/
158+
imgui.ini
159+
160+
161+
# End of https://www.gitignore.io/api/c++,java,linux,macos,gradle,windows,visualstudiocode

.vscode/launch.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"type": "wpilib",
10+
"name": "WPILib Desktop Debug",
11+
"request": "launch",
12+
"desktop": true,
13+
},
14+
{
15+
"type": "wpilib",
16+
"name": "WPILib roboRIO Debug",
17+
"request": "launch",
18+
"desktop": false,
19+
}
20+
]
21+
}

.vscode/settings.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "disabled",
3+
"java.import.gradle.enabled": false,
4+
"files.exclude": {
5+
"**/.git": true,
6+
"**/.svn": true,
7+
"**/.hg": true,
8+
"**/CVS": true,
9+
"**/.DS_Store": true,
10+
"bin/": true,
11+
"**/.classpath": true,
12+
"**/.project": true,
13+
"**/.settings": true,
14+
"**/.factorypath": true,
15+
"**/*~": true
16+
},
17+
"C_Cpp.default.configurationProvider": "vscode-wpilib"
18+
}

.wpilib/wpilib_preferences.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"enableCppIntellisense": true,
3+
"currentLanguage": "cpp",
4+
"projectYear": "2021",
5+
"teamNumber": 102
6+
}

WPILib-License.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Copyright (c) 2009-2021 FIRST and other WPILib contributors
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
* Neither the name of FIRST, WPILib, nor the names of other WPILib
12+
contributors may be used to endorse or promote products derived from
13+
this software without specific prior written permission.
14+
15+
THIS SOFTWARE IS PROVIDED BY FIRST AND OTHER WPILIB CONTRIBUTORS "AS IS" AND
16+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17+
WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
18+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR
19+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

build.gradle

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
plugins {
2+
id "cpp"
3+
id "google-test-test-suite"
4+
id "edu.wpi.first.GradleRIO" version "2021.3.1"
5+
}
6+
7+
// Define my targets (RoboRIO) and artifacts (deployable files)
8+
// This is added by GradleRIO's backing project EmbeddedTools.
9+
deploy {
10+
targets {
11+
roboRIO("roborio") {
12+
// Team number is loaded either from the .wpilib/wpilib_preferences.json
13+
// or from command line. If not found an exception will be thrown.
14+
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
15+
// want to store a team number in this file.
16+
team = frc.getTeamNumber()
17+
}
18+
}
19+
artifacts {
20+
frcNativeArtifact('frcCpp') {
21+
targets << "roborio"
22+
component = 'frcUserProgram'
23+
// Debug can be overridden by command line, for use with VSCode
24+
debug = frc.getDebugOrDefault(false)
25+
}
26+
// Built in artifact to deploy arbitrary files to the roboRIO.
27+
fileTreeArtifact('frcStaticFileDeploy') {
28+
// The directory below is the local directory to deploy
29+
files = fileTree(dir: 'src/main/deploy')
30+
// Deploy to RoboRIO target, into /home/lvuser/deploy
31+
targets << "roborio"
32+
directory = '/home/lvuser/deploy'
33+
}
34+
}
35+
}
36+
37+
// Set this to true to include the src folder in the include directories passed
38+
// to the compiler. Some eclipse project imports depend on this behavior.
39+
// We recommend leaving this disabled if possible. Note for eclipse project
40+
// imports this is enabled by default. For new projects, its disabled
41+
def includeSrcInIncludeRoot = false
42+
43+
// Set this to true to enable desktop support.
44+
def includeDesktopSupport = false
45+
46+
// Enable simulation gui support. Must check the box in vscode to enable support
47+
// upon debugging
48+
dependencies {
49+
simulation wpi.deps.sim.gui(wpi.platforms.desktop, true)
50+
simulation wpi.deps.sim.driverstation(wpi.platforms.desktop, true)
51+
52+
// Websocket extensions require additional configuration.
53+
// simulation wpi.deps.sim.ws_server(wpi.platforms.desktop, true)
54+
// simulation wpi.deps.sim.ws_client(wpi.platforms.desktop, true)
55+
}
56+
57+
// Simulation configuration (e.g. environment variables).
58+
sim {
59+
// Sets the websocket client remote host.
60+
// envVar "HALSIMWS_HOST", "10.0.0.2"
61+
}
62+
63+
model {
64+
components {
65+
frcUserProgram(NativeExecutableSpec) {
66+
targetPlatform wpi.platforms.roborio
67+
if (includeDesktopSupport) {
68+
targetPlatform wpi.platforms.desktop
69+
}
70+
71+
sources.cpp {
72+
source {
73+
srcDir 'src/main/cpp'
74+
include '**/*.cpp', '**/*.cc'
75+
}
76+
exportedHeaders {
77+
srcDir 'src/main/include'
78+
if (includeSrcInIncludeRoot) {
79+
srcDir 'src/main/cpp'
80+
}
81+
}
82+
}
83+
84+
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
85+
wpi.deps.vendor.cpp(it)
86+
wpi.deps.wpilib(it)
87+
}
88+
}
89+
testSuites {
90+
frcUserProgramTest(GoogleTestTestSuiteSpec) {
91+
testing $.components.frcUserProgram
92+
93+
sources.cpp {
94+
source {
95+
srcDir 'src/test/cpp'
96+
include '**/*.cpp'
97+
}
98+
}
99+
100+
wpi.deps.vendor.cpp(it)
101+
wpi.deps.wpilib(it)
102+
wpi.deps.googleTest(it)
103+
}
104+
}
105+
}

gradle/wrapper/gradle-wrapper.jar

57.3 KB
Binary file not shown.
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=permwrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=permwrapper/dists

0 commit comments

Comments
 (0)