]> gitweb.fperrin.net Git - DictionaryPC.git/blobdiff - WiktionarySplitter.sh
Change scripts to be able to use a native-image binary instead.
[DictionaryPC.git] / WiktionarySplitter.sh
index 87593bb879c422b6c039cb54bb393ec1456c6aaf..66d38a23cfe8d20309a38b436121fd0cd8002099 100755 (executable)
@@ -1,8 +1,12 @@
 # Run after downloading (data/downloadInputs.sh) to generate
 # per-language data files from enwiktionary.
-ICU4J=/usr/share/java/icu4j-49.1.jar
-test -r "$ICU4J" || ICU4J=/usr/share/icu4j-55/lib/icu4j.jar
-COMMONS_COMPRESS=/usr/share/java/commons-compress.jar
-JAVA=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
-test -x "$JAVA" || JAVA=java
-"$JAVA" -Xmx4096m -Xverify:none -classpath bin/:"$ICU4J":"$COMMONS_COMPRESS" com.hughes.android.dictionary.engine.WiktionarySplitter "$@"
+RUNNER=./DictionaryPC
+if ! test -x "$RUNNER" ; then
+  ICU4J=/usr/share/java/icu4j-49.1.jar
+  test -r "$ICU4J" || ICU4J=/usr/share/icu4j-55/lib/icu4j.jar
+  COMMONS_COMPRESS=/usr/share/java/commons-compress.jar
+  JAVA=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
+  test -x "$JAVA" || JAVA=java
+  RUNNER="$JAVA -Xmx4096m -Xverify:none -classpath bin/:$ICU4J:$COMMONS_COMPRESS com.hughes.android.dictionary.engine.Runner"
+fi
+$RUNNER WiktionarySplitter "$@"