From 2538905e4fa529d07b9ccf343e0d6123acb5fd40 Mon Sep 17 00:00:00 2001 From: iphydf Date: Wed, 8 Apr 2020 15:06:40 +0000 Subject: Install ci-tools and get tokstyle via the script it provides. --- .travis/cmake-linux | 21 +++++---------------- other/astyle/format-source | 7 +++++-- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/.travis/cmake-linux b/.travis/cmake-linux index 0deeaacc..e2f44195 100755 --- a/.travis/cmake-linux +++ b/.travis/cmake-linux @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash ACTION="$1" @@ -8,22 +8,11 @@ CACHEDIR="$HOME/cache" NPROC=`nproc` ASTYLE="$CACHEDIR/astyle/build/gcc/bin/astyle" ASTYLE_VERSION=3.1 - -install_tool() { - SLUG="$1" - TOOL="$2" - TARGET="$3" - - VERSION=$(curl -L -s -H 'Accept: application/json' \ - "https://github.com/$SLUG/releases/latest" \ - | egrep -o '"v[0-9][^"]+"' \ - | egrep -o '[^"]+') - URL="https://github.com/$SLUG/releases/download/$VERSION/$TOOL-x86_64-linux-$VERSION.tar.gz" - curl -L -s "$URL" | tar xzv -C "$TARGET" -} +TRAVIS_TOOL="https://raw.githubusercontent.com/TokTok/ci-tools/master/bin/travis-haskell" travis_install() { - install_tool TokTok/hs-tokstyle tokstyle "$HOME/.local" + bash <(curl -s "$TRAVIS_TOOL") download + travis-haskell download TokTok/hs-tokstyle tokstyle "$HOME/.local" which coveralls || { # Install cpp-coveralls to upload test coverage results. @@ -48,7 +37,7 @@ run_static_analysis() { pylint -E other/analysis/check_recursion export CPPFLAGS="-isystem $CACHEDIR/include" - export LDFLAGS="-L $CACHEDIR/lib" + export LDFLAGS="-L$CACHEDIR/lib" cat toxav/*.c toxcore/*.c toxencryptsave/*.c \ | clang `pkg-config --cflags libsodium opus vpx` \ -Itoxav -Itoxcore -Itoxencryptsave -S -emit-llvm -xc - -o- \ diff --git a/other/astyle/format-source b/other/astyle/format-source index 7fa8b677..711823d8 100755 --- a/other/astyle/format-source +++ b/other/astyle/format-source @@ -35,10 +35,10 @@ FROM_JSON='s/\\"/"/g;s/^"(.*)"$/$1/;s/\\\\/\\/g;s/\\n/\n/g' apidsl_request() { TMPFILE=$(mktemp /tmp/apidsl.XXXXXX) - curl -o "$TMPFILE" -X POST --data @<( + curl -s -o "$TMPFILE" -X POST --data @<( echo '["Request",'; cat $2; - echo ']') https://apidsl2.herokuapp.com/$1 + echo ']') https://apidsl.herokuapp.com/$1 if grep '\[1,"' "$TMPFILE" > /dev/null; then echo "Error: $(grep -o '".*"' /tmp/apidsl-$$ | perl -0777 -pe "$FROM_JSON")" >&2 rm "$TMPFILE" @@ -49,12 +49,14 @@ apidsl_request() { } apidsl_curl() { + echo "apidsl_curl $@" >&2 apidsl_request "c" <( apidsl_request "parse" <( perl -0777 -pe "$TO_JSON" $1)) | perl -0777 -pe "$FROM_JSON" } # Check if apidsl generated sources are up to date. +set +x $APIDSL toxcore/LAN_discovery.api.h > toxcore/LAN_discovery.h & $APIDSL toxcore/crypto_core.api.h > toxcore/crypto_core.h & $APIDSL toxcore/ping.api.h > toxcore/ping.h & @@ -62,6 +64,7 @@ $APIDSL toxcore/ping_array.api.h > toxcore/ping_array.h & $APIDSL toxcore/tox.api.h > toxcore/tox.h & $APIDSL toxav/toxav.api.h > toxav/toxav.h & $APIDSL toxencryptsave/toxencryptsave.api.h > toxencryptsave/toxencryptsave.h & +set -x wait; wait; wait; wait; wait; wait; wait -- cgit v1.2.3