Skip to content

Commit

Permalink
Updated release & scripts to be self-standing
Browse files Browse the repository at this point in the history
  • Loading branch information
mmassenzio committed Nov 28, 2021
1 parent 21df4ee commit 8c4bcd2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# common-utils -- Shared utilities

[![Author](https://img.shields.io/badge/Author-M.%20Massenzio-green)](https://bitbucket.org/marco)
![Version](https://img.shields.io/badge/Version-0.3.0-blue)
![Released](https://img.shields.io/badge/Released-2021.11.22-green)
![Version](https://img.shields.io/badge/Version-0.4.0-blue)
![Released](https://img.shields.io/badge/Released-2021.11.27-green)

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

Expand Down
17 changes: 14 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,28 @@
# Where `build_type` can be one of either `Release` or `Debug` (default)

set -eu
source $(dirname $0)/env.sh

if [[ -z ${UTILS_DIR} || ! -d ${UTILS_DIR} ]]; then
echo "[ERROR] The \$UTILS_DIR env var must be defined and " \
"point to the directory which contains the Common Utilities"
exit 1
fi

source ${UTILS_DIR}/utils
source env.sh

BUILD=${1:-Debug}

msg "Build folder in ${BUILDDIR}"
mkdir -p ${BUILDDIR}
cd ${BUILDDIR}

if [[ -f ${BASEDIR}/conanfile.txt ]]; then
conan install ${BASEDIR} -if=${BUILDDIR} -pr=default --build=missing
if [[ -f conanfile.txt ]]; then
conan install . -if=${BUILDDIR} -pr=default --build=missing
fi

UTILS="-DCOMMON_UTILS_DIR=${UTILS_DIR}"

cmake -DCMAKE_CXX_COMPILER=${CLANG} \
-DCMAKE_BUILD_TYPE=${BUILD} \
${UTILS} ..
Expand Down
8 changes: 5 additions & 3 deletions release
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/usr/bin/env bash
#
# Packages this project's scripts into a downloadable tarball
set -eux
set -eu
source utils.sh

VERSION=0.3.0
VERSION=0.4.0
DEST=/tmp/common-utils

msg "Bulding Common Utilities release ${VERSION}"
mkdir -p ${DEST}
for f in build parse-args test utils; do
for f in build parse-args runtests utils; do
cp $f.* ${DEST}/$f
chmod +x $DEST/$f
done
Expand All @@ -17,3 +18,4 @@ cp commons.cmake $DEST/
mkdir -p rel
tar cvf rel/common-utils-$VERSION.tar.gz -C /tmp common-utils
rm -rf $DEST
success "Release tarball in rel/common-utils-$VERSION.tar.gz"
13 changes: 10 additions & 3 deletions test.sh → runtests.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
#!/bin/bash

set -eu
source $(dirname $0)/env.sh
source ${COMMON_UTILS_DIR}/utils.sh

if [[ -z ${UTILS_DIR} || ! -d ${UTILS_DIR} ]]; then
echo "[ERROR] The \$UTILS_DIR env var must be defined and " \
"point to the directory which contains the Common Utilities"
exit 1
fi

source ${UTILS_DIR}/utils
source env.sh

verbose=""
memcheck=""
valgrind_bin="${BUILDDIR}/tests/bin/unit_tests"
source $(${COMMON_UTILS_DIR}/parse_args verbose- memcheck- valgrind_bin~ -- $@)
source $(parse-args verbose- memcheck- valgrind_bin~ -- $@)


# Runs tests of the given type (unit, integration)
Expand Down

0 comments on commit 8c4bcd2

Please sign in to comment.