Skip to content

Commit

Permalink
kram - fix builds to group output for my sanity
Browse files Browse the repository at this point in the history
The xcodebuild output is voluminous with args.  So group the output.
  • Loading branch information
alecazam committed Mar 5, 2024
1 parent da78241 commit 0fe6326
Showing 1 changed file with 46 additions and 15 deletions.
61 changes: 46 additions & 15 deletions scripts/cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# note: zsh works on osx, but not on Win git bash, so using bash

# here is a post about grouping output using echo
# https://github.com/orgs/community/discussions/25314

#-----------------------------------------------

# write out the git tag as a version.h file in a
Expand Down Expand Up @@ -52,7 +55,8 @@ fi
# can't just use cmake .. on osx, cmake gets confused about metal files since language not recognized
# but Xcode knows how to build these. I don't want to setup special rule for metal files right now.
if [[ $buildType == macos ]]; then

echo "::group::kram-mac"

# not using CMake anymore on mac/iOS. Using custom workspace and projects.
#cmake .. -G Xcode
# build the release build
Expand All @@ -66,42 +70,61 @@ if [[ $buildType == macos ]]; then
# build libraries
# see here about destination arg
# https://github.com/appcelerator/titanium_mobile/pull/13098
xcodebuild build -sdk iphoneos -workspace kram.xcworkspace -scheme kram-ios -configuration Release -destination generic/platform=iOS CONFIGURATION_BUILD_DIR=${binPath} BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild build -sdk macosx -workspace kram.xcworkspace -scheme kram -configuration Release -destination generic/platform=macOS CONFIGURATION_BUILD_DIR=${binPath} BUILD_LIBRARY_FOR_DISTRIBUTION=YES

echo "::group::kram-ios"
xcodebuild build -sdk iphoneos -workspace kram.xcworkspace -scheme kram-ios -configuration Release -destination generic/platform=iOS CONFIGURATION_BUILD_DIR=${binPath} BUILD_LIBRARY_FOR_DISTRIBUTION=YES
echo "::endgroup::"

echo "::group::kram"
xcodebuild build -sdk macosx -workspace kram.xcworkspace -scheme kram -configuration Release -destination generic/platform=macOS CONFIGURATION_BUILD_DIR=${binPath} BUILD_LIBRARY_FOR_DISTRIBUTION=YES
echo "::endgroup::"

# install apps so they are signed
# can't specify empty INSTALL_PATH, or xcodebuild succeeds but copies nothing to bin
xcodebuild install -sdk macosx -workspace kram.xcworkspace -scheme kramc -configuration Release -destination generic/platform=macOS DSTROOT=${binHolderPath} INSTALL_PATH=bin
echo "::group::kramc"
xcodebuild install -sdk macosx -workspace kram.xcworkspace -scheme kramc -configuration Release -destination generic/platform=macOS DSTROOT=${binHolderPath} INSTALL_PATH=bin
echo "::endgroup::"

echo "::group::kramv"
xcodebuild install -sdk macosx -workspace kram.xcworkspace -scheme kramv -configuration Release -destination generic/platform=macOS DSTROOT=${binHolderPath} INSTALL_PATH=bin

echo "::endgroup::"

popd

# build hlslparser to bin directory
pushd hlslparser
xcodebuild install -sdk macosx -project hlslparser.xcodeproj -configuration Release -destination generic/platform=macOS DSTROOT=${binHolderPath} INSTALL_PATH=bin
echo "::group::hlsl-parser"
xcodebuild install -sdk macosx -project hlslparser.xcodeproj -configuration Release -destination generic/platform=macOS DSTROOT=${binHolderPath} INSTALL_PATH=bin
echo "::endgroup::"
popd

# build kram-profile to bin directory
pushd kram-profile
echo "::group::kram-profiler"
xcodebuild install -sdk macosx -project kram-profile.xcodeproj -configuration Release -destination generic/platform=macOS DSTROOT=${binHolderPath} INSTALL_PATH=bin
echo "::endgroup::"
popd

echo "::endgroup::"

elif [[ $buildType == windows ]]; then
mkdir -p build
echo "::group::kram-win"
mkdir -p build

pushd build


# DONE: update to VS2022 and use clang
cmake .. -G "Visual Studio 17 2022" -T ClangCL -A x64

# build the release build
cmake --build . --config Release

# copy it to bin directory
cmake --install . --config Release

popd
cmake --install . --config Release

popd
echo "::endgroup::"

# mingW doesn't like running this Win style command line
# see here for another method https://github.com/microsoft/setup-msbuild
# just added the parser to cmake
Expand All @@ -112,24 +135,30 @@ elif [[ $buildType == windows ]]; then
#popd

elif [[ $buildType == linux ]]; then
mkdir -p build
echo "::group::kram-linux"

mkdir -p build

pushd build

cmake ..
cmake ..

# build the release build
cmake --build . --config Release

# copy it to bin directory
cmake --install . --config Release

popd
popd
echo "::endgroup::"

fi


#---------------------------------

echo "::group::archive"

pushd bin

# put these in with the zip
Expand All @@ -143,5 +172,7 @@ if [[ $buildType == windows ]]; then
else
zip -r "kram-${buildType}.zip" .
fi

popd

echo "::endgroup::"

0 comments on commit 0fe6326

Please sign in to comment.