Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Project Code/Lesson 1/ExampleProject/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Created by https://www.gitignore.io/api/c++,java,linux,macos,gradle,windows,visualstudiocode
# This gitignore has been specially created by the WPILib team.
# If you remove items from this file, intellisense might break.

### C++ ###
# Prerequisites
Expand Down Expand Up @@ -151,11 +152,11 @@ gradle-app.setting
# gradle/wrapper/gradle-wrapper.properties

# # VS Code Specific Java Settings
# DO NOT REMOVE .classpath and .project
.classpath
.project
.settings/
bin/
imgui.ini


# End of https://www.gitignore.io/api/c++,java,linux,macos,gradle,windows,visualstudiocode
# Simulation GUI and other tools window save file
*-window.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"enableCppIntellisense": false,
"currentLanguage": "java",
"projectYear": "2021",
"projectYear": "2022",
"teamNumber": 0
}
41 changes: 22 additions & 19 deletions Project Code/Lesson 1/ExampleProject/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2021.3.1"
id "edu.wpi.first.GradleRIO" version "2022.4.1"
}

sourceCompatibility = JavaVersion.VERSION_11
Expand All @@ -14,34 +14,37 @@ def includeDesktopSupport = true
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 4.
dependencies {
implementation wpi.deps.wpilib()
nativeDesktopZip wpi.deps.wpilibJni(wpi.platforms.desktop)
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()

implementation wpi.deps.vendor.java()
nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop)
nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop)
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
simulationRelease wpi.sim.enableRelease()

testImplementation 'junit:junit:4.12'

// Enable simulation gui support. Must check the box in vscode to enable support
// upon debugging
simulation wpi.deps.sim.gui(wpi.platforms.desktop, false)
simulation wpi.deps.sim.driverstation(wpi.platforms.desktop, false)

// Websocket extensions require additional configuration.
// simulation wpi.deps.sim.ws_server(wpi.platforms.desktop, false)
simulation wpi.deps.sim.ws_client(wpi.platforms.desktop, false)
testImplementation 'junit:junit:4.13.1'
}

// Set the websocket remote host (the Romi IP address).
sim {
envVar "HALSIMWS_HOST", "10.0.0.2"
}
// 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", "10.0.0.2")
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)
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=permwrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=permwrapper/dists
Loading