Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 4 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ jobs:
mac-backend: jdk
- image: macos-latest
mac-backend: fsevents
- image: macos-13
mac-backend: fsevents
- image: windows-latest
jdk: [11, 17, 21]
jdk: [11, 21]

fail-fast: false
runs-on: ${{ matrix.os.image }}
Expand All @@ -32,9 +34,8 @@ jobs:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: 'maven'
#- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: ./update-rust-jni-libs.sh -r
if: ${{ matrix.os.image == 'macos-latest' }}
if: startsWith(matrix.os.image, 'macos-')

- name: test
run: mvn -B clean test "-Dwatch.mac.backend=${{ matrix.os.mac-backend }}"
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
runs-on: macos-latest # for now build on macos for the jni
steps:
- uses: actions/checkout@v4

# build jni libs on osx
- run: ./update-rust-jni-libs.sh -r

- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Publish package
run: mvn -B -P release deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USER }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }}
GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSPHRASE }}
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Features:
- monitor a directory for changes to its direct children
- monitor a directory for changes for all its descendants (aka recursive directory watch)
- high-resolution events (on macOS we use the native [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) API to circumvent the polling behavior of the JDK [WatchService](https://docs.oracle.com/javase/8/docs/api/java/nio/file/WatchService.html))
- Java 11 and higher are supported
- edge cases dealt with:
- recursive watches will also continue in new directories
- multiple watches for the same directory are merged to avoid overloading the kernel
Expand All @@ -25,8 +26,6 @@ Planned features:
- Support single file watches natively in linux (see [#11](https://github.com/SWAT-engineering/java-watch/issues/11))
- Monitor only specific events (such as only CREATE events)



## Usage

Import dependency in pom.xml:
Expand Down
Loading