Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 7 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Build and Test
permissions:
contents: read
pull-requests: write
on:
push:
branches:
Expand All @@ -18,8 +21,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 +37,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
11 changes: 9 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
name: Publish package maven
permissions:
contents: read
pull-requests: read
on:
release:
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'
Expand All @@ -22,4 +29,4 @@ jobs:
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