Omitting Perl bindings from thrift build

#!/usr/bin/env bash
# Copyright 2012 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# cleans and rebuilds thirdparty/. The Impala build environment must be set up
# by bin/impala-config.sh before running this script.

# Exit on non-true return value
set -e
# Exit on reference to unitialized variable
set -u

bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

. "$bin"/impala-config.sh

clean_action=1

for ARG in $*
do
  case "$ARG" in
    -noclean)
      clean_action=0
      ;;
  esac
done

if [ $clean_action -eq 1 ]
then
  # clean thirdparty
  cd $IMPALA_HOME/thirdparty
  # remove everything that is not checked in
  git clean -dfx
fi

# build thrift
cd ${THRIFT_SRC_DIR}
JAVA_PREFIX=${THRIFT_HOME}/java PY_PREFIX=${THRIFT_HOME}/python \
  ./configure --with-pic --prefix=${THRIFT_HOME} \
  --with-php=no --with-java=no --with-perl=no --with-erlang=no \
  --with-ruby=no --with-haskell=no --with-erlang=no --with-d=no
make # Make with -j fails
make install
cd ${THRIFT_SRC_DIR}/contrib/fb303
chmod 755 ./bootstrap.sh
./bootstrap.sh
chmod 755 configure
CPPFLAGS="-I${THRIFT_HOME}/include" PY_PREFIX=${THRIFT_HOME}/python ./configure \
  --prefix=${THRIFT_HOME} --with-thriftpath=${THRIFT_HOME}
make
make install

# build gflags
cd $IMPALA_HOME/thirdparty/gflags-${IMPALA_GFLAGS_VERSION}
./configure --with-pic
make -j4

# Build pprof
cd $IMPALA_HOME/thirdparty/gperftools-${IMPALA_GPERFTOOLS_VERSION}
# TODO: google perf tools indicates this might be necessary on 64 bit systems.
# we're not compiling the rest of our code to not omit frame pointers but it
# still seems to generate useful profiling data.
./configure --enable-frame-pointers --with-pic
make -j4

if [ -z "$PIC_LIB_PATH" ]; then
  # Build glog
  cd $IMPALA_HOME/thirdparty/glog-${IMPALA_GLOG_VERSION}
  ./configure --with-pic
  make -j4
fi

# Build gtest
cd $IMPALA_HOME/thirdparty/gtest-${IMPALA_GTEST_VERSION}
cmake .
make -j4

# Build Snappy
cd $IMPALA_HOME/thirdparty/snappy-${IMPALA_SNAPPY_VERSION}
./configure --with-pic --prefix=$IMPALA_HOME/thirdparty/snappy-${IMPALA_SNAPPY_VERSION}/build
make install

if [ -z "$PIC_LIB_PATH" ]; then
  # Build Sasl
  # Disable everything except those protocols needed -- currently just Kerberos.
  # Sasl does not have a --with-pic configuration.
  cd $IMPALA_HOME/thirdparty/cyrus-sasl-${IMPALA_CYRUS_SASL_VERSION}
  CFLAGS="-fPIC -DPIC" CXXFLAGS="-fPIC -DPIC" ./configure \
    --disable-digest --disable-sql --disable-cram --disable-ldap \
    --disable-digest --disable-otp  \
    --prefix=$IMPALA_HOME/thirdparty/cyrus-sasl-${IMPALA_CYRUS_SASL_VERSION}/build \
    --enable-static --enable-staticdlopen
  # the first time you do a make it fails, ignore the error.
  (make || true)
  make install
fi

#!/usr/bin/env bash
# Copyright 2012 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# cleans and rebuilds thirdparty/. The Impala build environment must be set up
# by bin/impala-config.sh before running this script.

# Exit on non-true return value
set -e
# Exit on reference to unitialized variable
set -u

bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

. "$bin"/impala-config.sh

clean_action=1

for ARG in $*
do
  case "$ARG" in
    -noclean)
      clean_action=0
      ;;
  esac
done

if [ $clean_action -eq 1 ]
then
  # clean thirdparty
  cd $IMPALA_HOME/thirdparty
  # remove everything that is not checked in
  git clean -dfx
fi

# build thrift
cd ${THRIFT_SRC_DIR}
JAVA_PREFIX=${THRIFT_HOME}/java PY_PREFIX=${THRIFT_HOME}/python \
  ./configure --with-pic --prefix=${THRIFT_HOME} --with-php=no --with-java=no \
  --with-erlang=no --with-ruby=no --with-haskell=no --with-erlang=no --with-d=no
make # Make with -j fails
make install
cd ${THRIFT_SRC_DIR}/contrib/fb303
chmod 755 ./bootstrap.sh
./bootstrap.sh
chmod 755 configure
CPPFLAGS="-I${THRIFT_HOME}/include" PY_PREFIX=${THRIFT_HOME}/python ./configure \
  --prefix=${THRIFT_HOME} --with-thriftpath=${THRIFT_HOME}
make
make install

# build gflags
cd $IMPALA_HOME/thirdparty/gflags-${IMPALA_GFLAGS_VERSION}
./configure --with-pic
make -j4

# Build pprof
cd $IMPALA_HOME/thirdparty/gperftools-${IMPALA_GPERFTOOLS_VERSION}
# TODO: google perf tools indicates this might be necessary on 64 bit systems.
# we're not compiling the rest of our code to not omit frame pointers but it
# still seems to generate useful profiling data.
./configure --enable-frame-pointers --with-pic
make -j4

if [ -z "$PIC_LIB_PATH" ]; then
  # Build glog
  cd $IMPALA_HOME/thirdparty/glog-${IMPALA_GLOG_VERSION}
  ./configure --with-pic
  make -j4
fi

# Build gtest
cd $IMPALA_HOME/thirdparty/gtest-${IMPALA_GTEST_VERSION}
cmake .
make -j4

# Build Snappy
cd $IMPALA_HOME/thirdparty/snappy-${IMPALA_SNAPPY_VERSION}
./configure --with-pic --prefix=$IMPALA_HOME/thirdparty/snappy-${IMPALA_SNAPPY_VERSION}/build
make install

if [ -z "$PIC_LIB_PATH" ]; then
  # Build Sasl
  # Disable everything except those protocols needed -- currently just Kerberos.
  # Sasl does not have a --with-pic configuration.
  cd $IMPALA_HOME/thirdparty/cyrus-sasl-${IMPALA_CYRUS_SASL_VERSION}
  CFLAGS="-fPIC -DPIC" CXXFLAGS="-fPIC -DPIC" ./configure \
    --disable-digest --disable-sql --disable-cram --disable-ldap \
    --disable-digest --disable-otp  \
    --prefix=$IMPALA_HOME/thirdparty/cyrus-sasl-${IMPALA_CYRUS_SASL_VERSION}/build \
    --enable-static --enable-staticdlopen
  # the first time you do a make it fails, ignore the error.
  (make || true)
  make install
fi


/sync

/sync

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/fabge/fabge.github.io.git/'


Some UI beautification

Some UI beautification

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Gixx/docker-builder.git/'


Update

Update

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/dawikur/mnl.git/'


Always add ondrej/php for php7.1

Always add ondrej/php for php7.1

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/TheoKouzelis/my-dev-env.git/'


Add install script by sh

Add install script by sh

#!/bin/sh

echo Thank you for installing Roadagain\'s dotfiles!

echo Installing vimrc...
cp vimrc ~/.vimrc

echo Installation was successfully completed!

error: pathspec 'install.sh' did not match any file(s) known to git


Editorconfig

Editorconfig

Signed-off-by: Lorenzo Fontana <638e8f0171575864326f06d2a5f8e72287427b15@linux.com>

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/fntlnz/dotfiles.git/'


Create script install

Create script install

#!/usr/bin/env bash

if [ "$(id -u)" == "0" ]; then
   echo -e "\e[91m\e[1mThis script should NOT be run as root\e[0m" >&2
fi

cd "$(dirname "$0")"

#------------------------------------------------------------------------------

STABLE_VERSION=${STABLE_VERSION:-2.19.0}
interactive=true

usage () {
    cat >&2 <<- _EOF_
Usage: $0 project [OPTIONS]
    --noinput         do not prompt user
    -h, --help        show this help
_EOF_
    return
}

while [[ -n $1 ]]; do
    case $1 in
        --noinput )         interactive=false
                            ;;
        -h | --help )       usage
                            exit
                            ;;
        *)                  usage
                            exit
                            ;;
    esac
    shift
done

#------------------------------------------------------------------------------

# Redirect whole output to log file
touch install.log
chmod 600 install.log
exec 3>&1 4>&2
if $interactive ; then
    exec 1>> install.log 2>&1
else
    exec 1>> >( tee --append install.log) 2>&1
fi

#------------------------------------------------------------------------------
#
#  Helpers
#
#------------------------------------------------------------------------------

function echo_step () {
    set +x
    exec 2>&4
    echo -e "\n\e[92m\e[1m$1\e[0m" >&2
    exec 2>&1
    set -x
}

function echo_warn () {
    set +x
    exec 2>&4
    echo -e "\e[93m\e[1m$1\e[0m" >&2
    exec 2>&1
    set -x
}

function echo_error () {
    set +x
    exec 2>&4
    echo -e "\e[91m\e[1m$1\e[0m" >&2
    exec 2>&1
    set -x
}

function echo_progress () {
    set +x
    exec 2>&4
    echo -e ".\c" >&2
    exec 2>&1
    set -x
}

function exit_error () {
    code=$1
    shift
    echo_error "$@"
    echo "(More details in install.log)" >&2
    exit $code
}

function install_docker () {
    if [ $trusty -eq 1 ]; then
        sudo apt-get update linux-image-extra-$(uname -r) linux-image-extra-virtual
    fi
    sudo apt-get remove docker docker-engine docker.io
    sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo apt-key fingerprint 0EBFCD88
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    sudo apt-get update
    sudo apt-get install docker-ce
}

function geotrek_setup () {
    if [ $trusty -eq 1 -o $xenial -eq 1 -o $bionic -eq 1 ]; then
        install_docker
        sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) \
        -o /usr/local/bin/docker-compose
    else
        exit_error 5 "Unsupported operating system for Docker. Install Docker manually (ReadMe.md)"
    fi
    cd ..
    echo Choose your instance of geotrek
    read path_instance
    mv install $path_instance
    chown -R $USER:$USER $path_instance
    su - geotrek
    cd $path_instance
    cp ./install/.env.dist .env
    echo "Let's set the environment of install"
    nano .env
    source .env
    if [$POSTGRES_HOST]; then
        sed -e '3,9d;82,83d' < ./install/docker-compose.yml
    fi

}

precise=$(grep "Ubuntu 12.04" /etc/issue | wc -l)
trusty=$(grep "Ubuntu 14.04" /etc/issue | wc -l)
vivid=$(grep "Ubuntu 15.04" /etc/issue | wc -l)
xenial=$(grep "Ubuntu 16.04" /etc/issue | wc -l)
artful=$(grep "Ubuntu 17.04" /etc/issue | wc -l)
bionic=$(grep "Ubuntu 18.04" /etc/issue | wc -l)


Added components

Added components

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/niclupien/sakai-2.8-patch-fr_CA.git/'


Created Folder heirarchy

Created Folder heirarchy

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/WeeFeeSuite/WeeFee.git/'


Whitespace cleanups

Whitespace cleanups

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/paolodedios/dot-files.git/'


Added an installer.

Added an installer.

#!/bin/bash

mkdir -p ~/.git-merge-master/
cp git-merge-master.sh ~/.git-merge-master/

chmod +x ~/.git-merge-master/git-merge-master.sh

# Now, let's make an alias for git-merge-master in Bash
echo "alias git-merge-master='~/.git-merge-master/git-merge-master.sh'" >> ~/.bashrc


Added install script

Added install script

#!/bin/bash

# Clone and build main repository
go get -v github.com/animenotifier/notify.moe/...
cd $GOPATH/src/github.com/animenotifier/notify.moe
make all

# Database
git clone https://github.com/animenotifier/database ~/.aero/db/arn

# Configure
make ports
sudo -- sh -c -e "echo '127.0.0.1 beta.notify.moe' >> /etc/hosts"


Changed default install.sh behaviour

Changed default install.sh behaviour

Now, default option is symlink config. To move config, the -m parameter is used.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/larsbs/vimrc.git/'


adds newer packages for aarch64

adds newer packages for aarch64

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/dry-dock-aarch64/u16.git/'


Install vim plugin in installer

Install vim plugin in installer

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/ftan84/dotfiles.git/'


Update install to point towards DoSOCS master branch

#!/bin/bash
#Copyright © 2015 Daniel Patten, Zachary Meyer, and Jacob Vosik
#Setup User Name and Password for MySql
read -p "Enter your MySQL Username:" u
stty -echo
read -p "Enter your MySQL Password: " p; echo
stty echo
#Clone Repos
git clone https://github.com/SPDX-Git/SPDX-Git-Scanner
git clone https://github.com/socs-dev-env/SOCSDatabase
git clone https://github.com/socs-dev-env/DoSOCS

#Install Database
echo "Install SPDX Database..."
mysql --user=$u --password=$p < SOCSDatabase/SQL/SPDX.sql
#Exit mySql

#Delete Database Repo
echo "Setting up files..."
cp -r DoSOCS SPDX-Git-Scanner
chmod 755 SPDX-Git-Scanner/src/*.py
chmod 755 SPDX-Git-Scanner/DoSOCS/src/*.py
sudo rm DoSOCS -R
sudo rm SOCSDatabase -R
echo "Install Complete"

#!/bin/bash
#Copyright  2015 Daniel Patten, Zachary Meyer, and Jacob Vosik
#Setup User Name and Password for MySql
read -p "Enter your MySQL Username:" u
stty -echo
read -p "Enter your MySQL Password: " p; echo
stty echo
#Clone Repos
git clone https://github.com/SPDX-Git/SPDX-Git-Scanner
git clone https://github.com/socs-dev-env/SOCSDatabase
git clone https://github.com/SPDX-Git/DoSOCS

#Install Database
echo "Install SPDX Database..."
mysql --user=$u --password=$p < SOCSDatabase/SQL/SPDX.sql
#Exit mySql

#Delete Database Repo
echo "Setting up files..."
cp -r DoSOCS SPDX-Git-Scanner
chmod 755 SPDX-Git-Scanner/src/*.py
chmod 755 SPDX-Git-Scanner/DoSOCS/src/*.py
sudo rm DoSOCS -R
sudo rm SOCSDatabase -R
echo "Install Complete"


added deploy script to wp.org

added deploy script to wp.org

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/xavierpriour/timber.git/'


added mk-rpm-buildarch

added mk-rpm-buildarch

#!/bin/sh
#
# MK-RPM-BUILDARCH --Echo the RPM's value of "Buildarch".
#
# Remarks:
# RPM has a default value for Buildarch based on the current system's
# arch, but this script sniffs the ".spec" file to see if it's been
# overridden (e.g. for "noarch" packages).
#
if [ "$1" -a -f "$1" ]; then
    if grep ^Buildarch: "$1" >/dev/null 2>&1; then
	sed -ne 's/^Buildarch: *//p' "$1"
    else
	rpm --eval "%{_arch}"
    fi
else
    rpm --eval "%{_arch}"
fi

error: pathspec 'bin/mk-rpm-buildarch.sh' did not match any file(s) known to git


test scripts

test scripts

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/yukuan/cis526-hw1.git/'


Add plan for Facebook's zstd

Add plan for Facebook's zstd

Signed-off-by: Lilian A. Moraru <ec378ef1caec2f9626c9f474d39fa2b8a91642fb@gmail.com>

pkg_origin=core
pkg_name=zstd
pkg_version=1.1.0
pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>"
pkg_license=('BSD-3-Clause')
pkg_description="Zstandard is a real-time compression algorithm, providing high compression ratios. "\
"It offers a very wide range of compression / speed trade-off, while being backed by a very fast decoder"
pkg_upstream_url=http://facebook.github.io/zstd/
pkg_source="https://github.com/facebook/zstd/archive/v${pkg_version}.tar.gz"
pkg_shasum=61cbbd28ff78f658f0564c2ccc206ac1ac6abe7f2c65c9afdca74584a104ea51
pkg_deps=(core/glibc)
pkg_build_deps=(core/gcc core/make core/diffutils)
pkg_bin_dirs=(bin)
pkg_include_dirs=(include)
pkg_lib_dirs=(lib)
pkg_pconfig_dirs=(lib/pkgconfig)

do_build () {
  make PREFIX="${pkg_prefix}"
}

# Note that this will take a while because it runs a few compressions(v1 -> v20)
# Also, runs a fuzzer for 5 minutes + 2 min(zbufftest) + 2 min(zstreamtest)
do_check () {
  make test
}

error: pathspec 'zstd/plan.sh' did not match any file(s) known to git


add back build.sh as build_docker.sh

add back build.sh as build_docker.sh

#!/bin/bash
set -x
set -e
docker build -t openroad/openroad --target base-dependencies .
docker run -u $(id -u ${USER}):$(id -g ${USER}) -v $(pwd):/OpenROAD openroad/openroad bash -c "./OpenROAD/jenkins/install.sh"

error: pathspec 'jenkins/build_docker.sh' did not match any file(s) known to git


Helper bash script to build/test any of the projects (work in progress)

#!/bin/bash
TOP=`pwd`
NATIVE_TOP=$TOP/native/
HYBRID_TOP=$TOP/hybrid/
TRUE=0
FALSE=1

TARGETS_TO_BUILD=""
TARGETS_TO_TEST=""

process_args()
{
    while [ $# -gt 0 ] ; do
        case $1 in
            --help) usage ; shift 1 ;;
            -b) TARGETS_TO_BUILD="$TARGET_TO_BUILD $2" ; shift 2 ;;
            -t) TARGETS_TO_TEST="$TARGET_TO_TEST $2" ; shift 2 ;;
            *) shift 1 ;;
        esac
    done
}

usage ()
{
    echo ""
    echo "sdk.sh [-b <build_target>] [-t <test_target>] [--help]"
    echo "    <build_target> can be "
    echo "        SalesforceSDK"
    echo "        RestExplorer"
    echo "        TemplateApp"
    echo "        CloudTunes"
    echo "        SmartStorePluginTest"
    echo "        ContactExplorer"
    echo "        VFConnector"
    echo "        SFDCAccounts"
    echo "    <test_target> can be "
    echo "        SalesforceSDKTest"
    echo "        RestExplorerTest"
    echo "        SmartStorePluginTest"
    echo ""
    echo "When no arguments are passed, everything is built and tested"
}

should_build ()
{
    return [ -z "$TARGET_TO_BUILD" ] || [[ $TARGET_TO_BUILD == *$1* ]]
}

should_test ()
{
    return [ -z "$TARGET_TO_TEST" ] || [[ $TARGET_TO_TEST == *$1* ]]
}

header ()
{
    echo "********************************************************************************"
    echo "*                                                                              *"
    echo "* TOP $TOP"
    echo "* $1"
    echo "*                                                                              *"
    echo "********************************************************************************"
}

build_project ()
{
    if ( should_build $1 )
    then
        header "Building project $1"
        cd $2
        android update project -p .
        ant clean debug
        cd $TOP
    fi
}

build_test_project ()
{
    if ( should_build $1 )
    then
        header "Building test project $1"
        cd $2
        android update test-project -p . -m $3
        ant clean debug
        cd $TOP
    fi
}

run_test_project ()
{
    if ( should_test $1 )
    then
        header "Running test project $1"
        cd $2
        ant installt
        ant test
        ant uninstall
        cd $TOP
    fi
}

process_args $@
build_project "SalesforceSDK" $NATIVE_TOP/SalesforceSDK
build_project "RestExplorer" $NATIVE_TOP/RestExplorer
build_project "TemplateApp" $NATIVE_TOP/TemplateApp
build_project "CloudTunes" $NATIVE_TOP/SampleApps/CloudTunes
build_project "SFDCAccounts" $HYBRID_TOP/SampleApps/SFDCAccounts
build_project "ContactExplorer" $HYBRID_TOP/SampleApps/ContactExplorer
build_project "VFConnector" $HYBRID_TOP/SampleApps/VFConnector
build_test_project "SalesforceSDKTest" $NATIVE_TOP/SalesforceSDKTest .
build_test_project "RestExplorerTest" $NATIVE_TOP/RestExplorerTest ../RestExplorer
build_test_project "SmartStorePluginTest" $HYBRID_TOP/SmartStorePluginTest .
run_test_project "SalesforceSDKTest" $NATIVE_TOP/SalesforceSDKTest
run_test_project "RestExplorerTest" $NATIVE_TOP/RestExplorerTest
run_test_project "SmartStorePluginTest" $HYBRID_TOP/SmartStorePluginTest

echo $@

error: pathspec 'tools/sdk.sh' did not match any file(s) known to git


grr

grr

git-svn-id: 6ee47c8665bf46900d9baa0afb711c5b4a0eafac@336 e2bb083e-7f23-0410-b3a8-8253ac9ef6d8

#!/bin/bash

OUTDIR=$PWD
LOGCOUNT=0
SEQ=1
DATE=`date +"%y%m%d"`
TIME=`date +"%T %Z(%z)"`
RUNDIRBASE="run-$DATE"
RUNDIR=$OUTDIR/$RUNDIRBASE
mkdir -p $RUNDIR

if [ "$1" == "-fco" ]; then
	FCO=1
	shift
elif [ "$2" == "-fco" ]; then
	FCO=1
fi

if [ "$1" == "" ]; then
	OUTBASE=$RUNDIRBASE/tests.log
else
	OUTBASE=$RUNDIRBASE/$1
fi
OUT=$OUTDIR/$OUTBASE

head() {
	HTMLBASE=tests-$DATE.html
	HTML=$OUTDIR/$HTMLBASE
	rm -f $OUTDIR/current.html

	#This doesn't work well with servers that don't follow symlinks
	#ln -s $HTML $OUTDIR/current.html

	cat <<DOH >$OUTDIR/current.html

		<title>Redirecting...</title>
		<meta http-equiv="cache-control" content="no-cache">

		You should be redirected to $HTMLBASE

DOH
	cat <<DOH >$HTML

		<title>VDL2 nightly integration tests and build ($DATE $TIME)</title>

VDL2 nightly integration tests and build ($DATE $TIME)

Test results

Compiled packages

Older tests

How to add new tests

DOH
	FIRSTTEST=1
}

html() {
	echo $@ >>$HTML
}

tail() {
	MONTHS=("" "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")
	html "

"

	if [ "$BINPACKAGE" != "" ]; then
		FBP=$OUTDIR/$BINPACKAGE
		SIZE=`ls -hs $FBP`
		SIZE=${SIZE/$FBP}
		cat <<DOH >>$HTML

Binary packages

	$BINPACKAGE ($SIZE)

DOH
	fi

	LASTYR="00"
	LASTMO="00"
	html "
Older tests
"
	html ''
	html "

"
	for OLDER in `ls $OUTDIR/tests-*.html|sort`; do
		O=`basename $OLDER`
		YR=${O:6:2}
		MO=${O:8:2}
		DY=${O:10:2}
		if [ $LASTYR != $YR ]; then
			html "

"
			html "
20$YR
"
			LASTYR=$YR
		fi
		if [ $LASTMO != $MO ]; then
			html "

"
			html "
${MONTHS[$MO]}
"
			html "

"
			LASTMO=$MO
		fi
		html "$DY	"
	done
	html "

"
	cat <<DOH >>$HTML
	How to add new tests

DOH
}

outecho() {
	TYPE=$1
	shift
	echo "<$TYPE>$1|$2|$3|$4|$5|$6|$7|$8|$9|"
}

out() {
	echo $@
	TYPE=$1
	if [ "$TYPE" == "test" ]; then

		NAME=$2
		SEQ=$3
		CMD=$4
		RES=$5
		LOG=$6

		if [ "$FIRSTTEST" == "1" ]; then
			html "
Test results
"
			html ""
			html "Output log from tests"
			html "
"
			FIRSTTEST=0
		else
			if [ "$FLUSH" == "1" ]; then
				html "

"
			fi
		fi

		if [ "$TESTPART" != "" ]; then
			html "
$TESTPART
"
			TESTPART=
		fi

		if [ "$FLUSH" == "1" ]; then
			html "
$NAME:

"
		fi
		if [ ${#SEQ} -gt 2 ]; then
			WIDTH=""
		else
			WIDTH="width=\"20\""
		fi
		if [ "$RES" == "Passed" ]; then
			html ""
			html "$SEQ"
		else
			html ""
			html "$SEQ"
		fi
		html "	"

	elif [ "$TYPE" == "package" ]; then
		BINPACKAGE=$2
	else
		html $@
	fi

}

aexec() {
	echo Executing "$@" >>$OUT
	rm -f $OUTDIR/x73010test.log
	LASTCMD="$@"
	"$@" >$OUTDIR/x73010test.log 2>&1
	EXITCODE=$?
	if [ "$EXITCODE" == "127" ]; then
		echo "Command not found: $@" >$OUTDIR/x73010test.log
	fi
	if [ -f $OUTDIR/x73010test.log ]; then
		cat $OUTDIR/x73010test.log >>$OUT
	fi

}

tlog() {
	TLOG="output_$LOGCOUNT.txt"
	rm -f $RUNDIR/$TLOG
	banner "$LASTCMD" $RUNDIR/$TLOG
	if [ -f $OUTDIR/x73010test.log ]; then
		cat $OUTDIR/x73010test.log >>$RUNDIR/$TLOG 2>>$OUT
	fi
	TLOG="$RUNDIRBASE/$TLOG"
	let "LOGCOUNT=$LOGCOUNT+1"
}

fexec() {
	FLUSH=1
	banner "$TEST (faked)"
	echo "Faking $TEST"
	EXITCODE=0
	LASTCMD=""
	vtest
}

banner() {
	if [ "$2" == "" ]; then
		BOUT=$OUT
	else
		BOUT=$2
	fi
	echo "">>$BOUT
	echo "*****************************************************************************************">>$BOUT
	echo "* $1" >>$BOUT
	echo "*****************************************************************************************">>$BOUT
}

pexec() {
	banner "$TEST (part $SEQ)"
	echo "Executing $TEST (part $SEQ)"
	aexec "$@"
	ptest
	let "SEQ=$SEQ+1"
	FLUSH=0
}

ssexec() {
	SEQSAVE=$SEQ
	SEQ=$1
	shift
	banner "$TEST (part $SEQ)"
	echo "Executing $TEST (part $SEQ)"
	aexec "$@"
	ptest
	SEQ=$SEQSAVE
	FLUSH=0
}

vexec() {
	if [ "$SEQ" == "1" ]; then
		banner "$TEST"
		echo "Executing $TEST"
	else
		banner "$TEST (part $SEQ)"
		echo "Executing $TEST (part $SEQ)"
	fi
	aexec "$@"
	vtest
	SEQ=1
	FLUSH=1
}

ptest() {
	if [ "$EXITCODE" == "0" ]; then
		RES="Passed"
	else
		RES="Failed"
	fi
	tlog
	out test "$TEST" $SEQ "$LASTCMD" $RES $TLOG
	if [ "$EXITONFAILURE" == "true" ]; then
		if [ "$EXITCODE" != "0" ]; then
			exit
		fi
	fi
}

vtest() {
	EC=$?
	if [ "$EXITCODE" == "0" ]; then
		RES="Passed"
	else
		RES="Failed"
	fi
	tlog
	out test "$TEST" $SEQ "$LASTCMD" $RES $TLOG
	if [ "$EXITCODE" != "0" ]; then
		if [ "$EXITONFAILURE" == "true" ]; then
			exit
		fi
	fi
}

date > $OUT
FLUSH=1

head
TESTPART="Part I: Build"
EXITONFAILURE=true
if [ "$FCO" != "1" ]; then
	TEST="Checkout CoG"
	pexec rm -rf cog
	vexec svn co https://svn.sourceforge.net/svnroot/cogkit/trunk/current/src/cog

	TEST="Checkout VDL2"
	pexec rm -rf src
	#vexec cvs -d :pserver:anonymous@cvs.cogkit.org:/cvs/cogkit co src/vdsk
	svn co https://svn.ci.uchicago.edu/svn/vdl2
fi

TEST="Directory setup"
pexec mkdir cog/modules/vdsk
vexec cp -r vdl2/trunk/* cog/modules/vdsk

TEST="Compile"
pexec cd cog/modules/vdsk
pexec rm -rf dist
vexec ant -quiet dist

TEST="Package"
pexec cd dist
VDSK=`ls -d vdsk*.*`
pexec cd $VDSK/lib
pexec rm -f castor*.jar *gt2ft*.jar ant.jar
pexec cd ../..
pexec rm -rf vdsk-$DATE
pexec mv $VDSK vdsk-$DATE
vexec tar -pczf $OUTDIR/vdsk-$DATE.tar.gz vdsk-$DATE
out package "vdsk-$DATE.tar.gz"

PATH=$PWD/vdsk-$DATE/bin:$PATH
cd ..
TESTDIR=$PWD/tests
echo "Path: $PATH" >>$OUT
cd $RUNDIR

EXITONFAILURE=false
TESTPART="Part II: Local Tests"

for TEST in `ls $TESTDIR/*.dtm $TESTDIR/*.swift`; do
	BN=`basename $TEST`
	echo $BN
	cp $TESTDIR/$BN .

	TESTNAME=${BN%.dtm}
	TESTNAME=${TESTNAME%.swift}
	TEST="$TESTNAME"

	ssexec "Compile" vdlc $BN
	for ((i=0; $i<9; i=$i+1)); do
		pexec swift -sites.file ~/.vdl2/sites-local.xml $TESTNAME.kml
	done
	vexec swift -sites.file ~/.vdl2/sites-local.xml $TESTNAME.kml
done

TESTPART="Part III: Grid Tests"

for TEST in `ls $TESTDIR/*.dtm $TESTDIR/*.swift`; do
	BN=`basename $TEST`
	echo $BN
	cp $TESTDIR/$BN .

	TESTNAME=${BN%.dtm}
	TESTNAME=${TESTNAME%.swift}
	TEST="$TESTNAME"

	ssexec "Compile" vdlc $BN
	for ((i=0; $i<9; i=$i+1)); do
		pexec swift -sites.file ~/.vdl2/sites-grid.xml $TESTNAME.kml
	done
	vexec swift -sites.file ~/.vdl2/sites-grid.xml $TESTNAME.kml
done

#Don't remove me:
tail

#!/bin/bash

OUTDIR=$PWD
LOGCOUNT=0
SEQ=1
DATE=`date +"%y%m%d"`
TIME=`date +"%T %Z(%z)"`
RUNDIRBASE="run-$DATE"
RUNDIR=$OUTDIR/$RUNDIRBASE
mkdir -p $RUNDIR

if [ "$1" == "-fco" ]; then
	FCO=1
	shift
elif [ "$2" == "-fco" ]; then
	FCO=1
fi

if [ "$1" == "" ]; then
	OUTBASE=$RUNDIRBASE/tests.log
else
	OUTBASE=$RUNDIRBASE/$1
fi
OUT=$OUTDIR/$OUTBASE

head() {
	HTMLBASE=tests-$DATE.html
	HTML=$OUTDIR/$HTMLBASE
	rm -f $OUTDIR/current.html

	#This doesn't work well with servers that don't follow symlinks
	#ln -s $HTML $OUTDIR/current.html

	cat <<DOH >$OUTDIR/current.html

		<title>Redirecting...</title>
		<meta http-equiv="cache-control" content="no-cache">

		You should be redirected to $HTMLBASE

DOH
	cat <<DOH >$HTML

		<title>VDL2 nightly integration tests and build ($DATE $TIME)</title>

VDL2 nightly integration tests and build ($DATE $TIME)

Test results

Compiled packages

Older tests

How to add new tests

DOH
	FIRSTTEST=1
}

html() {
	echo $@ >>$HTML
}

tail() {
	MONTHS=("" "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")
	html "

"

	if [ "$BINPACKAGE" != "" ]; then
		FBP=$OUTDIR/$BINPACKAGE
		SIZE=`ls -hs $FBP`
		SIZE=${SIZE/$FBP}
		cat <<DOH >>$HTML

Binary packages

	$BINPACKAGE ($SIZE)

DOH
	fi

	LASTYR="00"
	LASTMO="00"
	html "
Older tests
"
	html ''
	html "

"
	for OLDER in `ls $OUTDIR/tests-*.html|sort`; do
		O=`basename $OLDER`
		YR=${O:6:2}
		MO=${O:8:2}
		DY=${O:10:2}
		if [ $LASTYR != $YR ]; then
			html "

"
			html "
20$YR
"
			LASTYR=$YR
		fi
		if [ $LASTMO != $MO ]; then
			html "

"
			html "
${MONTHS[$MO]}
"
			html "

"
			LASTMO=$MO
		fi
		html "$DY	"
	done
	html "

"
	cat <<DOH >>$HTML
	How to add new tests

DOH
}

outecho() {
	TYPE=$1
	shift
	echo "<$TYPE>$1|$2|$3|$4|$5|$6|$7|$8|$9|"
}

out() {
	echo $@
	TYPE=$1
	if [ "$TYPE" == "test" ]; then

		NAME=$2
		SEQ=$3
		CMD=$4
		RES=$5
		LOG=$6

		if [ "$FIRSTTEST" == "1" ]; then
			html "
Test results
"
			html ""
			html "Output log from tests"
			html "
"
			FIRSTTEST=0
		else
			if [ "$FLUSH" == "1" ]; then
				html "

"
			fi
		fi

		if [ "$TESTPART" != "" ]; then
			html "
$TESTPART
"
			TESTPART=
		fi

		if [ "$FLUSH" == "1" ]; then
			html "
$NAME:

"
		fi
		if [ ${#SEQ} -gt 2 ]; then
			WIDTH=""
		else
			WIDTH="width=\"20\""
		fi
		if [ "$RES" == "Passed" ]; then
			html ""
			html "$SEQ"
		else
			html ""
			html "$SEQ"
		fi
		html "	"

	elif [ "$TYPE" == "package" ]; then
		BINPACKAGE=$2
	else
		html $@
	fi

}

aexec() {
	echo Executing "$@" >>$OUT
	rm -f $OUTDIR/x73010test.log
	LASTCMD="$@"
	"$@" >$OUTDIR/x73010test.log 2>&1
	EXITCODE=$?
	if [ "$EXITCODE" == "127" ]; then
		echo "Command not found: $@" >$OUTDIR/x73010test.log
	fi
	if [ -f $OUTDIR/x73010test.log ]; then
		cat $OUTDIR/x73010test.log >>$OUT
	fi

}

tlog() {
	TLOG="output_$LOGCOUNT.txt"
	rm -f $RUNDIR/$TLOG
	banner "$LASTCMD" $RUNDIR/$TLOG
	if [ -f $OUTDIR/x73010test.log ]; then
		cat $OUTDIR/x73010test.log >>$RUNDIR/$TLOG 2>>$OUT
	fi
	TLOG="$RUNDIRBASE/$TLOG"
	let "LOGCOUNT=$LOGCOUNT+1"
}

fexec() {
	FLUSH=1
	banner "$TEST (faked)"
	echo "Faking $TEST"
	EXITCODE=0
	LASTCMD=""
	vtest
}

banner() {
	if [ "$2" == "" ]; then
		BOUT=$OUT
	else
		BOUT=$2
	fi
	echo "">>$BOUT
	echo "*****************************************************************************************">>$BOUT
	echo "* $1" >>$BOUT
	echo "*****************************************************************************************">>$BOUT
}

pexec() {
	banner "$TEST (part $SEQ)"
	echo "Executing $TEST (part $SEQ)"
	aexec "$@"
	ptest
	let "SEQ=$SEQ+1"
	FLUSH=0
}

ssexec() {
	SEQSAVE=$SEQ
	SEQ=$1
	shift
	banner "$TEST (part $SEQ)"
	echo "Executing $TEST (part $SEQ)"
	aexec "$@"
	ptest
	SEQ=$SEQSAVE
	FLUSH=0
}

vexec() {
	if [ "$SEQ" == "1" ]; then
		banner "$TEST"
		echo "Executing $TEST"
	else
		banner "$TEST (part $SEQ)"
		echo "Executing $TEST (part $SEQ)"
	fi
	aexec "$@"
	vtest
	SEQ=1
	FLUSH=1
}

ptest() {
	if [ "$EXITCODE" == "0" ]; then
		RES="Passed"
	else
		RES="Failed"
	fi
	tlog
	out test "$TEST" $SEQ "$LASTCMD" $RES $TLOG
	if [ "$EXITONFAILURE" == "true" ]; then
		if [ "$EXITCODE" != "0" ]; then
			exit
		fi
	fi
}

vtest() {
	EC=$?
	if [ "$EXITCODE" == "0" ]; then
		RES="Passed"
	else
		RES="Failed"
	fi
	tlog
	out test "$TEST" $SEQ "$LASTCMD" $RES $TLOG
	if [ "$EXITCODE" != "0" ]; then
		if [ "$EXITONFAILURE" == "true" ]; then
			exit
		fi
	fi
}

date > $OUT
FLUSH=1

head
TESTPART="Part I: Build"
EXITONFAILURE=true
if [ "$FCO" != "1" ]; then
	TEST="Checkout CoG"
	pexec rm -rf cog
	vexec svn co https://svn.sourceforge.net/svnroot/cogkit/trunk/current/src/cog

	TEST="Checkout VDL2"
	pexec rm -rf src
	#vexec cvs -d :pserver:anonymous@cvs.cogkit.org:/cvs/cogkit co src/vdsk
	svn co https://svn.ci.uchicago.edu/svn/vdl2
fi

TEST="Directory setup"
pexec mkdir cog/modules/vdsk
vexec cp -r vdl2/trunk/* cog/modules/vdsk

TEST="Compile"
pexec cd cog/modules/vdsk
pexec rm -rf dist
vexec ant -quiet dist

TEST="Package"
pexec cd dist
VDSK=`ls -d vdsk*.*`
pexec cd $VDSK/lib
pexec rm -f castor*.jar *gt2ft*.jar ant.jar
pexec cd ../..
pexec rm -rf vdsk-$DATE
pexec mv $VDSK vdsk-$DATE
vexec tar -pczf $OUTDIR/vdsk-$DATE.tar.gz vdsk-$DATE
out package "vdsk-$DATE.tar.gz"

PATH=$PWD/vdsk-$DATE/bin:$PATH
cd ..
TESTDIR=$PWD/tests
echo "Path: $PATH" >>$OUT
cd $RUNDIR

EXITONFAILURE=false
TESTPART="Part II: Local Tests"

for TEST in $TESTDIR/*.dtm $TESTDIR/*.swift; do
	BN=`basename $TEST`
	echo $BN
	cp $TESTDIR/$BN .

	TESTNAME=${BN:0:((${#BN}-4))}
	TEST="$TESTNAME"

	ssexec "Compile" vdlc $BN
	for ((i=0; $i<9; i=$i+1)); do
		pexec swift -sites.file ~/.vdl2/sites-local.xml $TESTNAME.kml
	done
	vexec swift -sites.file ~/.vdl2/sites-local.xml $TESTNAME.kml
done

TESTPART="Part III: Grid Tests"

for TEST in $TESTDIR/*.dtm $TESTDIR/*.swift; do
	BN=`basename $TEST`
	echo $BN
	cp $TESTDIR/$BN .

	TESTNAME=${BN:0:((${#BN}-4))}
	TEST="$TESTNAME"

	ssexec "Compile" vdlc $BN
	for ((i=0; $i<9; i=$i+1)); do
		pexec swift -sites.file ~/.vdl2/sites-grid.xml $TESTNAME.kml
	done
	vexec swift -sites.file ~/.vdl2/sites-grid.xml $TESTNAME.kml
done

#Don't remove me:
tail