-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
47 additions
and
26 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,37 @@ | ||
#!/bin/bash | ||
#USAGE flag "--arch <arch>" help="Build architecture (x86_64, arm64, release)" | ||
|
||
set -eo pipefail | ||
|
||
SWIFT_BUILD_FLAGS="--product periphery --configuration release --disable-sandbox --scratch-path .build" | ||
EXECUTABLE_X86_64="$(swift build ${SWIFT_BUILD_FLAGS} --arch x86_64 --show-bin-path)/periphery" | ||
EXECUTABLE_ARM64="$(swift build ${SWIFT_BUILD_FLAGS} --arch arm64 --show-bin-path)/periphery" | ||
|
||
build_x86_64() { | ||
swift build ${SWIFT_BUILD_FLAGS} --arch x86_64 | ||
} | ||
|
||
build_arm64() { | ||
swift build ${SWIFT_BUILD_FLAGS} --arch arm64 | ||
} | ||
|
||
if [ "$usage_arch" = "x86_64" ]; then | ||
echo "Building for x86_64" | ||
build_x86_64 | ||
echo ${EXECUTABLE_X86_64} | ||
elif [ "$usage_arch" = "arm64" ]; then | ||
echo "Building for arm64" | ||
build_arm64 | ||
echo ${EXECUTABLE_ARM64} | ||
elif [ "$usage_arch" = "release" ]; then | ||
echo "Building for release" | ||
build_x86_64 | ||
build_arm64 | ||
mkdir -p .release | ||
lipo -create -output .release/periphery ${EXECUTABLE_X86_64} ${EXECUTABLE_ARM64} | ||
strip -rSTX .release/periphery | ||
echo "$(realpath .release/periphery)" | ||
else | ||
echo "Invalid architecture. Use --arch <arch> where <arch> is x86_64, arm64 or release" | ||
exit 1 | ||
fi |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
# mise description="Lint the project" | ||
|
||
set -euo pipefail | ||
|
||
cd $MISE_PROJECT_ROOT | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
# mise description="Lint the project for CI" | ||
|
||
set -euo pipefail | ||
|
||
cd $MISE_PROJECT_ROOT | ||
|
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
set -e | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
swift build | ||
time ./.build/debug/periphery scan "$@" |
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