lib/Tools/scala_build
author wenzelm
Wed, 10 Jan 2024 13:37:29 +0100
changeset 79469 deb50d396ff7
parent 78591 b1e0fb71435d
permissions -rwxr-xr-x
tuned signature;

#!/usr/bin/env bash
#
# Author: Makarius
#
# DESCRIPTION: build Isabelle/Scala/Java components

## diagnostics

PRG="$(basename "$0")"

function usage()
{
  echo
  echo "Usage: isabelle $PRG [OPTIONS]"
  echo
  echo "  Options are:"
  echo "    -f           force fresh build"
  echo "    -q           quiet mode: suppress stdout/stderr"
  echo
  echo "  Build Isabelle/Scala/Java modules of all registered components"
  echo "  (if required)."
  echo
  exit 1
}


## process command line

COMMAND="build"
QUIET=""

while getopts "fq" OPT
do
  case "$OPT" in
    f)
      COMMAND="build_fresh"
      ;;
    q)
      QUIET="true"
      ;;
    \?)
      usage
      ;;
  esac
done

shift $(($OPTIND - 1))

[ "$#" -ne 0 ] && usage


## main

classpath "$CLASSPATH"; export CLASSPATH=""

eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS)"

JAVA_ARGS["${#JAVA_ARGS[@]}"]="-classpath"
JAVA_ARGS["${#JAVA_ARGS[@]}"]="$(platform_path "$ISABELLE_CLASSPATH")"
JAVA_ARGS["${#JAVA_ARGS[@]}"]="isabelle.setup.Setup"
JAVA_ARGS["${#JAVA_ARGS[@]}"]="$COMMAND"

if [ -z "$QUIET" ]; then
  isabelle_java java "${JAVA_ARGS[@]}"
else
  isabelle_java java "${JAVA_ARGS[@]}" > /dev/null 2> /dev/null
fi