This repository has been archived by the owner on Oct 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use bindgen bash scripts in GitHub Actions
- Loading branch information
1 parent
8ce0c22
commit fcce562
Showing
4 changed files
with
62 additions
and
6 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,38 @@ | ||
#!/bin/bash | ||
DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
function get_host_operating_system() { | ||
local UNAME_STRING="$(uname -a)" | ||
case "${UNAME_STRING}" in | ||
*Microsoft*) local HOST_OS="windows";; | ||
*microsoft*) local HOST_OS="windows";; | ||
Linux*) local HOST_OS="linux";; | ||
Darwin*) local HOST_OS="macos";; | ||
CYGWIN*) local HOST_OS="linux";; | ||
MINGW*) local HOST_OS="windows";; | ||
*Msys) local HOST_OS="windows";; | ||
*) local HOST_OS="UNKNOWN:${UNAME_STRING}" | ||
esac | ||
echo "$HOST_OS" | ||
return 0 | ||
} | ||
|
||
OS="$(get_host_operating_system)" | ||
|
||
if [[ "$OS" == "windows" ]]; then | ||
CASTFFI_CONFIG_FILE_PATH="$DIRECTORY/config-extract-windows.json" | ||
elif [[ "$OS" == "macos" ]]; then | ||
CASTFFI_CONFIG_FILE_PATH="$DIRECTORY/config-extract-macos.json" | ||
elif [[ "$OS" == "linux" ]]; then | ||
CASTFFI_CONFIG_FILE_PATH="$DIRECTORY/config-extract-linux.json" | ||
else | ||
echo "Error: Unknown operating system '$OS'" >&2 | ||
exit 1 | ||
fi | ||
|
||
if ! [[ -x "$(command -v castffi)" ]]; then | ||
echo "Error: 'castffi' is not installed. Please visit https://github.com/bottlenoselabs/CAstFfi for instructions to install the CAstFfi tool." >&2 | ||
exit 1 | ||
fi | ||
|
||
castffi extract --config "$CASTFFI_CONFIG_FILE_PATH" |
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,9 @@ | ||
#!/bin/bash | ||
DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
if ! [[ -x "$(command -v c2cs)" ]]; then | ||
echo "Error: 'c2cs' is not installed. Please visit https://github.com/bottlenoselabs/C2CS for instructions to install the C2CS tool." >&2 | ||
exit 1 | ||
fi | ||
|
||
c2cs generate -config "$DIRECTORY/config-generate-cs.json" |
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,9 @@ | ||
#!/bin/bash | ||
DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
if ! [[ -x "$(command -v castffi)" ]]; then | ||
echo "Error: 'castffi' is not installed. Please visit https://github.com/bottlenoselabs/CAstFfi for instructions to install the CAstFfi tool." >&2 | ||
exit 1 | ||
fi | ||
|
||
castffi merge --inputDirectoryPath "$DIRECTORY/ast" --outputFilePath "$DIRECTORY/x-ast/ast-cross-platform.json" |