<commit_before>#!/usr/bin/env bash

set -e
set -u


# Parse input
while getopts ":ua:e:" opt; do
  case $opt in
    u)
      UPDATE_DISTRIB="true"
      ;;
    a)
      INPUT_MAVEN_ARGS=$OPTARG
      ;;
    e)
      INPUT_MAVEN_ENV=$OPTARG
      ;;
    \?)
      echo "Invalid option: -$OPTARG" >&2
      exit 1
      ;;
    :)
      echo "Option -$OPTARG requires an argument." >&2
      exit 2
      ;;
  esac
done


# Set build vars
MAVEN_ARGS=${INPUT_MAVEN_ARGS:-""}
if [ -z ${INPUT_MAVEN_ENV+x} ]; then
  export MAVEN_OPTS="-Xmx512m -Xms512m -Xss16m"
else
  export MAVEN_OPTS="$INPUT_MAVEN_ENV"
fi

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

STRATEGOXT_JAR="strategoxt-distrib/share/strategoxt/strategoxt/strategoxt.jar"


# Update strategoxt distribution if it does not exist, or if requested
if [ -n "${UPDATE_DISTRIB+1}" ] || [ ! -f $STRATEGOXT_JAR ]; then
	rm -rf strategoxt-distrib
	mkdir strategoxt-distrib
	cd strategoxt-distrib
	wget http://hydra.nixos.org/job/strategoxt-java/strategoxt-java-bootstrap/bootstrap3/latest/download-by-type/file/tar -O strategoxt-distrib.tar
	tar -xf strategoxt-distrib.tar
	chmod a+x share/strategoxt/macosx/*
  chmod a+x share/strategoxt/linux/*
	rm strategoxt-distrib.tar
	cd ..
fi


# Create minified strategoxt JAR
rm -rf strategoxt-min
mkdir -p strategoxt-min
unzip -qq -o -d strategoxt-min/ strategoxt-distrib/share/strategoxt/strategoxt/strategoxt.jar
rm strategoxt-min/run.class<commit_msg>Make JAR path relative to the directory where build.sh resides.<commit_after>#!/usr/bin/env bash

set -e
set -u


# Parse input
while getopts ":ua:e:" opt; do
  case $opt in
    u)
      UPDATE_DISTRIB="true"
      ;;
    a)
      INPUT_MAVEN_ARGS=$OPTARG
      ;;
    e)
      INPUT_MAVEN_ENV=$OPTARG
      ;;
    \?)
      echo "Invalid option: -$OPTARG" >&2
      exit 1
      ;;
    :)
      echo "Option -$OPTARG requires an argument." >&2
      exit 2
      ;;
  esac
done


# Set build vars
MAVEN_ARGS=${INPUT_MAVEN_ARGS:-""}
if [ -z ${INPUT_MAVEN_ENV+x} ]; then
  export MAVEN_OPTS="-Xmx512m -Xms512m -Xss16m"
else
  export MAVEN_OPTS="$INPUT_MAVEN_ENV"
fi

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

STRATEGOXT_JAR="$DIR/strategoxt-distrib/share/strategoxt/strategoxt/strategoxt.jar"


# Update strategoxt distribution if it does not exist, or if requested
if [ -n "${UPDATE_DISTRIB+1}" ] || [ ! -f $STRATEGOXT_JAR ]; then
	rm -rf strategoxt-distrib
	mkdir strategoxt-distrib
	cd strategoxt-distrib
	wget http://hydra.nixos.org/job/strategoxt-java/strategoxt-java-bootstrap/bootstrap3/latest/download-by-type/file/tar -O strategoxt-distrib.tar
	tar -xf strategoxt-distrib.tar
	chmod a+x share/strategoxt/macosx/*
  chmod a+x share/strategoxt/linux/*
	rm strategoxt-distrib.tar
	cd ..
fi


# Create minified strategoxt JAR
rm -rf strategoxt-min
mkdir -p strategoxt-min
unzip -qq -o -d strategoxt-min/ strategoxt-distrib/share/strategoxt/strategoxt/strategoxt.jar
rm strategoxt-min/run.class
{'fraction_non_alphanumeric': 0.13135735938026272, 'fraction_numerical': 0.010104412260020209, 'mean_word_length': 3.261119081779053, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '243203', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1170, 'n_words': 250}