diff --git a/vscode-wpilib/README.md b/vscode-wpilib/README.md index 988f5f75..4762dbf8 100644 --- a/vscode-wpilib/README.md +++ b/vscode-wpilib/README.md @@ -2,7 +2,7 @@ ## Features -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/). +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/). ## Requirements diff --git a/vscode-wpilib/package.nls.json b/vscode-wpilib/package.nls.json index f876f511..5b02ad66 100644 --- a/vscode-wpilib/package.nls.json +++ b/vscode-wpilib/package.nls.json @@ -18,7 +18,7 @@ "wpilibcore.importGradle2025Project.title": "Import a WPILib 2025 Gradle project", "wpilibcore.createNewProject.title": "Create a new project", "wpilibcore.manageVendorLibs.title": "Manage Vendor Libraries", - "wpilibcore.setJavaHome.title": "Set VS Code Java Home to FRC Home", + "wpilibcore.setJavaHome.title": "Set VS Code Java Home to WPILib Home", "wpilibcore.checkForUpdates.title": "Check for WPILib Updates", "wpilibcore.installGradleTools.title": "Install tools from GradleRIO", "wpilibcore.showLogFolder.title": "Show Log Folder", diff --git a/vscode-wpilib/resources/gradle/c/build.gradle b/vscode-wpilib/resources/gradle/c/build.gradle index 5aec3bcb..59d9efef 100644 --- a/vscode-wpilib/resources/gradle/c/build.gradle +++ b/vscode-wpilib/resources/gradle/c/build.gradle @@ -14,18 +14,21 @@ deploy { // or from command line. If not found an exception will be thrown. // You can use getTeamOrDefault(team) instead of getTeamNumber if you // want to store a team number in this file. - team = project.frc.getTeamNumber() - debug = project.frc.getDebugOrDefault(false) + team = project.wpilib.getTeamNumber() + // Use the default systemcore host name. This must be called after setting team + // as happens on the line above + useDefaultSystemcoreHostName() + debug = project.wpilib.getDebugOrDefault(false) artifacts { // First part is artifact name, 2nd is artifact type // getTargetTypeClass is a shortcut to get the class type using a string - frcCpp(getArtifactTypeClass('FRCNativeArtifact')) { + wpilibCpp(getArtifactTypeClass('WPILibNativeArtifact')) { } // Static files artifact - frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { + wpilibStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/systemcore/deploy' deleteOldFiles = false // Change to true to delete files on SystemCore that no @@ -36,7 +39,7 @@ deploy { } } -def deployArtifact = deploy.targets.systemcore.artifacts.frcCpp +def deployArtifact = deploy.targets.systemcore.artifacts.wpilibCpp // Set this to true to enable desktop support. def includeDesktopSupport = false @@ -51,7 +54,7 @@ wpi.sim.addDriverstation() model { components { - frcUserProgram(NativeExecutableSpec) { + wpilibUserProgram(NativeExecutableSpec) { targetPlatform wpi.platforms.systemcore if (includeDesktopSupport) { targetPlatform wpi.platforms.desktop @@ -91,8 +94,8 @@ model { } } testSuites { - frcUserProgramTest(GoogleTestTestSuiteSpec) { - testing $.components.frcUserProgram + wpilibUserProgramTest(GoogleTestTestSuiteSpec) { + testing $.components.wpilibUserProgram sources.cpp { source { diff --git a/vscode-wpilib/resources/gradle/cpp/build.gradle b/vscode-wpilib/resources/gradle/cpp/build.gradle index a20e0a82..99f104a9 100644 --- a/vscode-wpilib/resources/gradle/cpp/build.gradle +++ b/vscode-wpilib/resources/gradle/cpp/build.gradle @@ -13,18 +13,21 @@ deploy { // or from command line. If not found an exception will be thrown. // You can use getTeamOrDefault(team) instead of getTeamNumber if you // want to store a team number in this file. - team = project.frc.getTeamNumber() - debug = project.frc.getDebugOrDefault(false) + team = project.wpilib.getTeamNumber() + // Use the default systemcore host name. This must be called after setting team + // as happens on the line above + useDefaultSystemcoreHostName() + debug = project.wpilib.getDebugOrDefault(false) artifacts { // First part is artifact name, 2nd is artifact type // getTargetTypeClass is a shortcut to get the class type using a string - frcCpp(getArtifactTypeClass('FRCNativeArtifact')) { + wpilibCpp(getArtifactTypeClass('WPILibNativeArtifact')) { } // Static files artifact - frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { + wpilibStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/systemcore/deploy' deleteOldFiles = false // Change to true to delete files on SystemCore that no @@ -35,7 +38,7 @@ deploy { } } -def deployArtifact = deploy.targets.systemcore.artifacts.frcCpp +def deployArtifact = deploy.targets.systemcore.artifacts.wpilibCpp // Set this to true to enable desktop support. def includeDesktopSupport = false @@ -50,7 +53,7 @@ wpi.sim.addDriverstation() model { components { - frcUserProgram(NativeExecutableSpec) { + wpilibUserProgram(NativeExecutableSpec) { targetPlatform wpi.platforms.systemcore if (includeDesktopSupport) { targetPlatform wpi.platforms.desktop @@ -80,8 +83,8 @@ model { } } testSuites { - frcUserProgramTest(GoogleTestTestSuiteSpec) { - testing $.components.frcUserProgram + wpilibUserProgramTest(GoogleTestTestSuiteSpec) { + testing $.components.wpilibUserProgram sources.cpp { source { diff --git a/vscode-wpilib/resources/gradle/cppromi/build.gradle b/vscode-wpilib/resources/gradle/cppromi/build.gradle index 6a65dbfe..d71f2304 100644 --- a/vscode-wpilib/resources/gradle/cppromi/build.gradle +++ b/vscode-wpilib/resources/gradle/cppromi/build.gradle @@ -15,7 +15,7 @@ wpi.sim.addWebsocketsClient().defaultEnabled = true model { components { - frcUserProgram(NativeExecutableSpec) { + wpilibUserProgram(NativeExecutableSpec) { targetPlatform wpi.platforms.desktop sources.cpp { @@ -38,8 +38,8 @@ model { } } testSuites { - frcUserProgramTest(GoogleTestTestSuiteSpec) { - testing $.components.frcUserProgram + wpilibUserProgramTest(GoogleTestTestSuiteSpec) { + testing $.components.wpilibUserProgram sources.cpp { source { diff --git a/vscode-wpilib/resources/gradle/cppxrp/build.gradle b/vscode-wpilib/resources/gradle/cppxrp/build.gradle index 3f3c6ea4..f5d15236 100644 --- a/vscode-wpilib/resources/gradle/cppxrp/build.gradle +++ b/vscode-wpilib/resources/gradle/cppxrp/build.gradle @@ -14,7 +14,7 @@ wpi.sim.addXRPClient().defaultEnabled = true model { components { - frcUserProgram(NativeExecutableSpec) { + wpilibUserProgram(NativeExecutableSpec) { targetPlatform wpi.platforms.desktop sources.cpp { @@ -37,8 +37,8 @@ model { } } testSuites { - frcUserProgramTest(GoogleTestTestSuiteSpec) { - testing $.components.frcUserProgram + wpilibUserProgramTest(GoogleTestTestSuiteSpec) { + testing $.components.wpilibUserProgram sources.cpp { source { diff --git a/vscode-wpilib/resources/gradle/java/build.gradle b/vscode-wpilib/resources/gradle/java/build.gradle index 7c8e98e9..c6d3034a 100644 --- a/vscode-wpilib/resources/gradle/java/build.gradle +++ b/vscode-wpilib/resources/gradle/java/build.gradle @@ -19,18 +19,21 @@ deploy { // or from command line. If not found an exception will be thrown. // You can use getTeamOrDefault(team) instead of getTeamNumber if you // want to store a team number in this file. - team = project.frc.getTeamNumber() - debug = project.frc.getDebugOrDefault(false) + team = project.wpilib.getTeamNumber() + // Use the default systemcore host name. This must be called after setting team + // as happens on the line above + useDefaultSystemcoreHostName() + debug = project.wpilib.getDebugOrDefault(false) artifacts { // First part is artifact name, 2nd is artifact type // getTargetTypeClass is a shortcut to get the class type using a string - frcJava(getArtifactTypeClass('FRCJavaArtifact')) { + wpilibJava(getArtifactTypeClass('WPILibJavaArtifact')) { } // Static files artifact - frcStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { + wpilibStaticFileDeploy(getArtifactTypeClass('FileTreeArtifact')) { files = project.fileTree('src/main/deploy') directory = '/home/systemcore/deploy' deleteOldFiles = false // Change to true to delete files on systemcore that no @@ -41,7 +44,7 @@ deploy { } } -def deployArtifact = deploy.targets.systemcore.artifacts.frcJava +def deployArtifact = deploy.targets.systemcore.artifacts.wpilibJava // Set to true to use debug for all targets including JNI, which will drastically impact // performance. diff --git a/vscode-wpilib/resources/gradle/shared/settings.gradle b/vscode-wpilib/resources/gradle/shared/settings.gradle index 2374b33a..2044e6fa 100644 --- a/vscode-wpilib/resources/gradle/shared/settings.gradle +++ b/vscode-wpilib/resources/gradle/shared/settings.gradle @@ -4,24 +4,24 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() - String frcYear = '2027_alpha4' - File frcHome + String wpilibYear = '2027_alpha4' + File wpilibHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') if (publicFolder == null) { publicFolder = "C:\\Users\\Public" } def homeRoot = new File(publicFolder, "wpilib") - frcHome = new File(homeRoot, frcYear) + wpilibHome = new File(homeRoot, wpilibYear) } else { def userFolder = System.getProperty("user.home") def homeRoot = new File(userFolder, "wpilib") - frcHome = new File(homeRoot, frcYear) + wpilibHome = new File(homeRoot, wpilibYear) } - def frcHomeMaven = new File(frcHome, 'maven') + def wpilibHomeMaven = new File(wpilibHome, 'maven') maven { - name = 'frcHome' - url = frcHomeMaven + name = 'wpilibHome' + url = wpilibHomeMaven } } } diff --git a/vscode-wpilib/src/api.ts b/vscode-wpilib/src/api.ts index 27e5a8a1..5f9f2663 100644 --- a/vscode-wpilib/src/api.ts +++ b/vscode-wpilib/src/api.ts @@ -94,7 +94,7 @@ export interface IPreferencesAPI { } export interface IUtilitiesAPI { - getFrcYear(): string; + getWPILibYear(): string; getWPILibHomeDir(): string; } diff --git a/vscode-wpilib/src/extension.ts b/vscode-wpilib/src/extension.ts index 490bad60..838cfb07 100644 --- a/vscode-wpilib/src/extension.ts +++ b/vscode-wpilib/src/extension.ts @@ -457,9 +457,9 @@ export async function activate(context: vscode.ExtensionContext) { // That file can be copied to another project. const externalApi = await ExternalAPI.Create(extensionResourceLocation); - const frcHomeDir = externalApi.getUtilitiesAPI().getWPILibHomeDir(); + const wpilibHomeDir = externalApi.getUtilitiesAPI().getWPILibHomeDir(); - const logPath = path.join(frcHomeDir, 'logs'); + const logPath = path.join(wpilibHomeDir, 'logs'); try { await mkdir(logPath, { recursive: true }); setLoggerDirectory(logPath); diff --git a/vscode-wpilib/src/jdkdetector.ts b/vscode-wpilib/src/jdkdetector.ts index 03e00b4d..6e04f3e1 100644 --- a/vscode-wpilib/src/jdkdetector.ts +++ b/vscode-wpilib/src/jdkdetector.ts @@ -65,11 +65,11 @@ export async function findJdkPath(api: IExternalAPI): Promise { - const frcHome = this.externalApi.getUtilitiesAPI().getWPILibHomeDir(); - const gradleRioPath = path.join(frcHome, 'maven', 'edu', 'wpi', 'first', 'GradleRIO'); + const wpilibHome = this.externalApi.getUtilitiesAPI().getWPILibHomeDir(); + const gradleRioPath = path.join(wpilibHome, 'maven', 'edu', 'wpi', 'first', 'GradleRIO'); try { const files = await readdir(gradleRioPath); const versions = [];