Skip to content

Commit 9c438ca

Browse files
authored
Update gradlerio projects for FIRST rename (#852)
This way it works correctly with new gradlerio
1 parent 8b8d438 commit 9c438ca

13 files changed

Lines changed: 59 additions & 50 deletions

File tree

vscode-wpilib/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Features
44

5-
This extension provides the WPILib support for FRC teams in VS Code. For documentation on how to program FRC robots using the WPILib libraries, see the [WPILib documentation website](https://docs.wpilib.org/en/stable/).
5+
This extension provides the WPILib support for FIRST teams in VS Code. For documentation on how to program FIRST robots using the WPILib libraries, see the [WPILib documentation website](https://docs.wpilib.org/en/stable/).
66

77
## Requirements
88

vscode-wpilib/package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"wpilibcore.importGradle2025Project.title": "Import a WPILib 2025 Gradle project",
1919
"wpilibcore.createNewProject.title": "Create a new project",
2020
"wpilibcore.manageVendorLibs.title": "Manage Vendor Libraries",
21-
"wpilibcore.setJavaHome.title": "Set VS Code Java Home to FRC Home",
21+
"wpilibcore.setJavaHome.title": "Set VS Code Java Home to WPILib Home",
2222
"wpilibcore.checkForUpdates.title": "Check for WPILib Updates",
2323
"wpilibcore.installGradleTools.title": "Install tools from GradleRIO",
2424
"wpilibcore.showLogFolder.title": "Show Log Folder",

vscode-wpilib/resources/gradle/c/build.gradle

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,21 @@ deploy {
1414
// or from command line. If not found an exception will be thrown.
1515
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
1616
// want to store a team number in this file.
17-
team = project.frc.getTeamNumber()
18-
debug = project.frc.getDebugOrDefault(false)
17+
team = project.wpilib.getTeamNumber()
18+
// Use the default systemcore host name. This must be called after setting team
19+
// as happens on the line above
20+
useDefaultSystemcoreHostName()
21+
debug = project.wpilib.getDebugOrDefault(false)
1922

2023
artifacts {
2124
// First part is artifact name, 2nd is artifact type
2225
// getTargetTypeClass is a shortcut to get the class type using a string
2326

24-
frcCpp(getArtifactTypeClass('FRCNativeArtifact')) {
27+
wpilibCpp(getArtifactTypeClass('WPILibNativeArtifact')) {
2528
}
2629

2730
// Static files artifact
28-
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
31+
wpilibStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
2932
files = project.fileTree('src/main/deploy')
3033
directory = '/home/systemcore/deploy'
3134
deleteOldFiles = false // Change to true to delete files on SystemCore that no
@@ -36,7 +39,7 @@ deploy {
3639
}
3740
}
3841

39-
def deployArtifact = deploy.targets.systemcore.artifacts.frcCpp
42+
def deployArtifact = deploy.targets.systemcore.artifacts.wpilibCpp
4043

4144
// Set this to true to enable desktop support.
4245
def includeDesktopSupport = false
@@ -51,7 +54,7 @@ wpi.sim.addDriverstation()
5154

5255
model {
5356
components {
54-
frcUserProgram(NativeExecutableSpec) {
57+
wpilibUserProgram(NativeExecutableSpec) {
5558
targetPlatform wpi.platforms.systemcore
5659
if (includeDesktopSupport) {
5760
targetPlatform wpi.platforms.desktop
@@ -91,8 +94,8 @@ model {
9194
}
9295
}
9396
testSuites {
94-
frcUserProgramTest(GoogleTestTestSuiteSpec) {
95-
testing $.components.frcUserProgram
97+
wpilibUserProgramTest(GoogleTestTestSuiteSpec) {
98+
testing $.components.wpilibUserProgram
9699

97100
sources.cpp {
98101
source {

vscode-wpilib/resources/gradle/cpp/build.gradle

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,21 @@ deploy {
1313
// or from command line. If not found an exception will be thrown.
1414
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
1515
// want to store a team number in this file.
16-
team = project.frc.getTeamNumber()
17-
debug = project.frc.getDebugOrDefault(false)
16+
team = project.wpilib.getTeamNumber()
17+
// Use the default systemcore host name. This must be called after setting team
18+
// as happens on the line above
19+
useDefaultSystemcoreHostName()
20+
debug = project.wpilib.getDebugOrDefault(false)
1821

1922
artifacts {
2023
// First part is artifact name, 2nd is artifact type
2124
// getTargetTypeClass is a shortcut to get the class type using a string
2225

23-
frcCpp(getArtifactTypeClass('FRCNativeArtifact')) {
26+
wpilibCpp(getArtifactTypeClass('WPILibNativeArtifact')) {
2427
}
2528

2629
// Static files artifact
27-
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
30+
wpilibStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
2831
files = project.fileTree('src/main/deploy')
2932
directory = '/home/systemcore/deploy'
3033
deleteOldFiles = false // Change to true to delete files on SystemCore that no
@@ -35,7 +38,7 @@ deploy {
3538
}
3639
}
3740

38-
def deployArtifact = deploy.targets.systemcore.artifacts.frcCpp
41+
def deployArtifact = deploy.targets.systemcore.artifacts.wpilibCpp
3942

4043
// Set this to true to enable desktop support.
4144
def includeDesktopSupport = false
@@ -50,7 +53,7 @@ wpi.sim.addDriverstation()
5053

5154
model {
5255
components {
53-
frcUserProgram(NativeExecutableSpec) {
56+
wpilibUserProgram(NativeExecutableSpec) {
5457
targetPlatform wpi.platforms.systemcore
5558
if (includeDesktopSupport) {
5659
targetPlatform wpi.platforms.desktop
@@ -80,8 +83,8 @@ model {
8083
}
8184
}
8285
testSuites {
83-
frcUserProgramTest(GoogleTestTestSuiteSpec) {
84-
testing $.components.frcUserProgram
86+
wpilibUserProgramTest(GoogleTestTestSuiteSpec) {
87+
testing $.components.wpilibUserProgram
8588

8689
sources.cpp {
8790
source {

vscode-wpilib/resources/gradle/cppromi/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ wpi.sim.addWebsocketsClient().defaultEnabled = true
1515

1616
model {
1717
components {
18-
frcUserProgram(NativeExecutableSpec) {
18+
wpilibUserProgram(NativeExecutableSpec) {
1919
targetPlatform wpi.platforms.desktop
2020

2121
sources.cpp {
@@ -38,8 +38,8 @@ model {
3838
}
3939
}
4040
testSuites {
41-
frcUserProgramTest(GoogleTestTestSuiteSpec) {
42-
testing $.components.frcUserProgram
41+
wpilibUserProgramTest(GoogleTestTestSuiteSpec) {
42+
testing $.components.wpilibUserProgram
4343

4444
sources.cpp {
4545
source {

vscode-wpilib/resources/gradle/cppxrp/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ wpi.sim.addXRPClient().defaultEnabled = true
1414

1515
model {
1616
components {
17-
frcUserProgram(NativeExecutableSpec) {
17+
wpilibUserProgram(NativeExecutableSpec) {
1818
targetPlatform wpi.platforms.desktop
1919

2020
sources.cpp {
@@ -37,8 +37,8 @@ model {
3737
}
3838
}
3939
testSuites {
40-
frcUserProgramTest(GoogleTestTestSuiteSpec) {
41-
testing $.components.frcUserProgram
40+
wpilibUserProgramTest(GoogleTestTestSuiteSpec) {
41+
testing $.components.wpilibUserProgram
4242

4343
sources.cpp {
4444
source {

vscode-wpilib/resources/gradle/java/build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,21 @@ deploy {
2020
// or from command line. If not found an exception will be thrown.
2121
// You can use getTeamOrDefault(team) instead of getTeamNumber if you
2222
// want to store a team number in this file.
23-
team = project.frc.getTeamNumber()
24-
debug = project.frc.getDebugOrDefault(false)
23+
team = project.wpilib.getTeamNumber()
24+
// Use the default systemcore host name. This must be called after setting team
25+
// as happens on the line above
26+
useDefaultSystemcoreHostName()
27+
debug = project.wpilib.getDebugOrDefault(false)
2528

2629
artifacts {
2730
// First part is artifact name, 2nd is artifact type
2831
// getTargetTypeClass is a shortcut to get the class type using a string
2932

30-
frcJava(getArtifactTypeClass('FRCJavaArtifact')) {
33+
wpilibJava(getArtifactTypeClass('WPILibJavaArtifact')) {
3134
}
3235

3336
// Static files artifact
34-
frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
37+
wpilibStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) {
3538
files = project.fileTree('src/main/deploy')
3639
directory = '/home/systemcore/deploy'
3740
deleteOldFiles = false // Change to true to delete files on systemcore that no
@@ -42,7 +45,7 @@ deploy {
4245
}
4346
}
4447

45-
def deployArtifact = deploy.targets.systemcore.artifacts.frcJava
48+
def deployArtifact = deploy.targets.systemcore.artifacts.wpilibJava
4649

4750
// Set to true to use debug for all targets including JNI, which will drastically impact
4851
// performance.

vscode-wpilib/resources/gradle/shared/settings.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ pluginManagement {
44
repositories {
55
mavenLocal()
66
gradlePluginPortal()
7-
String frcYear = '2027_alpha4'
8-
File frcHome
7+
String wpilibYear = '2027_alpha4'
8+
File wpilibHome
99
if (OperatingSystem.current().isWindows()) {
1010
String publicFolder = System.getenv('PUBLIC')
1111
if (publicFolder == null) {
1212
publicFolder = "C:\\Users\\Public"
1313
}
1414
def homeRoot = new File(publicFolder, "wpilib")
15-
frcHome = new File(homeRoot, frcYear)
15+
wpilibHome = new File(homeRoot, wpilibYear)
1616
} else {
1717
def userFolder = System.getProperty("user.home")
1818
def homeRoot = new File(userFolder, "wpilib")
19-
frcHome = new File(homeRoot, frcYear)
19+
wpilibHome = new File(homeRoot, wpilibYear)
2020
}
21-
def frcHomeMaven = new File(frcHome, 'maven')
21+
def wpilibHomeMaven = new File(wpilibHome, 'maven')
2222
maven {
23-
name = 'frcHome'
24-
url = frcHomeMaven
23+
name = 'wpilibHome'
24+
url = wpilibHomeMaven
2525
}
2626
}
2727
}

vscode-wpilib/src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export interface IPreferencesAPI {
9494
}
9595

9696
export interface IUtilitiesAPI {
97-
getFrcYear(): string;
97+
getWPILibYear(): string;
9898
getWPILibHomeDir(): string;
9999
}
100100

vscode-wpilib/src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,9 @@ export async function activate(context: vscode.ExtensionContext) {
457457
// That file can be copied to another project.
458458
const externalApi = await ExternalAPI.Create(extensionResourceLocation);
459459

460-
const frcHomeDir = externalApi.getUtilitiesAPI().getWPILibHomeDir();
460+
const wpilibHomeDir = externalApi.getUtilitiesAPI().getWPILibHomeDir();
461461

462-
const logPath = path.join(frcHomeDir, 'logs');
462+
const logPath = path.join(wpilibHomeDir, 'logs');
463463
try {
464464
await mkdir(logPath, { recursive: true });
465465
setLoggerDirectory(logPath);

0 commit comments

Comments
 (0)