Skip to content

Commit 04e9bff

Browse files
Gold856samfreund
andauthored
Properly declare inputs and output for buildClient (#2086)
Co-authored-by: samfreund <[email protected]>
1 parent 4b01b66 commit 04e9bff

File tree

6 files changed

+29
-77
lines changed

6 files changed

+29
-77
lines changed

.github/labeler.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"backend":
2-
- all:
3-
- changed-files:
4-
- any-glob-to-any-file: [photon-core/**, photon-server/**]
5-
- all-globs-to-all-files: "!photon-server/src/main/resources/web/index.html"
2+
- changed-files:
3+
- any-glob-to-any-file: [photon-core/**, photon-server/**]
64
"documentation":
75
- changed-files:
86
- any-glob-to-any-file: [docs/**, photon-docs/**]

.github/workflows/build.yml

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,6 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919
- uses: gradle/actions/wrapper-validation@v4
20-
21-
build-client:
22-
name: "PhotonClient Build"
23-
defaults:
24-
run:
25-
working-directory: photon-client
26-
runs-on: ubuntu-22.04
27-
steps:
28-
- uses: actions/checkout@v4
29-
- name: Install pnpm
30-
uses: pnpm/action-setup@v4
31-
with:
32-
version: 10
33-
- name: Setup Node.js
34-
uses: actions/setup-node@v4
35-
with:
36-
node-version: 22
37-
cache: pnpm
38-
cache-dependency-path: photon-client/pnpm-lock.yaml
39-
- name: Install Dependencies
40-
run: pnpm i --frozen-lockfile
41-
- name: Build Production Client
42-
run: pnpm run build
43-
- uses: actions/upload-artifact@v4
44-
with:
45-
name: built-client
46-
path: photon-client/dist/
4720
build-examples:
4821

4922
strategy:
@@ -100,6 +73,14 @@ jobs:
10073
with:
10174
java-version: 17
10275
distribution: temurin
76+
- name: Install pnpm
77+
uses: pnpm/action-setup@v4
78+
with:
79+
version: 10
80+
- name: Setup Node.js
81+
uses: actions/setup-node@v4
82+
with:
83+
node-version: 22
10384
- name: Install mrcal deps
10485
run: sudo apt-get update && sudo apt-get install -y libcholmod3 liblapack3 libsuitesparseconfig5
10586
- name: Gradle Build
@@ -276,7 +257,7 @@ jobs:
276257
path: output/*.zip
277258

278259
build-package:
279-
needs: [build-client, build-gradle, build-offline-docs]
260+
needs: [build-gradle, build-offline-docs]
280261

281262
strategy:
282263
fail-fast: false
@@ -316,21 +297,19 @@ jobs:
316297
java-version: 17
317298
distribution: temurin
318299
architecture: ${{ matrix.architecture }}
300+
- name: Install pnpm
301+
uses: pnpm/action-setup@v4
302+
with:
303+
version: 10
304+
- name: Setup Node.js
305+
uses: actions/setup-node@v4
306+
with:
307+
node-version: 22
308+
cache: pnpm
309+
cache-dependency-path: photon-client/pnpm-lock.yaml
319310
- name: Install Arm64 Toolchain
320311
run: ./gradlew installArm64Toolchain
321312
if: ${{ (matrix.artifact-name) == 'LinuxArm64' }}
322-
- run: |
323-
rm -rf photon-server/src/main/resources/web/*
324-
mkdir -p photon-server/src/main/resources/web/docs
325-
if: ${{ (matrix.os) != 'windows-latest' }}
326-
- run: |
327-
del photon-server\src\main\resources\web\*.*
328-
mkdir photon-server\src\main\resources\web\docs
329-
if: ${{ (matrix.os) == 'windows-latest' }}
330-
- uses: actions/download-artifact@v4
331-
with:
332-
name: built-client
333-
path: photon-server/src/main/resources/web/
334313
- uses: actions/download-artifact@v4
335314
with:
336315
name: built-docs

.github/workflows/lint-format.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,3 @@ jobs:
8383
run: pnpm run lint-ci
8484
- name: Check Formatting
8585
run: pnpm run format-ci
86-
server-index:
87-
name: "Check server index.html not changed"
88-
runs-on: ubuntu-22.04
89-
steps:
90-
- uses: actions/checkout@v4
91-
- name: Fetch all history and metadata
92-
run: |
93-
git fetch --prune --unshallow
94-
git checkout -b pr
95-
git branch -f main origin/main
96-
- name: Check index.html not changed
97-
run: git --no-pager diff --exit-code origin/main photon-server/src/main/resources/web/index.html

docs/source/docs/contributing/building-photon.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,6 @@ In the photon-client directory:
4343
pnpm install
4444
```
4545

46-
### Build and Copy UI to Java Source
47-
48-
In the root directory:
49-
50-
```{eval-rst}
51-
.. tab-set::
52-
53-
.. tab-item:: Linux
54-
55-
``./gradlew buildAndCopyUI``
56-
57-
.. tab-item:: macOS
58-
59-
``./gradlew buildAndCopyUI``
60-
61-
.. tab-item:: Windows (cmd)
62-
63-
``gradlew buildAndCopyUI``
64-
```
65-
6646
### Using hot reload on the UI
6747

6848
In the photon-client directory:

photon-server/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jar {
2626
}
2727

2828
shadowJar {
29+
dependsOn 'buildAndCopyUI'
30+
2931
archiveBaseName = "photonvision"
3032
archiveVersion = project.version as String
3133
archiveClassifier.set(wpilibTools.currentPlatform.platformName)
@@ -44,6 +46,8 @@ tasks.register('copyClientUIToResources', Copy) {
4446
}
4547

4648
tasks.register('buildClient', PnpmTask) {
49+
inputs.dir fileTree(dir: "${projectDir}/../photon-client", exclude: "dist/")
50+
outputs.dir file("${projectDir}/../photon-client/dist")
4751
args = ["build"]
4852
dependsOn "pnpmInstall"
4953
}
@@ -53,6 +57,10 @@ tasks.register('buildAndCopyUI') {
5357
finalizedBy "copyClientUIToResources"
5458
}
5559

60+
processResources {
61+
dependsOn copyClientUIToResources
62+
}
63+
5664
run {
5765
environment "PATH_PREFIX", "../"
5866

photon-server/src/main/resources/web/index.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)