Repository: realm/realm-swift
File: build.sh (Shell)

Code before:

    "ci-clean")
        git reset --hard HEAD
        git clean -xfd
        (
            cd ../tightdb
            git reset --hard HEAD
            git clean -xfd
        )
        exit 0
        ;;

    "ci-test")
        mkdir -p test-reports
        (
            cd ../tightdb
            mkdir -p install
            sh build.sh config $(pwd)/install
            sh build.sh build-iphone
            sh build.sh build
            sh build.sh install
        )
        export REALM_CONFIG=../tightdb/install/bin/tightdb-config
        sh build.sh config
        sh build.sh build
        sh build.sh build-iphone
        sh build.sh ios-framework
        sh build.sh test-debug
        (
            cd doc/ref/RefDocExamples
            xctool -scheme RefDocExamples -project RefDocExamples.xcodeproj clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
        )
        (
            cd examples/RealmTableViewExample
            xctool -project RealmTableViewExample.xcodeproj -scheme RealmTableViewExample clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
        )
        exit 0;
        ;;

    "build")
        auto_configure || exit 1
# FIXME: Our language binding requires that Objective-C ARC is enabled, which, in turn, is only available on a 64-bit architecture, so for now we cannot build a "fat" version.
#        TIGHTDB_ENABLE_FAT_BINARIES="1" $MAKE || exit 1
        $MAKE || exit 1
        realm_echo "Done building"
        exit 0
        ;;

    "build-iphone")
        auto_configure || exit 1
        iphone_sdks_avail="$(get_config_param "IPHONE_SDKS_AVAIL")" || exit 1

Review comment (suggestion):
Indeed, but this is more robust. The location of tightdb-config in the repo might change in the future and this would still be working. And in the future we might need more stuff from the install folder. Also, install is very cheap so I think it fits fine in here.


Code after:

    "ci-clean")
        # DO NOT USE THIS TARGET! IT WILL RESET YOUR WORKAREA IN A NON REVERSIBLE WAY!
        git reset --hard HEAD
        git clean -xfd
        (
            cd ../tightdb
            git reset --hard HEAD
            git clean -xfd
        )
        exit 0
        ;;

    "ci-test")
        if [ "$(id -u)" != "0" ]; then
           echo "This target must be run as root or with sudo" 1>&2
           exit 1
        fi
        mkdir -p test-reports || exit 1
        (
            cd ../tightdb
            mkdir -p install
            sh build.sh config $(pwd)/install
            sh build.sh build-iphone
            sh build.sh build
            sh build.sh install
        ) || exit 1
        (
            export REALM_CONFIG=../tightdb/install/bin/tightdb-config
            sh build.sh config
            sh build.sh build-iphone
            sh build.sh ios-framework
            sh build.sh test-debug
            ) || exit 1
        (
            cd examples/RealmTableViewExample
            xctool -project RealmTableViewExample.xcodeproj -scheme RealmTableViewExample clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
        ) || exit 1
        exit 0;
        ;;

    "build")
        auto_configure || exit 1
# FIXME: Our language binding requires that Objective-C ARC is enabled, which, in turn, is only available on a 64-bit architecture, so for now we cannot build a "fat" version.
#        TIGHTDB_ENABLE_FAT_BINARIES="1" $MAKE || exit 1
        $MAKE || exit 1
        realm_echo "Done building"
        exit 0
        ;;

    "build-iphone")