Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INFRA - Cross-platform Build Script #80

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#|| goto :windows_code

echo "Building main workspace"
if cargo build --quiet; then
echo "Successfully built main workspace"
else
echo "Failed to build main workspace"
exit 1
fi
cd boards || exit 1
for dir_name in *; do
if [ -d "$dir_name" ]; then
cd "$dir_name"
if cargo build --quiet; then
echo "Successfully built $dir_name"
else
echo "Failed to build $dir_name"
fi
cd ..
else
echo "Skipping $dir_name as it is not a directory"
fi
done


#windows_code below
exit
:windows_code
echo Building main workspace
cargo build --quiet
if %ERRORLEVEL% NEQ 0 (
echo Failed to build main workspace
exit /b 1
) else (
echo Successfully built main workspace
)

cd boards || exit /b 1
for /d %%d in (*) do (
if exist "%%d" (
cd "%%d"
cargo build --quiet
if %ERRORLEVEL% NEQ 0 (
echo Failed to build %%d
) else (
echo Successfully built %%d
)
cd ..
) else (
echo Skipping %%d as it is not a directory
)
)
Loading