File tree Expand file tree Collapse file tree 4 files changed +42
-5
lines changed
Expand file tree Collapse file tree 4 files changed +42
-5
lines changed Original file line number Diff line number Diff line change 11target /
22scripts /.coursier
33scripts /.scalafmt- *
4+ /scala-native-bindgen- *
Original file line number Diff line number Diff line change @@ -8,13 +8,21 @@ This tool generates Scala Native bindings from C headers. It's built upon clang
88
99## Releasing
1010
11- To release version ` x.y.z ` run:
11+ First build the ` scala-native-bindgen ` executable for both macOS and
12+ Linux:
13+
14+ > scripts/prepare-release.sh
15+
16+ You should now have ` scala-native-bindgen-linux ` and
17+ ` scala-native-bindgen-darwin ` if you ran the script on a macOS machine.
18+
19+ Then release version ` x.y.z ` by running:
1220
1321 > sbt -Dproject.version=x.y.z release
1422
15- Then build the ` scala-native-bindgen ` executable for both macOS and
16- Linux and upload them to the GitHub release page with the suffix
17- ` -darwin ` and ` -linux ` , respectively.
23+ Finally, upload the ` scala-native-bindgen-linux ` and
24+ ` scala-native-bindgen-darwin ` executables to the release page at:
25+ < https://github.com/kornilova-l/scala-native-bindgen/releases/tag/vx.y.z >
1826
1927## License
2028
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ services:
88 args :
99 - UBUNTU_VERSION=18.04
1010 - LLVM_VERSION=6.0
11- entrypoint : [scala-native-bindgen]
11+ entrypoint : [/ scala-native-bindgen]
1212
1313 ubuntu-18.04-llvm-6.0 :
1414 image : scalabindgen/scala-native-bindgen-builder:ubuntu-18.04-llvm-6.0
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ #
3+ # Build Linux and if possible macOS executables.
4+
5+ # Bash strict mode
6+ # http://redsymbol.net/articles/unofficial-bash-strict-mode/
7+ set -euo pipefail
8+ IFS=$' \n\t '
9+
10+ ROOT=" $( cd " $( dirname " $0 " ) /.." && pwd) "
11+
12+ LINUX_EXEC=" $ROOT /scala-native-bindgen-linux"
13+ if [[ ! -e " $LINUX_EXEC " ]]; then
14+ docker-compose build bindgen
15+ local container=" $( docker container create " scalabindgen/scala-native-bindgen:${VERSION:- latest} " ) "
16+ docker cp " $container :/scala-native-bindgen" " $LINUX_EXEC "
17+ docker container rm " $container "
18+ fi
19+
20+ MACOS_EXEC=" $ROOT /scala-native-bindgen-darwin"
21+ if [[ " $( uname -s) " = " Darwin" ]] && [[ ! -e " $MACOS_EXEC " ]]; then
22+ json_dir=" $( ls /usr/local/Cellar/nlohmann_json/ | sort | tail -n 1) /include"
23+ rm -rf bindgen/target
24+ mkdir -p bindgen/target
25+ (cd bindgen/target && cmake -DSTATIC_LINKING=ON -DCMAKE_CXX_FLAGS=" -isystem $json_dir " ..)
26+ make -C bindgen/target
27+ cp bindgen/target/scala-native-bindgen " $MACOS_EXEC "
28+ fi
You can’t perform that action at this time.
0 commit comments