<commit_before>#!/bin/bash

if [ -z "$OPENNMS_ROOT" ]; then
	OPENNMS_ROOT=`ls -d ../target/opennms-*-SNAPSHOT 2>/dev/null | sort -u | tail -n 1`
	if [ -z "$OPENNMS_ROOT" ]; then
		echo "You must run './assemble.pl -Dbuild.profile=dir' at least once before doing runInPlace.sh!"
		exit 1
	fi
	OPENNMS_ROOT=`cd $OPENNMS_ROOT; pwd`
fi

function err() {
    echo "$@" 1>&2
}

function warInPlace() {
	if $OFFLINE; then
        OFFLINE_ARGS="-o"
    fi
    ../compile.pl $OFFLINE_ARGS $DEFINES -DonmsLibScope=compile '-P!jspc' compile war:inplace
    mkdir -p src/main/webapp/{WEB-INF,META-INF}
    sed -e "s,\${install.dir},$OPENNMS_ROOT,g" src/web-inf/configuration.properties > src/main/webapp/WEB-INF/configuration.properties
    sed -e "s,\${install.servlet.dir},`pwd`/src/main/webapp,g" src/meta-inf/context.xml > src/main/webapp/META-INF/context.xml
}

function runInPlace() {
    local PORT=$1
	if $OFFLINE; then
        OFFLINE_ARGS="-o"
    fi
	if $DEBUG; then
			MAVEN_OPTS="${MAVEN_OPTS} -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8002,server=y,suspend=n"
			export MAVEN_OPTS;
	fi
	echo $MAVEN_OPTS;
  ../compile.pl $OFFLINE_ARGS $DEFINES -Dweb.port=$PORT -Dopennms.home=$OPENNMS_ROOT -DonmsLibScope=compile '-P!jspc' jetty:run-exploded
}

function removeGwtModuleFiles() {
    local MOD=$1
    local TOP=`pwd`
    local WEBDIR=$TOP/src/main/webapp
    (
    cd target/$MOD
    for i in *; do
	rm -f $WEBDIR/$i
    done
    )<commit_msg>added memory options to runInPlace.sh to avoid oom<commit_after>#!/bin/bash

if [ -z "$OPENNMS_ROOT" ]; then
	OPENNMS_ROOT=`ls -d ../target/opennms-*-SNAPSHOT 2>/dev/null | sort -u | tail -n 1`
	if [ -z "$OPENNMS_ROOT" ]; then
		echo "You must run './assemble.pl -Dbuild.profile=dir' at least once before doing runInPlace.sh!"
		exit 1
	fi
	OPENNMS_ROOT=`cd $OPENNMS_ROOT; pwd`
fi

function err() {
    echo "$@" 1>&2
}

function warInPlace() {
	if $OFFLINE; then
        OFFLINE_ARGS="-o"
    fi
    ../compile.pl $OFFLINE_ARGS $DEFINES -DonmsLibScope=compile '-P!jspc' compile war:inplace
    mkdir -p src/main/webapp/{WEB-INF,META-INF}
    sed -e "s,\${install.dir},$OPENNMS_ROOT,g" src/web-inf/configuration.properties > src/main/webapp/WEB-INF/configuration.properties
    sed -e "s,\${install.servlet.dir},`pwd`/src/main/webapp,g" src/meta-inf/context.xml > src/main/webapp/META-INF/context.xml
}

function runInPlace() {
    local PORT=$1
	if $OFFLINE; then
        OFFLINE_ARGS="-o"
    fi
	if $DEBUG; then
			MAVEN_OPTS="${MAVEN_OPTS} -XX:PermSize=512m -XX:MaxPermSize=1g -Xmx1g -XX:ReservedCodeCacheSize=512m"
			MAVEN_OPTS="${MAVEN_OPTS} -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8002,server=y,suspend=n"
			export MAVEN_OPTS;
	fi
	echo $MAVEN_OPTS;
  ../compile.pl $OFFLINE_ARGS $DEFINES -Dweb.port=$PORT -Dopennms.home=$OPENNMS_ROOT -DonmsLibScope=compile '-P!jspc' jetty:run-exploded
}

function removeGwtModuleFiles() {
    local MOD=$1
    local TOP=`pwd`
    local WEBDIR=$TOP/src/main/webapp
    (
    cd target/$MOD
    for i in *; do
	rm -f $WEBDIR/$i
    done
    )
{'fraction_non_alphanumeric': 0.15451612903225806, 'fraction_numerical': 0.00967741935483871, 'mean_word_length': 3.5805022156573116, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4711608', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1235, 'n_words': 244}