Skip to content

Commit

Permalink
Generate photon serde messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Aug 4, 2024
1 parent 9ad9b82 commit c6b7be6
Show file tree
Hide file tree
Showing 146 changed files with 7,929 additions and 7,222 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,20 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install Dependencies
run: npm ci
run: pnpm install
- name: Build Production Client
run: npm run build
run: pnpm run build
- uses: actions/upload-artifact@v4
with:
name: built-client
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,23 @@ jobs:
working-directory: photon-client
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install Dependencies
run: npm ci
run: pnpm install
- name: Check Linting
run: npm run lint-ci
run: pnpm run lint-ci
- name: Check Formatting
run: npm run format-ci
run: pnpm run format-ci
server-index:
name: "Check server index.html not changed"
runs-on: ubuntu-22.04
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/photon-code-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,20 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install Dependencies
run: npm ci
run: pnpm install
- name: Build Production Client
run: npm run build-demo
run: pnpm run build-demo
- uses: actions/upload-artifact@v4
with:
name: built-client
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,6 @@ photon-server/src/main/resources/web/index.html
photon-lib/src/generate/native/cpp/PhotonVersion.cpp

venv

.venv/*
.venv
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spotless {
java {
target fileTree('.') {
include '**/*.java'
exclude '**/build/**', '**/build-*/**', "photon-core\\src\\main\\java\\org\\photonvision\\PhotonVersion.java", "photon-lib\\src\\main\\java\\org\\photonvision\\PhotonVersion.java"
exclude '**/build/**', '**/build-*/**', "photon-core\\src\\main\\java\\org\\photonvision\\PhotonVersion.java", "photon-lib\\src\\main\\java\\org\\photonvision\\PhotonVersion.java", "**/src/generated/**"
}
toggleOffOn()
googleJavaFormat()
Expand Down
1 change: 0 additions & 1 deletion devTools/calibrationUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from dataclasses import dataclass
import json
import os
from typing import Union
import cv2
import numpy as np
import mrcal
Expand Down
18 changes: 5 additions & 13 deletions docs/source/docs/contributing/photonvision/build-instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,8 @@ Development Setup
Prerequisites
~~~~~~~~~~~~~

| **Java Development Kit:** This project requires Java Development Kit (JDK) 17 to be compiled. This is the same Java version that comes with WPILib for 2025+. If you don't have this JDK with WPILib, you can follow the instructions to install JDK 17 for your platform `here <https://bell-sw.com/pages/downloads/#jdk-17-lts>`_.
| **Node JS:** The UI is written in Node JS. To compile the UI, Node 14.18.0 to Node 16.0.0 is required. To install Node JS follow the instructions for your platform `on the official Node JS website <https://nodejs.org/en/download/>`_. However, modify this line
.. code-block:: bash
nvm install 20
so that it instead reads

.. code-block:: javascript
nvm install 14.18.0
| **Java Development Kit:** This project requires Java Development Kit (JDK) 17 to be compiled. This is the same Java version that comes with WPILib for 2024+. If you don't have this JDK with WPILib, you can follow the instructions to install JDK 17 for your platform `here <https://bell-sw.com/pages/downloads/#jdk-17-lts>`__.
| **Node.js and pnpm** The UI is created using Vue and built using Vite. Node.js is required to develop and build the UI. We recomend using the pnpm package manager to handle dependencies and install Node.js. You can follow the instructions to install pnpm `here <https://pnpm.io/installation>`__. The project is already configured to create a Node.js v18 env when building photon-client.
Compiling Instructions
----------------------
Expand All @@ -46,7 +36,7 @@ In the photon-client directory:

.. code-block:: bash
npm install
pnpm install
Build and Copy UI to Java Source
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -68,6 +58,8 @@ In the root directory:

``gradlew buildAndCopyUI``

Please note that if you installed Node.js via pnpm, this gradle action will mirror Node.js in the gradle workdir and use that instead of the pnpm version.

Build and Run PhotonVision
~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
1 change: 1 addition & 0 deletions photon-client/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use-node-version=18.20.4
Loading

0 comments on commit c6b7be6

Please sign in to comment.