-
Notifications
You must be signed in to change notification settings - Fork 7
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 #161 from jonas/doc-update
Reorganize and improve documentation
- Loading branch information
Showing
33 changed files
with
492 additions
and
397 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
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
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,55 @@ | ||
# Generating Bindings with the CLI | ||
|
||
Statically linked executables are provided with each release for Linux and macOS. Head over to the [releases page] to download the latest version for your platform. | ||
|
||
[releases page]: https://github.com/kornilova-l/scala-native-bindgen/releases | ||
|
||
@@@ note | ||
|
||
In the following we assume you have renamed the downloaded `scala-native-bindgen-$PLATFORM` file to `scala-native-bindgen`. | ||
|
||
@@@ | ||
|
||
## Command Line Usage | ||
|
||
When generating bindings with the CLI, you need to specify the header file and provide the name of the created bindings using the `--name` option: | ||
|
||
```sh | ||
scala-native-bindgen --name fnmatch /usr/include/fnmatch.h -- | ||
``` | ||
|
||
When running the CLI it will also yield warnings along with the translation. To keep only the bindings please redirect the output to a file like this: | ||
|
||
```sh | ||
scala-native-bindgen --name fnmatch /usr/include/fnmatch.h -- > fnmatch.scala | ||
``` | ||
|
||
By default it is assumed that you want to link with a library based on the name option. | ||
In case the name of the library to link with is different from the binding name provide the library name using `--link`: | ||
|
||
```sh | ||
scala-native-bindgen --name zlib --link z /usr/include/zlib.h -- | ||
``` | ||
|
||
If the binding does not require any linking, pass `--no-link`: | ||
|
||
```sh | ||
scala-native-bindgen --name fnmatch --no-link /usr/include/fnmatch.h -- | ||
``` | ||
|
||
For libraries that require linking you m | ||
|
||
## Options | ||
|
||
The generated bindings can be configured using the different options and it is also possible to pass arguments directly to the Clang compiler using the `--extra-arg*` options. | ||
|
||
| Option | Description | ||
|----------------------|---------------------------------------------------------------------------------| | ||
| `--link` | Library to link with, e.g. `--link` uv for libuv. | ||
| `--no-link` | Library does not require linking. | ||
| `--name` | Scala object name that contains bindings. Default value set to library name. | ||
| `--package` | Package name of generated Scala file. | ||
| `--exclude-prefix` | Functions and unused typedefs will be removed if their names have given prefix. | ||
| `--binding-config` | Path to a config file that contains the information about bindings that should be reused. See @ref:[Integrating Bindings](integrating-bindings.md) for more information. | ||
| `--extra-arg` | Additional argument to append to the compiler command line. | ||
| `--extra-arg-before` | Additional argument to prepend to the compiler command line. |
This file was deleted.
Oops, something went wrong.
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
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 @@ | ||
../../../../CONTRIBUTING.md |
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,15 @@ | ||
# Contributor's Guide | ||
|
||
Contributions to the project is very welcome. This section provides more | ||
information about how to build and contribute to the project. | ||
|
||
@@ toc | ||
|
||
@@@ index | ||
|
||
* [guidelines](guidelines.md) | ||
* [cmake](cmake.md) | ||
* [docker-compose](docker-compose.md) | ||
* [releasing](releasing.md) | ||
|
||
@@@ |
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,21 @@ | ||
# Release Workflow | ||
|
||
First build the `scala-native-bindgen` executable for both macOS and | ||
Linux: | ||
|
||
```sh | ||
scripts/prepare-release.sh | ||
``` | ||
|
||
You should now have `scala-native-bindgen-linux` and | ||
`scala-native-bindgen-darwin` if you ran the script on a macOS machine. | ||
|
||
Then release version `x.y.z` by running: | ||
|
||
```sh | ||
sbt -Dproject.version=x.y.z release | ||
``` | ||
|
||
Finally, upload the `scala-native-bindgen-linux` and | ||
`scala-native-bindgen-darwin` executables to the release page at: | ||
<https://github.com/kornilova-l/scala-native-bindgen/releases/tag/vx.y.z> |
Oops, something went wrong.