shellfiles/build_stx_libjava.sh
author Claus Gittinger <cg@exept.de>
Thu, 28 Mar 2019 13:54:38 +0100
changeset 542 aa25a71be62a
parent 227 8f0a7e9bddfb
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:
112
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
#!/bin/bash
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
# Simple Unix shell script to build STX:LIBJAVA using Jenkins CI
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
# Actually, it is used on Windows (with UnxUtils) as well.
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
PROJECT="STX_LIBJAVA"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
# Determine operating system, bit simple but works
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
if [ "$OS" == "Windows_NT" ]; then
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
    WIN32=1
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
    UNIX=0
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
else
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
    WIN32=0
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
    UNIX=1
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
fi
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
# Setup...
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
if [ "$WIN32" == "1" ]; then
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
    # WINDOWS
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
    # MUST export this, otherwise libjpeg fails to build!!!"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
    export BCB="C:\Borland\BCC55"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
    # To make cvs/ssh happy
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
    export CVS_RSH=plink
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
    # Set home
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
    export HOME=$USERPROFILE
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
    # Defaults
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
    export CVSROOT=":pserver:jenkinsBuild:blablu@cvs.bh.exept.de:/cvs/stx"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
    # Make using bmake here..."
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
    MAKE="cmd /C bmake.bat"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
else
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
    # LINUX
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
    # to get Mercurial
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
    export PATH=$PATH:/home/vrany/bin
226
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    34
    if [ $(uname -n) == 'exeptn' ]; then
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    35
    	# On exeptn, default Java is 1.4, sigh
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    36
    	export PATH=/usr/java/jdk1.7.0_13/bin:$PATH
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    37
    fi
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    38
112
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
    # Make using regular make here..."
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
    MAKE=make
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
    # Defaults
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
    export CVSROOT="/cvs/stx"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
fi
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
# Sorry, it's lot easier for JV to have all the messages in EN :-)
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
export LANG=en_GB.UTF-8
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
# When run interactively, Jenkins env variables
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
# may not be set...
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
if [ -z "$WORKSPACE" ]; then
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
  WORKSPACE="$PWD"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
    INTERACTIVE=1
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
else
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
    INTERACTIVE=0
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
fi
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
if [ "$INTERACTIVE" == "0" ]; then
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
  if [ "$WIN32" == "1" ]; then
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
    WORKSPACE="$PWD"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
  fi
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
fi
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
if [ -z "$BUILD_NUMBER" ]; then
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
    BUILD_NUMBER=$(date +%Y_%m_%d_interactive)
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
fi
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
#BUILD="$WORKSPACE/${PROJECT}_${BUILD_NUMBER}_linux_build"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
BUILD="build"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
echo "INFO: BUILD=\"$BUILD\""
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
if [ -d "$BUILD" ]; then
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
  echo "WARN: Build directory already exists!"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
else
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
    mkdir -p "$BUILD"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
fi
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
pushd "$BUILD"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
226
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    84
function checkout_hg {
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    85
	local directory=$1
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    86
	local repository=$2
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    87
	local branch=$3
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    88
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    89
	if [ -z "$branch" ]; then
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    90
		branch=default
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    91
	fi
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    92
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    93
    if [ -d "$directory/CVS" ]; then
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    94
      rm -rf "$directory"
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    95
    fi
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    96
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    97
    if [ ! -d "$directory" ]; then
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    98
      if ! hg clone "$repository" "$directory" -b "$branch";  then
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
    99
        echo "ERROR: HG: Cannot clone $directory";
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   100
        exit;
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   101
      fi
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   102
    else
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   103
      if ! hg --cwd "$directory" pull;  then
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   104
        echo "ERROR: HG: Cannot pull $directory";
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   105
        exit;
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   106
      fi
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   107
      if ! hg --cwd "$directory" update;  then
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   108
        echo "ERROR: HG: Cannot update $directory";
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   109
        exit;
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   110
      fi
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   111
    fi
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   112
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   113
}
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   114
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   115
112
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
if [ -z "$SKIP_CHECKOUT" ]; then
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   118
    echo "INFO: Checking out source code"
226
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   119
112
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
    # Checkout stx
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
    if [ ! -d stx ]; then
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   122
      if ! cvs co stx; then
226
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   123
        echo "ERROR: CVS: Cannot checkout stx";
112
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
        exit;
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
      fi
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
    else
113
28d9dbbe08c2 Make cvs update -d when updating CVS working copy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 112
diff changeset
   127
      (cd stx && cvs update -d)
112
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
    fi
226
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   129
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   130
    checkout_hg stx/stc /home/vrany/repositories/hg/stx.stc jv
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   131
    checkout_hg stx/librun /home/vrany/repositories/hg/stx.librun jv
112
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
226
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   133
    # stx:libjava repo is huge, so first update from local cache
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   134
    # and then fetch updates from BitBucket.  
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   135
    if [ $(uname -n) == 'exeptn' ]; then
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   136
       checkout_hg stx/libjava /home/vrany/repositories/hg/stx.libjava development
112
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
    fi
226
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   138
    checkout_hg stx/libjava https://janvrany@bitbucket.org/janvrany/stx-libjava development
112
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
else
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   141
    echo "INFO: Checkout skipped (SKIP_CHECKOUT=$SKIP_CHECKOUT)"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
fi
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   143
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   144
# Compile
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   145
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   146
if [ -z "$SKIP_COMPILE" ]; then
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   147
226
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   148
    if [ "$UNIX" == "1" ]; then
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   149
	if [ ! -f stx/configurations/myConf ]; then
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   150
	    (cd stx && ./CONFIG)
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   151
	fi
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   152
	# Hack...
227
8f0a7e9bddfb Hack - make sure makefile in stc & librun exists
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 226
diff changeset
   153
        if [ ! -f stx/stc/makefile ]; then
8f0a7e9bddfb Hack - make sure makefile in stc & librun exists
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 226
diff changeset
   154
            (cd stx/stc && ../rules/stmkmf)
8f0a7e9bddfb Hack - make sure makefile in stc & librun exists
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 226
diff changeset
   155
        fi
226
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   156
        if [ ! -f stx/librun/makefile ]; then
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   157
            (cd stx/librun && ../rules/stmkmf)
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   158
        fi
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   159
    fi
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   160
112
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   161
    echo "INFO: Compiling"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   162
    TARGETS1="stx stx/libjava stx/goodies/petitparser stx/libjava/tools stx/libjava/experiments stx/projects/smalltalk stx/librun"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   163
    for target in $TARGETS1; do
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   164
      if ! (cd "$target" && $MAKE); then
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   165
        echo "ERROR:  cannot $MAKE in $target"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   166
        exit 3
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   167
      fi
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   168
    done
226
a48cbce777eb Script fixed and changed to use jv's stc & librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 113
diff changeset
   169
112
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   170
else
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   171
    echo "INFO: Compilation skipped (SKIP_COMPILE=$SKIP_COMPILE)"
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   172
fi
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   173
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   174
popd
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   175
8df32339b6cd Added shellfiles with some Jenkins shell scripts
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   176
echo "INFO: $PROJECT SUCCESSFULLY BUILT"