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

CONSTANTS_FILE=src/main/java/org/lantern/LanternConstants.java
function die() {
  echo $*
  echo "Reverting version file"
  git checkout $CONSTANTS_FILE || die "Could not revert version file?"
  exit 1
}

if [ $# -lt "1" ]
then
    die "$0: Received $# args... version required"
fi

VERSION=$1
MVN_ARGS=$2
echo "*******MAVEN ARGS*******: $MVN_ARGS"
perl -pi -e "s/lantern_version_tok/$VERSION/g" $CONSTANTS_FILE
GE_API_KEY=`cat lantern_getexceptional.txt`
if [ ! -n "$GE_API_KEY" ]
  then
  die "No API key!!" 
fi

perl -pi -e "s/ExceptionalUtils.NO_OP_KEY/\"$GE_API_KEY\"/g" $CONSTANTS_FILE

git up || die "Could not update git"
mvn clean || die "Could not clean?"
mvn $MVN_ARGS install -Dmaven.test.skip=true || die "Could not build?"

echo "Reverting version file"
git checkout $CONSTANTS_FILE || die "Could not revert version file?"

cp target/lantern-*-jar-with-dependencies.jar install/common/lantern.jar || die "Could not copy jar?"

git tag -a $VERSION -m "Version $VERSION release with MVN_ARGS $MVN_ARGS"<commit_msg>Added a v in there<commit_after>#!/usr/bin/env bash

CONSTANTS_FILE=src/main/java/org/lantern/LanternConstants.java
function die() {
  echo $*
  echo "Reverting version file"
  git checkout $CONSTANTS_FILE || die "Could not revert version file?"
  exit 1
}

if [ $# -lt "1" ]
then
    die "$0: Received $# args... version required"
fi

VERSION=$1
MVN_ARGS=$2
echo "*******MAVEN ARGS*******: $MVN_ARGS"
perl -pi -e "s/lantern_version_tok/$VERSION/g" $CONSTANTS_FILE
GE_API_KEY=`cat lantern_getexceptional.txt`
if [ ! -n "$GE_API_KEY" ]
  then
  die "No API key!!" 
fi

perl -pi -e "s/ExceptionalUtils.NO_OP_KEY/\"$GE_API_KEY\"/g" $CONSTANTS_FILE

git up || die "Could not update git"
mvn clean || die "Could not clean?"
mvn $MVN_ARGS install -Dmaven.test.skip=true || die "Could not build?"

echo "Reverting version file"
git checkout $CONSTANTS_FILE || die "Could not revert version file?"

cp target/lantern-*-jar-with-dependencies.jar install/common/lantern.jar || die "Could not copy jar?"

git tag -a v$VERSION -m "Version $VERSION release with MVN_ARGS $MVN_ARGS"
{'fraction_non_alphanumeric': 0.14460093896713616, 'fraction_numerical': 0.004694835680751174, 'mean_word_length': 4.422391857506361, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7616867', 'n_tokens_mistral': 820, 'n_tokens_neox': 783, 'n_words': 227}