File tree Expand file tree Collapse file tree 8 files changed +6
-534
lines changed
main/java/engineering/swat/watch/impl
test/java/engineering/swat/watch/impl/mac Expand file tree Collapse file tree 8 files changed +6
-534
lines changed Original file line number Diff line number Diff line change 7474 <checkerframework .version>3.49.5</checkerframework .version>
7575 <junit .version>5.13.2</junit .version>
7676 <log4j .version>2.25.0</log4j .version>
77- <jna .version>5.17.0</jna .version>
7877 <maven .compiler.source>11</maven .compiler.source>
7978 <maven .compiler.target>11</maven .compiler.target>
8079 <watch .mac.backend>fsevents</watch .mac.backend>
242241 <version >${log4j.version} </version >
243242 <scope >test</scope >
244243 </dependency >
245- <dependency >
246- <groupId >net.java.dev.jna</groupId >
247- <artifactId >jna</artifactId >
248- <version >${jna.version} </version >
249- </dependency >
250- <dependency >
251- <groupId >net.java.dev.jna</groupId >
252- <artifactId >jna-platform</artifactId >
253- <version >${jna.version} </version >
254- </dependency >
255244 </dependencies >
256245
257246 <profiles >
Original file line number Diff line number Diff line change 5656
5757import engineering .swat .watch .DaemonThreadPool ;
5858import engineering .swat .watch .impl .mac .MacWatchService ;
59+ import engineering .swat .watch .impl .mac .NativeLibrary ;
5960import engineering .swat .watch .impl .util .SubscriptionKey ;
6061
6162/**
@@ -189,7 +190,7 @@ public Watchable newWatchable(Path path) {
189190 static final Platform CURRENT = current (); // Assumption: the platform doesn't change
190191
191192 private static Platform current () {
192- if (com . sun . jna . Platform .isMac ()) {
193+ if (NativeLibrary .isMac ()) {
193194 var key = "engineering.swat.java-watch.mac" ;
194195 var val = System .getProperty (key );
195196 if (val != null ) {
Original file line number Diff line number Diff line change 3030import java .io .IOException ;
3131import java .nio .file .Path ;
3232
33- // Note: This file is designed to be the only place in this package where JNA is
34- // used and/or the native APIs are invoked. If the need to do so arises outside
35- // this file, consider extending this file to offer the required services
36- // without exposing JNA and/or the native APIs.
33+ // Note: This file is designed to be the only place in this package where native
34+ // APIs are invoked. If the need to do so arises outside this file, consider
35+ // extending this file to offer the required services without the native APIs.
3736
3837/**
3938 * <p>
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public class NativeLibrary {
4040 public static native long start (String path , NativeEventHandler handler );
4141 public static native void stop (long watchId );
4242
43- private static boolean isMac () {
43+ public static boolean isMac () {
4444 var os = System .getProperty ("os.name" );
4545 return os != null && (os .toLowerCase ().contains ("mac" ) || os .toLowerCase ().contains ("darwin" ));
4646 }
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments