Skip to content
Merged
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
134 changes: 5 additions & 129 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,8 @@ name: CI
on: [pull_request, push]

jobs:
build-mac:
name: Build - macOS
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
- run: ./gradlew build updateVersions updateAllDependencies -PbuildServer
name: Build with Gradle
- run: |
npm install
npm run compile
npm run lint
npm run packageMac
name: Build Standalone Utility
working-directory: wpilib-utility-standalone
- name: Import Developer ID Certificate
uses: wpilibsuite/import-signing-certificate@v2
with:
certificate-data: ${{ secrets.APPLE_CERTIFICATE_DATA }}
certificate-passphrase: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
keychain-password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
if: |
(github.repository_owner == 'wpilibsuite') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
- name: Sign Standalone Utility
run: npm run signMac
working-directory: wpilib-utility-standalone
if: |
(github.repository_owner == 'wpilibsuite') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
- name: Notarize Standalone Utility
uses: wpilibsuite/xcode-notarize@v3
with:
product-path: "wpilib-utility-standalone/build/wpilibutility-darwin-universal/wpilibutility.app"
appstore-connect-username: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
appstore-connect-teamid: ${{ secrets.APPLE_NOTARIZATION_TEAMID }}
appstore-connect-password: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
if: |
(github.repository_owner == 'wpilibsuite') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
- name: Staple Notarization Ticket
run: xcrun stapler staple -v wpilibutility.app
working-directory: wpilib-utility-standalone/build/wpilibutility-darwin-universal
if: |
(github.repository_owner == 'wpilibsuite') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
- run: tar -C build/wpilibutility-darwin-universal -pcvzf wpilibutility-mac.tar.gz .
working-directory: wpilib-utility-standalone
name: Create Archive
- uses: actions/upload-artifact@v4
with:
name: Mac
path: ${{ github.workspace }}/wpilib-utility-standalone/wpilibutility-mac.tar.gz

build-linux:
name: Build - Linux
build-vsix:
name: Build - VSIX
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -79,69 +17,7 @@ jobs:
with:
java-version: 17
distribution: "temurin"
- run: ./gradlew build updateVersions updateAllDependencies -PbuildServer
name: Build with Gradle
- run: |
npm install
npm run compile
npm run lint
npm run packageLinux
name: Build Standalone Utility
working-directory: wpilib-utility-standalone
- run: tar -C build/wpilibutility-linux-x64 -pcvzf wpilibutility-linux.tar.gz .
working-directory: wpilib-utility-standalone
name: Archive Utility
- uses: actions/upload-artifact@v4
with:
name: Linux
path: ${{ github.workspace }}/wpilib-utility-standalone/wpilibutility-linux.tar.gz

build-windows:
name: Build - Windows Standalone
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
- run: ./gradlew build updateVersions updateAllDependencies -PbuildServer
name: Build with Gradle
- run: |
npm install
npm run compile
npm run lint
npm run packageWindows
name: Build Standalone Utility
working-directory: wpilib-utility-standalone
- run: Compress-Archive -Path wpilibutility-win32-x64\* -DestinationPath wpilibutility-windows.zip
working-directory: wpilib-utility-standalone/build
shell: powershell
- uses: actions/upload-artifact@v4
with:
name: WindowsStandalone
path: ${{ github.workspace }}/wpilib-utility-standalone/build/wpilibutility-windows.zip

build-windows-vsix:
name: Build - Windows VSIX
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
- run: ./gradlew build updateVersions updateAllDependencies generateTemplateZip generateExamplesZip -PbuildServer
- run: ./gradlew build updateVersions -PbuildServer
name: Build with Gradle
- run: |
npm install
Expand All @@ -154,7 +30,7 @@ jobs:
name: Build VSIX
- uses: actions/upload-artifact@v4
with:
name: WindowsVSIX
name: VSIX
path: ${{ github.workspace }}/**/*.vsix
- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -195,7 +71,7 @@ jobs:
release:
name: "Release"
runs-on: ubuntu-latest
needs: [build-mac, build-linux, build-windows, build-windows-vsix]
needs: [build-vsix]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
Expand Down
30 changes: 0 additions & 30 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,6 @@
],
"outFiles": ["${workspaceFolder}/vscode-wpilib/out/test/**/*.js"],
"preLaunchTask": "vscode-web-watch"
},
{
"type": "node",
"request": "launch",
"name": "Standalone: Main",
"protocol": "inspector",
"runtimeExecutable": "${workspaceFolder}/wpilib-utility-standalone/node_modules/.bin/electron",
"runtimeArgs": [
"--remote-debugging-port=9223",
"wpilib-utility-standalone"
],
"outFiles": ["${workspaceFolder}/wpilib-utility-standalone/out/**/*.js"],
"windows": {
"runtimeExecutable": "${workspaceFolder}/wpilib-utility-standalone/node_modules/.bin/electron.cmd"
},
"preLaunchTask": "standalone-watch"
},
{
"name": "Standalone: Renderer",
"type": "chrome",
"request": "attach",
"port": 9223,
"webRoot": "${workspaceFolder}/wpilib-utility-standalone",
"timeout": 30000
}
],
"compounds": [
{
"name": "Standalone: All",
"configurations": ["Standalone: Main", "Standalone: Renderer"]
}
]
}
15 changes: 0 additions & 15 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,6 @@
"isDefault": true
},
"problemMatcher": []
},
{
"type": "npm",
"identifier": "standalone-watch",
"script": "watch",
"problemMatcher": "$tsc-watch",
"path": "wpilib-utility-standalone/",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![CI](https://github.com/wpilibsuite/vscode-wpilib/actions/workflows/main.yml/badge.svg)](https://github.com/wpilibsuite/vscode-wpilib/actions/workflows/main.yml)

This repository contains the WPILib VS Code extension, along with the standalone electron project that contains some of the functionality of the extension.
This repository contains the WPILib VS Code extension.

## Build Dependencies

Expand All @@ -18,19 +18,15 @@ This repository contains the WPILib VS Code extension, along with the standalone
In order to properly build, there is some setup that needs to occur.

1. Go into `vscode-wpilib` and run `npm install`
2. Go into into `wpilib-utility-standalone` and run `npm install`
3. From the root, run `./gradlew updateAllDependencies`. This will grab the templates and examples from WPILib, and move the shared dependencies from the vscode extension to the standalone utility. This command will need to be reran any time you update the shared dependencies in the vscode project.
4. Open the root folder in VS Code.
2. From the root, run `./gradlew build`. This will grab the templates and examples from WPILib, copy them into the vscode extension. This command will need to be reran any time you update the shared dependencies in the vscode project.
3. Open the root folder in VS Code.

## Building and Debugging

Once you have the project open in VS Code, there are 5 debugging targets set up.

- `Extension` Will launch the extension to debug
- `Extension Tests` Will launch the extension tests
- `Standalone: Main` Will launch the standalone project. The debugger will be attached to the host process
- `Standalone: Renderer` Will attach to the standalone projects renderer process
- `Standalone: All` Will launch the standalone project, and attach to the renderer. This will attach 2 separate debuggers.

In addition, each project has a `compile` and a `lint` npm command. These will compile and lint their respective projects. Please run these before submitting any PR, as CI will check these. In addition, VS Code's lint does not detect the same lint errors as running lint manually would.

Expand Down
43 changes: 5 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ dependencies {
javaSource 'edu.wpi.first.wpilibj:commands:+:@zip'
}


task extractCppDependencies(type: Copy) {
dependsOn configurations.cppSource

Expand Down Expand Up @@ -86,45 +85,14 @@ def downloadXRPVendordep = tasks.register('downloadXRPVendordep', Download) {
overwrite true
}

task copyFromVsCodeToStandaloneResources(type: Copy) {
dependsOn extractCppDependencies
dependsOn extractJavaDependencies
dependsOn downloadNewCommands
dependsOn downloadRomiVendordep
dependsOn downloadXRPVendordep
from ('vscode-wpilib/resources/java') {
into 'java'
}
from ('vscode-wpilib/resources/cpp') {
into 'cpp'
}
from ('vscode-wpilib/resources/gradle') {
into 'gradle'
}
from ('vscode-wpilib/resources/vendordeps') {
into 'vendordeps'
}
into 'wpilib-utility-standalone/resources'
}

task copyFromVsCodeToStandaloneSrc(type: Copy) {
from ('vscode-wpilib/src/riolog/shared') {
into 'riolog/shared'
}
from ('vscode-wpilib/src/shared') {
into 'shared'
}
into 'wpilib-utility-standalone/src'
}
build.dependsOn extractCppDependencies
build.dependsOn extractJavaDependencies
build.dependsOn downloadNewCommands
build.dependsOn downloadRomiVendordep
build.dependsOn downloadXRPVendordep

apply from: 'templatebuilder.gradle'


task updateAllDependencies() {
dependsOn copyFromVsCodeToStandaloneResources
dependsOn copyFromVsCodeToStandaloneSrc
}

if (project.hasProperty("publishVersion")) {
wpilibVersioning.version.set(project.publishVersion)
}
Expand All @@ -133,7 +101,6 @@ wpilibVersioning.version.finalizeValue()

ext.pubVersion = wpilibVersioning.version.get()


if (pubVersion == '') {
pubVersion = '0.0.1-unknown'
}
Expand Down
6 changes: 2 additions & 4 deletions templatebuilder.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ ext.generateCpp = { templateFile, outputDir, templateFolderRaw ->
}

task generateTemplatesFolder {
dependsOn copyFromVsCodeToStandaloneResources

def outputDir = new File(project.buildDir, "templates")

outputs.dir outputDir
Expand All @@ -136,11 +134,10 @@ task generateTemplatesZip(type: Zip) {
dependsOn generateTemplatesFolder
from new File(project.buildDir, "templates")
archiveFileName = 'templates.zip'
build.dependsOn it
}

task generateExamplesFolder {
dependsOn copyFromVsCodeToStandaloneResources

def outputDir = new File(project.buildDir, "examples")

outputs.dir outputDir
Expand All @@ -167,5 +164,6 @@ task generateExamplesZip(type: Zip) {
dependsOn generateExamplesFolder
from new File(project.buildDir, "examples")
archiveFileName = 'examples.zip'
build.dependsOn it
}

2 changes: 1 addition & 1 deletion versions.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def versionFiles = [new File('vscode-wpilib/package.json'), new File('wpilib-utility-standalone/package.json')]
def versionFiles = [new File('vscode-wpilib/package.json')]
def oldVersionFile = new File("$buildDir/existingVersions.json")

task updateVersions(type: Task) {
Expand Down
5 changes: 0 additions & 5 deletions wpilib-utility-standalone/.eslintignore

This file was deleted.

12 changes: 0 additions & 12 deletions wpilib-utility-standalone/.eslintrc.js

This file was deleted.

7 changes: 0 additions & 7 deletions wpilib-utility-standalone/.gitignore

This file was deleted.

Loading
Loading