#!/bin/bash

# Newline in replace: C-q C-j

originalWD=$(pwd);

trap "cd ${originalWD}; exit 0" SIGINT EXIT

cd /home/gleguern/office/atelier/sosl/Core;

echo "Moved from ${originalWD} to $(pwd)";

/usr/lib/jvm/java-17-openjdk-17.0.2.0.8-1.fc34.x86_64/bin/java \
  --class-path /home/gleguern/office/atelier/sosl/Core/build/libs \
  --add-modules sosl \
  --module-path \
/home/gleguern/office/atelier/sosl/Core/build/classes/java/test:\
/home/gleguern/office/atelier/sosl/Core/build/classes/scala/test:\
/home/gleguern/office/atelier/sosl/Core/build/resources/test:\
/home/gleguern/office/atelier/sosl/Core/build/classes/java/main:\
/home/gleguern/office/atelier/sosl/Core/build/classes/scala/main:\
/home/gleguern/office/atelier/sosl/Core/build/resources/main:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.antlr/antlr4/4.8/c5902f3079595a5e73dd6b008340a8197ee1aeda/antlr4-4.8.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.13.8/994b004d041b18724ec298a135c37e7817d369ec/scala-reflect-2.13.8.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.13.8/5a865f03a794b27e6491740c4c419a19e4511a3d/scala-library-2.13.8.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/29.0-jre/801142b4c3d0f0770dd29abea50906cacfddd447/guava-29.0-jre.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/info.picocli/picocli/4.5.2/265314f98a6e7beed510f3bd7b5eaf1bfcaf9d50/picocli-4.5.2.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/com.github.vlsi.mxgraph/jgraphx/4.1.0/ae28c9f7dff0a0d0164603de97c1bd777aeccd08/jgraphx-4.1.0.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-fxml/17/a6f029f4fab0f01f00a838de1e65e20c6a92f02/javafx-fxml-17-linux.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-controls/17/851a1896fbd8548fb3671aa689b305b2cfad956a/javafx-controls-17-linux.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-controls/17/7116001b777530c89e5c7381d39a2c9268f71e7e/javafx-controls-17.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-swing/17/8dee489b0faecf27568bfe64efdc7aa01410defa/javafx-swing-17-linux.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-graphics/17/88dc59568c14ec37ea1c42b3ba472d78b4b1030a/javafx-graphics-17-linux.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-graphics/17/616d987ba02a86196d7feca443677fff908d5737/javafx-graphics-17.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-base/17/476c7640c2320244d3156edbbc19a7eda275c1ed/javafx-base-17-linux.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-base/17/1e6732190939254735dc2a88eca88c5c7ccc719d/javafx-base-17.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-params/5.8.1/13afdb5d414cbe991fce3ef6b864de77c9644dae/junit-jupiter-params-5.8.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-engine/5.8.1/21b86e08aae2720bbf017703669948be96d1388c/junit-jupiter-engine-5.8.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-api/5.8.1/6538b88eb8bf8811bc7b6efb5246f835c15e0bfe/junit-jupiter-api-5.8.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-engine/1.8.1/e6c63bf990dc88a6527b4ed617b23e47048f07e0/junit-platform-engine-1.8.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-commons/1.8.1/1e362cbe6d0f225b066757865e233972557484/junit-platform-commons-1.8.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter/5.8.1/73a218cf02d36d4e87bb9697fdbe0780e92b6bd3/junit-jupiter-5.8.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.antlr/antlr4-runtime/4.8/7fe453b678b71c87c6677cef26f6b0cd96b26586/antlr4-runtime-4.8.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.antlr/ST4/4.3/92f2c1ad8d84abcbeead6cf7f2c53a04166293c2/ST4-4.3.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.antlr/antlr-runtime/3.5.2/cd9cd41361c155f3af0f653009dcecb08d8b4afd/antlr-runtime-3.5.2.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.abego.treelayout/org.abego.treelayout.core/1.0.3/457216e8e6578099ae63667bb1e4439235892028/org.abego.treelayout.core-1.0.3.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.glassfish/javax.json/1.0.4/3178f73569fd7a1e5ffc464e680f7a8cc784b85a/javax.json-1.0.4.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/com.ibm.icu/icu4j/61.1/28d33b5e44e72edcc66a5da7a34a42147f38d987/icu4j-61.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/com.google.guava/failureaccess/1.0.1/1dcf1de382a0bf95a3d8b0849546c88bac1292c9/failureaccess-1.0.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/com.google.guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/b421526c5f297295adef1c886e5246c39d4ac629/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/25ea2e8b0c338a877313bd4672d3fe056ea78f0d/jsr305-3.0.2.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.checkerframework/checker-qual/2.11.1/8c43bf8f99b841d23aadda6044329dad9b63c185/checker-qual-2.11.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotations/2.3.4/dac170e4594de319655ffb62f41cbd6dbb5e601e/error_prone_annotations-2.3.4.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/com.google.j2objc/j2objc-annotations/1.3/ba035118bc8bac37d7eff77700720999acd9986d/j2objc-annotations-1.3.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.opentest4j/opentest4j/1.2.0/28c11eb91f9b6d8e200631d46e20a7f407f2a046/opentest4j-1.2.0.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-commons/8.0.1/19c7ba355f0737815205518e332a8dc08b417c6/asm-commons-8.0.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-analysis/8.0.1/6c2c7b3006b3a54dd63467a020263c0756fd5e80/asm-analysis-8.0.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-tree/8.0.1/dfcad5abbcff36f8bdad5647fe6f4972e958ad59/asm-tree-8.0.1.jar:\
/home/gleguern/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm/8.0.1/3f5199523fb95304b44563f5d56d9f5a07270669/asm-8.0.1.jar \
  --patch-module sosl=\
/home/gleguern/office/atelier/sosl/Core/build/classes/java/test:\
/home/gleguern/office/atelier/sosl/Core/build/classes/scala/test:\
/home/gleguern/office/atelier/sosl/Core/build/resources/main:\
/home/gleguern/office/atelier/sosl/Core/build/resources/test:\
#/home/gleguern/office/atelier/sosl/Core/build/classes/scala/main \
  --add-modules ALL-MODULE-PATH \
  --add-reads sosl=org.junit.jupiter.engine \
  --add-opens sosl/com.gitlab.mko575.sosl=ALL-UNNAMED \
  --add-opens sosl/com.gitlab.mko575.sosl.cli=ALL-UNNAMED \
  --add-opens sosl/com.gitlab.mko575.sosl.parser=ALL-UNNAMED \
  --add-reads sosl=org.junit.platform.engine \
  --add-opens sosl/com.gitlab.mko575.sosl=ALL-UNNAMED \
  --add-opens sosl/com.gitlab.mko575.sosl.cli=ALL-UNNAMED \
  --add-opens sosl/com.gitlab.mko575.sosl.parser=ALL-UNNAMED \
  --add-exports org.junit.platform.engine/org.junit.platform.engine.support.filter=org.junit.jupiter.engine,ALL-UNNAMED \
  --add-reads sosl=org.junit.platform.commons \
  --add-opens sosl/com.gitlab.mko575.sosl=ALL-UNNAMED \
  --add-opens sosl/com.gitlab.mko575.sosl.cli=ALL-UNNAMED \
  --add-opens sosl/com.gitlab.mko575.sosl.parser=ALL-UNNAMED \
  --add-exports org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED \
  --add-exports org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED \
  --add-reads sosl=org.junit.jupiter.api \
  --add-opens sosl/com.gitlab.mko575.sosl=org.junit.platform.commons \
  --add-opens sosl/com.gitlab.mko575.sosl.cli=org.junit.platform.commons \
  --add-opens sosl/com.gitlab.mko575.sosl.parser=org.junit.platform.commons \
  --add-reads sosl=org.junit.jupiter.params \
  --add-opens sosl/com.gitlab.mko575.sosl=org.junit.platform.commons \
  --add-opens sosl/com.gitlab.mko575.sosl.cli=org.junit.platform.commons \
  --add-opens sosl/com.gitlab.mko575.sosl.parser=org.junit.platform.commons \
  -Xmx512m \
  -Dfile.encoding=UTF-8 \
  -Duser.country=US \
  -Duser.language=en \
  -Duser.variant \
  com.gitlab.mko575.sosl.parser.BasicParsingTests
