Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b622295
Bump some versions; add the script to allow easy building on Windows.
davidgiven Sep 18, 2026
ca07b78
Update Windows build scripts.
davidgiven Sep 18, 2026
043684b
Try cleaning up the Windows USB code.
davidgiven Sep 18, 2026
bf8c133
Make USB allocation/release more robust.
davidgiven Sep 18, 2026
f2e97d0
Add in a rather hacky but effective lightweight retry if a USB underrun
davidgiven Sep 19, 2026
8c9d3af
Use fastproto objects for serialising/deserialising USB frames.
davidgiven Sep 19, 2026
9b5e9f1
Use the native libusb API, not javax.usb.
davidgiven Sep 19, 2026
447bc19
Make writing to a real fluxengine work again!
davidgiven Sep 19, 2026
fc3ea16
Fix voltage measurements.
davidgiven Sep 19, 2026
645512f
Set the configuration panel horizontal size correctly.
davidgiven Sep 19, 2026
1afc457
Sort out the sizing of the configuration plane.
davidgiven Sep 19, 2026
fd28364
Try to fix the resizing issues on Windows.
davidgiven Sep 19, 2026
4612cc9
Make shutdowns cleaner.
davidgiven Sep 19, 2026
aba7df0
Only reset the USB device if an actual error happens.
davidgiven Sep 19, 2026
f80a036
Try to ensure that version numbers make sense on the CI build.
davidgiven Sep 19, 2026
4596d8b
Don't check in the .bazelproject file, as it's system-dependent.
davidgiven Sep 19, 2026
b108ab4
Don't crash on exit if no operation is running.
davidgiven Sep 19, 2026
edec342
Don't crash on exit, but do actually exit.
davidgiven Sep 19, 2026
0824da8
Fix the configuration panel sizing, again.
davidgiven Sep 19, 2026
72b0cb6
Don't crash when using a group verb with no actual command verb.
davidgiven Sep 20, 2026
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
8 changes: 8 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ common --tool_java_runtime_version=remotejdk_21
# compilation (and Turbine can't run Lombok), so disable header compilation.
build --java_header_compilation=false

# Stamping: workspace status provides STABLE_VERSION as YYYY.MMDD.HHMM
# (per-minute UTC, each component <65535 for MSI). Invoked as `bash` so it
# works on Linux/macOS and on Windows via Git bash (C:\Program Files\Git\bin\bash.exe).
# Use --config=stamp or --stamp together with this command. The stamp config
# bundles both.
build:stamp --stamp
build:stamp --workspace_status_command="bash scripts/workspace_status.sh"

# Dev machine toolchain workarounds: the system gcc is wrapped by ccache and
# the system linker (lld) lives in /opt/bin, outside Bazel's default action PATH.
build --repo_env=CC=/usr/bin/gcc
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
- name: Build with Bazel
run: |
cd fluxengine
bazel test //... //:fluxengine_deb //:fluxengine_rpm //:fluxengine_app_image --test_output=errors
bazel test //... --test_output=errors
bazel build //:fluxengine_deb //:fluxengine_rpm //:fluxengine_app_image --config=stamp --test_output=errors
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -52,7 +53,8 @@ jobs:
- name: Build with Bazel
run: |
cd fluxengine
bazel test //... //:fluxengine_dmg --test_output=errors
bazel test //... --test_output=errors
bazel build //:fluxengine_dmg --config=stamp --test_output=errors

- name: Upload build artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -92,7 +94,12 @@ jobs:
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
cd fluxengine
bazel test //... //:fluxengine_msi --test_output=errors `
bazel test //... --test_output=errors `
--action_env=PATH `
--action_env=INCLUDE `
--action_env=LIB `
--action_env=LIBPATH
bazel build //:fluxengine_msi --config=stamp --test_output=errors `
--action_env=PATH `
--action_env=INCLUDE `
--action_env=LIB `
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
- name: Build with Bazel
run: |
cd fluxengine
bazel build //:fluxengine_deb //:fluxengine_rpm //:fluxengine_app_image --test_output=errors
mv bazel-bin/java/com/cowlark/fluxengine/fluxengine_1.0.0.deb fluxengine-1.0.0.${{ runner.arch }}.deb
mv bazel-bin/java/com/cowlark/fluxengine/fluxengine_1.0.0.rpm fluxengine-1.0.0.${{ runner.arch }}.rpm
mv bazel-bin/java/com/cowlark/fluxengine/fluxengine_1.0.0.tar.xz fluxengine-1.0.0.${{ runner.arch }}.tar.xz
bazel build //:fluxengine_deb //:fluxengine_rpm //:fluxengine_app_image --config=stamp --test_output=errors
mv bazel-bin/java/com/cowlark/fluxengine/*.deb fluxengine-${{ runner.arch }}.deb
mv bazel-bin/java/com/cowlark/fluxengine/*.rpm fluxengine-${{ runner.arch }}.rpm
mv bazel-bin/java/com/cowlark/fluxengine/*.tar.xz fluxengine-${{ runner.arch }}.tar.xz


- name: date
Expand All @@ -58,19 +58,19 @@ jobs:
token: ${{ github.token }}
tag: dev
assets: |
fluxengine-1.0.0.${{ runner.arch }}.deb
fluxengine-1.0.0.${{ runner.arch }}.rpm
fluxengine-1.0.0.${{ runner.arch }}.tar.xz
fluxengine-${{ runner.arch }}.deb
fluxengine-${{ runner.arch }}.rpm
fluxengine-${{ runner.arch }}.tar.xz
fail-if-no-assets: false

- name: release
uses: softprops/action-gh-release@v1
with:
name: Development build ${{ env.RELEASE_DATE }}
files: |
fluxengine/fluxengine-1.0.0.${{ runner.arch }}.deb
fluxengine/fluxengine-1.0.0.${{ runner.arch }}.rpm
fluxengine/fluxengine-1.0.0.${{ runner.arch }}.tar.xz
fluxengine/fluxengine-${{ runner.arch }}.deb
fluxengine/fluxengine-${{ runner.arch }}.rpm
fluxengine/fluxengine-${{ runner.arch }}.tar.xz
tag_name: dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -97,8 +97,8 @@ jobs:
- name: Build with Bazel
run: |
cd fluxengine
bazel build //:fluxengine_dmg --test_output=errors
mv bazel-bin/java/com/cowlark/fluxengine/fluxengine_1.0.0.dmg fluxengine_1.0.0.${{ runner.arch }}.dmg
bazel build //:fluxengine_dmg --config=stamp --test_output=errors
mv bazel-bin/java/com/cowlark/fluxengine/*.dmg fluxengine-${{ runner.arch }}.dmg

- name: date
run: |
Expand All @@ -119,15 +119,15 @@ jobs:
token: ${{ github.token }}
tag: dev
assets: |
fluxengine_1.0.0.${{ runner.arch }}.dmg
fluxengine-${{ runner.arch }}.dmg
fail-if-no-assets: false

- name: release
uses: softprops/action-gh-release@v1
with:
name: Development build ${{ env.RELEASE_DATE }}
files: |
fluxengine/fluxengine_1.0.0.${{ runner.arch }}.dmg
fluxengine/fluxengine-${{ runner.arch }}.dmg
tag_name: dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -167,12 +167,12 @@ jobs:
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
cd fluxengine
bazel build //:fluxengine_msi --test_output=errors `
bazel build //:fluxengine_msi --config=stamp --test_output=errors `
--action_env=PATH `
--action_env=INCLUDE `
--action_env=LIB `
--action_env=LIBPATH
move bazel-bin\java\com\cowlark\fluxengine\fluxengine_1.0.0.msi fluxengine-1.0.0.${{ runner.arch }}.msi
move bazel-bin\java\com\cowlark\fluxengine\*.msi fluxengine-${{ runner.arch }}.msi

- name: date
run: |
Expand All @@ -193,15 +193,15 @@ jobs:
token: ${{ github.token }}
tag: dev
assets: |
fluxengine-1.0.0.${{ runner.arch }}.msi
fluxengine-${{ runner.arch }}.msi
fail-if-no-assets: false

- name: release
uses: softprops/action-gh-release@v1
with:
name: Development build ${{ env.RELEASE_DATE }}
files: |
fluxengine/fluxengine-1.0.0.${{ runner.arch }}.msi
fluxengine/fluxengine-${{ runner.arch }}.msi
tag_name: dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ opencode.json
fluxengine.iml
/nbproject/private/
images/
.bazelbsp/
.bazelproject
20 changes: 10 additions & 10 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ Useful commands:
- Because there is no WORKSPACE, Java rules are **not autoloaded**. Every BUILD file must
explicitly load what it uses, e.g.
`load("@rules_java//java:defs.bzl", "java_library", "java_binary", "java_plugin", "java_test")`.
- `javax.usb.properties` must sit at the **classpath root** (the usb4java `Services`
constructor requires it via `UsbHostManager.getProperties()`). It lives at
`java/javax.usb.properties`, is exported from `java/BUILD.bazel`, and is pulled in as a
resource (`resources = ["//java:javax.usb.properties"]`) by the usb library. Bazel's
resource jarring strips the leading `java/`, so it lands at the jar root. Do not move it
into the package directory.
- The `.deb` and `.rpm` installers are built with jpackage via the `jpackage` rule in
`jpackage.bzl` (which uses the configured Java toolchain's `jpackage`). Because `rpmbuild`
writes to `/var/tmp` and read-only sandbox paths by default, the rule stages everything
Expand Down Expand Up @@ -73,11 +67,17 @@ Useful commands:
## USB

- `UsbFinder` (`java/com/cowlark/fluxengine/usb/`) is the Java port of
`lib/usb/usbfinder.{cc,h}`. It uses usb4java-javax (javax.usb API). `UsbFinder` is
Dagger-injectable (`@Inject` constructor, instance methods) and `findUsbDevices()`
returns an `ImmutableList<CandidateDevice>`.
`lib/usb/usbfinder.{cc,h}`. It uses `org.usb4java` directly (`Device`/`DeviceDescriptor`/
`DeviceHandle`/`LibUsb`); enumeration goes through a singleton `UsbContext` (explicit
`Context` via `LibUsb.init`/`exit` with shutdown hook) and `LibUsb.getDeviceList`/
`freeDeviceList` with `refDevice`/`unrefDevice` so `CandidateDevice.device` is a retained
`Device` (not an open handle). `HackyUsbSerialNumberResolver` still provides the Windows
SetupAPI fallback. `FluxEngineUsbDevice` opens the retained `Device` to a `DeviceHandle`,
claims interface 0, and uses `LibUsb.interruptTransfer` for `CMD_*` and
`LibUsb.bulkTransfer` for `DATA_*`.
- `DeviceType` is an enum carrying its display name as a property (`getDeviceName()`).
- jSerialComm is available for serial-port access (not yet used).
- jSerialComm is available for serial-port access (used by Greaseweazle/Applesauce via
`Serial` and `findSerialPort`).

## Code style

Expand Down
6 changes: 2 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_java", version = "9.1.0")
bazel_dep(name = "rules_jvm_external", version = "6.7")
bazel_dep(name = "rules_java", version = "9.3.0")
bazel_dep(name = "rules_jvm_external", version = "7.1")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "protobuf", version = "33.4", repo_name = "com_google_protobuf")

Expand All @@ -17,10 +17,8 @@ maven.install(
"com.google.guava:guava:32.0.1-jre",
"com.google.truth:truth:1.4.5",
"com.jayway.jsonpath:json-path:3.0.0",
"javax.usb:usb-api:1.0.2",
"junit:junit:4.13.2",
"org.usb4java:usb4java:1.3.0",
"org.usb4java:usb4java-javax:1.3.0",
"com.formdev:flatlaf:3.7.2",
"com.formdev:flatlaf-swingx:3.7.2",
"org.exbin.bined:bined-core:0.2.2",
Expand Down
Loading
Loading