alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Play Framework/Scala example source code file (runtests)

This example Play Framework source code file (runtests) is included in my "Source Code Warehouse" project. The intent of this project is to help you more easily find Play Framework (and Scala) source code examples by using tags.

All credit for the original source code belongs to Play Framework; I'm just trying to make examples easier to find. (For my Scala work, see my Scala examples and tutorials.)

Play Framework tags/keywords

build, building, current, not, play, playframework, scala, script, testing, tests

The runtests Play Framework example source code

#! /bin/bash

# Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>

unset no_publish

# comma-separated list of scala versions to cross build against
declare crossbuild="2.11.1"

# process arguments
declare -a args
while [[ $# -gt 0 ]] ; do
  case "$1" in
    --no-publish) no_publish=1; shift ;;
    -c|--crossbuild) crossbuild=$2; shift 2;;
    *) args=("${args[@]}" "$1"); shift ;;
  esac
done
set -- "${args[@]}" # reset "$@"

set -e
export CURRENT=`pwd`
export SCRIPT=`dirname "$0"`

cd "$SCRIPT"
export BUILD=`pwd`/build

if [ -n "$no_publish" ] ; then
  echo "[info] Not publishing locally"
else
  echo "[info] Play will build with its default version of Scala and also cross build against these versions: <${crossbuild}>"
  echo "[info]"
  echo "[info] ---- BUILDING PLAY (with its default version of Scala)"
  echo "[info]"
  $BUILD "$@" publish-local
  for v in ${crossbuild//,/ } ; do
    echo "[info]"
    echo "[info] ---- BUILDING PLAY (cross building against Scala $v)"
    echo "[info]"
    $BUILD "$@" -Dscala.version=$v publish-local
  done
fi

echo "[info]"
echo "[info] ---- PLAYFRAMEWORK CORE TEST RUNNER"
echo "[info]"

$BUILD "$@" test:test

echo "[info]"
echo "[info] ---- SBT PLUGIN TESTS"
echo "[info]"

$BUILD "$@" Sbt-Plugin:scripted

rm -rf ./logs

cd $CURRENT

echo "[info]"
echo "[info] ---- RUNNING DOCUMENTATION TESTS"
echo "[info]"

cd ../documentation
$BUILD "$@" clean test validate-docs
cd $CURRENT

echo "[info]"
echo "[info] ---- TESTING TEMPLATES"
echo "[info]"

cd ../templates
$BUILD "$@" testTemplates
cd $CURRENT

echo "[info]"
echo "[info] ALL TESTS PASSED"
echo "[info]"

Other Play Framework source code examples

Here is a short list of links related to this Play Framework runtests source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.