<commit_before>

if [ "$JAVA" = "" ]; then
 JAVA=java
fi

if [ "$1" = "action=start-server" ]; then
  function set_jar_path {
    JAR=$(ls matching-web/target/map-matching-web-*-dependencies.jar)
  }

  set_jar_path

  if [ ! -f "$JAR" ]; then
    mvn --projects matching-web,matching-core -DskipTests=true install assembly:single
    set_jar_path
  fi
  
  ARGS="graph.location=./graph-cache"
  
elif [ "$1" = "action=test" ]; then

  export MAVEN_OPTS="-Xmx1g -Xms1g"
  mvn clean test verify
  # return exit code of mvn
  exit $?
  
else
  function set_jar_path {
    JAR=$(ls matching-core/target/map-matching-*-dependencies.jar)
  }

  set_jar_path

  if [ ! -f "$JAR" ]; then
    mvn --projects matching-core -DskipTests=true install assembly:single
    set_jar_path
  fi
  
  ARGS="$@"
fi

exec "$JAVA" $JAVA_OPTS -jar $JAR $ARGS<commit_msg>reduce maven memory to reduce ram duplication when spawning sub processes<commit_after>

if [ "$JAVA" = "" ]; then
 JAVA=java
fi

if [ "$1" = "action=start-server" ]; then
  function set_jar_path {
    JAR=$(ls matching-web/target/map-matching-web-*-dependencies.jar)
  }

  set_jar_path

  if [ ! -f "$JAR" ]; then
    mvn --projects matching-web,matching-core -DskipTests=true install assembly:single
    set_jar_path
  fi
  
  ARGS="graph.location=./graph-cache"
  
elif [ "$1" = "action=test" ]; then

  export MAVEN_OPTS="-Xmx400m -Xms400m"
  mvn clean test verify
  # return exit code of mvn
  exit $?
  
else
  function set_jar_path {
    JAR=$(ls matching-core/target/map-matching-*-dependencies.jar)
  }

  set_jar_path

  if [ ! -f "$JAR" ]; then
    mvn --projects matching-core -DskipTests=true install assembly:single
    set_jar_path
  fi
  
  ARGS="$@"
fi

exec "$JAVA" $JAVA_OPTS -jar $JAR $ARGS
{'fraction_non_alphanumeric': 0.13765642775881684, 'fraction_numerical': 0.006825938566552901, 'mean_word_length': 3.2182254196642686, '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': '2305850', 'n_tokens_mistral': 698, 'n_tokens_neox': 650, 'n_words': 151}