forked from shader-slang/slang-vscode-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-package.sh
33 lines (27 loc) · 1004 Bytes
/
build-package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
npm install
npm install -g @vscode/vsce
target_build() {
TEMP_DIR="$(mktemp -d)"
ZIP="$1"
TARGET="$2"
TEMP_LIBRARY="$3"
TEMP_EXECUTABLE="$4"
echo "extracting $ZIP"
unzip -n "$ZIP" -d "$TEMP_DIR"
echo "installing binaries for $TARGET"
mkdir -p "./server/bin/$TARGET"
cp "$TEMP_DIR/$TEMP_LIBRARY" ./server/bin/"$TARGET"/
cp "$TEMP_DIR/$TEMP_EXECUTABLE" ./server/bin/"$TARGET"/
chmod +x ./server/bin/"$TARGET"/*
echo "building for $TARGET"
vsce package --target "$TARGET"
echo "cleanup for $TARGET"
rm -rf $TEMP_DIR
rm -rf ./server/bin/
}
target_build "$WIN32_X64_ZIP" win32-x64 bin/slang.dll bin/slangd.exe
target_build "$WIN32_ARM64_ZIP" win32-arm64 bin/slang.dll bin/slangd.exe
target_build "$LINUX_X64_ZIP" linux-x64 lib/libslang.so bin/slangd
target_build "$LINUX_ARM64_ZIP" linux-arm64 lib/libslang.so bin/slangd
target_build "$DARWIN_X64_ZIP" darwin-x64 lib/libslang.dylib bin/slangd
target_build "$DARWIN_ARM64_ZIP" darwin-arm64 lib/libslang.dylib bin/slangd