shellfiles/build_mercurial.sh.in
author Claus Gittinger <cg@exept.de>
Thu, 28 Mar 2019 13:54:38 +0100
changeset 542 aa25a71be62a
parent 159 40cdb9aa191d
permissions -rw-r--r--
#DOCUMENTATION by cg class: stx_goodies_builder_quickSelfTest class definition class: stx_goodies_builder_quickSelfTest class added:18 methods
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
159
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
#!/bin/bash 
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
# Simple Unix shell script to build Mercurial using Jenkins CI
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
# Designed to run under Cygwin as well. 
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
PROJECT="Mercurial Support"
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
m4_include(common.sh.in)
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
# Checkout
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
function checkout {
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
    # Checkout stx
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
    if [ ! -d stx ]; then
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
      if ! cvs co stx; then
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
        error "CVS: Cannot checkout stx";
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
      fi
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
    #else
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
    #  (cd stx && cvs update -d)
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
    fi
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
    # Checkout stx:libscm
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
    repo="https://bitbucket.org/janvrany/stx-libscm"
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
    if [ ! -d stx/libscm ]; then
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
        hg clone "$repo" stx/libscm || error "HG: cannot clone stx:libscm"
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
    else
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
        hg --cwd stx/libscm pull "$repo" || error "HG: cannot pull stx:libscm"
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
        hg --cwd stx/libscm update || error "HG: cannot update stx:libscm"
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
    fi
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
}
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
# Compile
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
function compile {
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
    TARGETS1="stx stx/libscm/common stx/libscm/mercurial stx/librun"
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
    for target in $TARGETS1; do
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
      if ! (cd "$target" && mk); then
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
        echo "ERROR:  cannot $MAKE in $target"
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
        exit 3
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
      fi
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
    done
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
}
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
function runtests {
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
    sunit "stx:libscm/mercurial"
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
}
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
# Now, call main
40cdb9aa191d Add support for generating build scripts using M4 preprocessor
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
main $1 $2 $3