From 1e16d9f9b680ab0f2073dfd679d20554bdc4e2ba Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Fri, 12 Sep 2025 12:30:12 -0400 Subject: [PATCH 1/6] Properly declare inputs and output for buildClient --- photon-server/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/photon-server/build.gradle b/photon-server/build.gradle index f605532e37..fba4253396 100644 --- a/photon-server/build.gradle +++ b/photon-server/build.gradle @@ -23,6 +23,7 @@ application { jar { from file("$rootDir/LICENSE") + dependsOn "buildAndCopyUI" } shadowJar { @@ -44,6 +45,8 @@ tasks.register('copyClientUIToResources', Copy) { } tasks.register('buildClient', PnpmTask) { + inputs.dir fileTree(dir: "${projectDir}/../photon-client", exclude: "dist/") + outputs.dir file("${projectDir}/../photon-client/dist") args = ["build"] dependsOn "pnpmInstall" } From 671b7c27159804f60aaaad7f5af367a63672ff25 Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 12 Sep 2025 12:04:14 -0500 Subject: [PATCH 2/6] move dependency to shadowJar --- photon-server/build.gradle | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/photon-server/build.gradle b/photon-server/build.gradle index fba4253396..801bbc6f12 100644 --- a/photon-server/build.gradle +++ b/photon-server/build.gradle @@ -23,10 +23,11 @@ application { jar { from file("$rootDir/LICENSE") - dependsOn "buildAndCopyUI" } shadowJar { + dependsOn 'buildAndCopyUI' + archiveBaseName = "photonvision" archiveVersion = project.version as String archiveClassifier.set(wpilibTools.currentPlatform.platformName) @@ -56,6 +57,10 @@ tasks.register('buildAndCopyUI') { finalizedBy "copyClientUIToResources" } +processResources { + dependsOn copyClientUIToResources +} + run { environment "PATH_PREFIX", "../" From 8497e206a8675b2a5a8a754653a9a67537d46c63 Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 12 Sep 2025 12:04:25 -0500 Subject: [PATCH 3/6] remove buildAndCopyUI from docs --- .../docs/contributing/building-photon.md | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/docs/source/docs/contributing/building-photon.md b/docs/source/docs/contributing/building-photon.md index 7f5738d3dd..41ec668e13 100644 --- a/docs/source/docs/contributing/building-photon.md +++ b/docs/source/docs/contributing/building-photon.md @@ -43,26 +43,6 @@ In the photon-client directory: pnpm install ``` -### Build and Copy UI to Java Source - -In the root directory: - -```{eval-rst} -.. tab-set:: - - .. tab-item:: Linux - - ``./gradlew buildAndCopyUI`` - - .. tab-item:: macOS - - ``./gradlew buildAndCopyUI`` - - .. tab-item:: Windows (cmd) - - ``gradlew buildAndCopyUI`` -``` - ### Using hot reload on the UI In the photon-client directory: From 1dc24e82472c5880e23126ca021b6b856d546aec Mon Sep 17 00:00:00 2001 From: samfreund Date: Fri, 12 Sep 2025 12:16:57 -0500 Subject: [PATCH 4/6] remove index.html --- .github/workflows/lint-format.yml | 12 ------------ photon-server/src/main/resources/web/index.html | 1 - 2 files changed, 13 deletions(-) delete mode 100644 photon-server/src/main/resources/web/index.html diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index e703957049..350bf38861 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -83,15 +83,3 @@ jobs: run: pnpm run lint-ci - name: Check Formatting run: pnpm run format-ci - server-index: - name: "Check server index.html not changed" - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - name: Fetch all history and metadata - run: | - git fetch --prune --unshallow - git checkout -b pr - git branch -f main origin/main - - name: Check index.html not changed - run: git --no-pager diff --exit-code origin/main photon-server/src/main/resources/web/index.html diff --git a/photon-server/src/main/resources/web/index.html b/photon-server/src/main/resources/web/index.html deleted file mode 100644 index 641b6da394..0000000000 --- a/photon-server/src/main/resources/web/index.html +++ /dev/null @@ -1 +0,0 @@ -

UIs should be copied, but yours wasn't!

From e668ab3ee3277ee6a2be6f07fa7a594699af513c Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Fri, 12 Sep 2025 15:42:21 -0400 Subject: [PATCH 5/6] Fix up CI --- .github/labeler.yml | 6 ++---- .github/workflows/build.yml | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 9b7d480c0e..60f72803aa 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,8 +1,6 @@ "backend": - - all: - - changed-files: - - any-glob-to-any-file: [photon-core/**, photon-server/**] - - all-globs-to-all-files: "!photon-server/src/main/resources/web/index.html" + - changed-files: + - any-glob-to-any-file: [photon-core/**, photon-server/**] "documentation": - changed-files: - any-glob-to-any-file: [docs/**, photon-docs/**] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f29a7ff3fc..2efe6664b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,6 +100,14 @@ jobs: with: java-version: 17 distribution: temurin + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 - name: Install mrcal deps run: sudo apt-get update && sudo apt-get install -y libcholmod3 liblapack3 libsuitesparseconfig5 - name: Gradle Build From 9d873943d685afa768e52c76a3bbd493671767d2 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Fri, 12 Sep 2025 15:53:50 -0400 Subject: [PATCH 6/6] Remove separate client build --- .github/workflows/build.yml | 51 ++++++++----------------------------- 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2efe6664b6..2f03b6b0cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,33 +17,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: gradle/actions/wrapper-validation@v4 - - build-client: - name: "PhotonClient Build" - defaults: - run: - working-directory: photon-client - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: pnpm - cache-dependency-path: photon-client/pnpm-lock.yaml - - name: Install Dependencies - run: pnpm i --frozen-lockfile - - name: Build Production Client - run: pnpm run build - - uses: actions/upload-artifact@v4 - with: - name: built-client - path: photon-client/dist/ build-examples: strategy: @@ -284,7 +257,7 @@ jobs: path: output/*.zip build-package: - needs: [build-client, build-gradle, build-offline-docs] + needs: [build-gradle, build-offline-docs] strategy: fail-fast: false @@ -324,21 +297,19 @@ jobs: java-version: 17 distribution: temurin architecture: ${{ matrix.architecture }} + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: photon-client/pnpm-lock.yaml - name: Install Arm64 Toolchain run: ./gradlew installArm64Toolchain if: ${{ (matrix.artifact-name) == 'LinuxArm64' }} - - run: | - rm -rf photon-server/src/main/resources/web/* - mkdir -p photon-server/src/main/resources/web/docs - if: ${{ (matrix.os) != 'windows-latest' }} - - run: | - del photon-server\src\main\resources\web\*.* - mkdir photon-server\src\main\resources\web\docs - if: ${{ (matrix.os) == 'windows-latest' }} - - uses: actions/download-artifact@v4 - with: - name: built-client - path: photon-server/src/main/resources/web/ - uses: actions/download-artifact@v4 with: name: built-docs