-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from alexarchambault/static-jni
Generate and publish a .lib file
- Loading branch information
Showing
10 changed files
with
147 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# coursier-jni-utils | ||
|
||
*coursier-jni-utils* is a small library allowing to tap into various Windows | ||
native API from Java / Scala via JNI. | ||
|
||
|
||
## Developer docs | ||
|
||
*coursier-jni-utils* is built with | ||
[Mill](https://com-lihaoyi.github.io/mill). It comes upwith Mill launchers | ||
(`mill`, `mill.bat`), so that only a JVM and [mingw](https://www.mingw-w64.org) | ||
should be needed to build it. | ||
|
||
### Requirements | ||
|
||
#### JVM | ||
|
||
A JVM, such as AdoptOpenJDK 8 or 11, is required. | ||
`java -version` should work fine, and print a version | ||
higher than or equal to `8`. | ||
|
||
#### mingw | ||
|
||
[mingw](https://www.mingw-w64.org) is required to build the dll files out of | ||
`.h` / `.c` files calling native Windows native APIs, and interfacing with JNI. | ||
|
||
On Windows, the *coursier-jni-utils* build assumes mingw is installed under | ||
`C:\msys64`. If it's installed at a different location, edit the `msys2Entrypoint` | ||
method in `deps.sc` accordingly. | ||
|
||
On Linux and macOS, the *coursier-jni-utils* build mingw gcc can be run with | ||
`x86_64-w64-mingw32-gcc`. | ||
|
||
### IDE | ||
|
||
[IntelliJ IDEA](https://www.jetbrains.com/idea) is the recommended IDE to | ||
develop on jni-utils. Prior to opening the project with IDEA, run | ||
```text | ||
$ ./mill mill.scalalib.GenIdea/idea | ||
``` | ||
|
||
Then open the `jni-utils` directory in IDEA. | ||
|
||
### Compiling | ||
|
||
```text | ||
$ ./mill __.compile | ||
``` | ||
|
||
This should automatically compile `.h` / `.c` files with mingw, create a | ||
corresponding `.dll`, and make it available as a resource from Java. | ||
|
||
### Running tests | ||
|
||
Some simple tests can be run with | ||
```text | ||
$ ./mill __.test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters