forked from dotnet/corefx
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Arm64/Linux] Enable CI & official builds (dotnet#27656)
- Loading branch information
Showing
3 changed files
with
132 additions
and
0 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,63 @@ | ||
#!/bin/bash | ||
|
||
function exit_with_error { | ||
set +x | ||
|
||
local errorMessage="$1" | ||
|
||
echo "ERROR: $errorMessage" | ||
exit 1 | ||
} | ||
|
||
#Exit if input string is empty | ||
function exit_if_empty { | ||
local inputString="$1" | ||
local errorMessage="$2" | ||
|
||
if [ -z "$inputString" ]; then | ||
exit_with_error "$errorMessage" | ||
fi | ||
} | ||
|
||
# Cross builds corefx using Docker image | ||
function cross_build_native_with_docker { | ||
__currentWorkingDirectory=`pwd` | ||
|
||
# choose Docker image | ||
__dockerImage="ubuntu-16.04-cross-arm64-a3ae44b-20180315221921" | ||
__dockerEnvironmentVariables="-e ROOTFS_DIR=/crossrootfs/arm64" | ||
|
||
__dockerCmd="docker run ${__dockerEnvironmentVariables} -i --rm -v $__currentWorkingDirectory:/opt/code -w /opt/code $__dockerImage" | ||
|
||
# Cross building corefx with rootfs in Docker | ||
__buildNativeCmd="./build-native.sh -buildArch=arm64 -$__buildConfig -- cross" | ||
|
||
$__dockerCmd $__buildNativeCmd | ||
sudo chown -R $(id -u -n) ./bin | ||
} | ||
|
||
__buildConfig= | ||
for arg in "$@" | ||
do | ||
case $arg in | ||
--buildConfig=*) | ||
__buildConfig="$(echo ${arg#*=} | awk '{print tolower($0)}')" | ||
if [[ "$__buildConfig" != "debug" && "$__buildConfig" != "release" ]]; then | ||
exit_with_error "--buildConfig can be only Debug or Release" | ||
fi | ||
;; | ||
*) | ||
;; | ||
esac | ||
done | ||
|
||
set -x | ||
set -e | ||
|
||
exit_if_empty "$__buildConfig" "--buildConfig is a mandatory argument, not provided" | ||
|
||
#Complete the cross build | ||
(set +x; echo 'Building corefx...') | ||
cross_build_native_with_docker | ||
|
||
(set +x; echo 'Build complete') |
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