Welcome to mirror list, hosted at ThFree Co, Russian Federation.

x86_ci_script.sh « cross - github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 16b0593a5854fa5318f88d29ad6e164283a65a99 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/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=" hseok82/dotnet-buildtools-prereqs:ubuntu-16.04-crossx86-ef0ac75-20175511035548"
    __dockerEnvironmentVariables="-e ROOTFS_DIR=/crossrootfs/x86"
    __runtimeOS="ubuntu.16.04"
    
    __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=x86 -$__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" true
            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')