You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@joshua.apache.org by mj...@apache.org on 2016/08/22 21:47:46 UTC

[20/27] incubator-joshua git commit: added debug-joshua which sets debugging and uses classes instead of the jar

added debug-joshua which sets debugging and uses classes instead of the jar

This means you can run the command-line version while in Eclipse without having to rebuild the jar file (which is time-consuming).


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/0e49bc53
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/0e49bc53
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/0e49bc53

Branch: refs/heads/master
Commit: 0e49bc537b05549930802bf6c187b849c4c67adb
Parents: 293db94
Author: Matt Post <po...@cs.jhu.edu>
Authored: Sun Aug 21 06:55:55 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Sun Aug 21 07:01:05 2016 -0500

----------------------------------------------------------------------
 bin/debug-joshua | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 bin/decoder      |  1 -
 2 files changed, 48 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/0e49bc53/bin/debug-joshua
----------------------------------------------------------------------
diff --git a/bin/debug-joshua b/bin/debug-joshua
new file mode 100755
index 0000000..0fd76f4
--- /dev/null
+++ b/bin/debug-joshua
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# Joshua decoder invocation script.
+# 
+# This script takes care of passing arguments to Java and to the
+# Joshua decoder.  Usage:
+#
+# ./decoder [-m memory] [Joshua arguments]
+#
+# The default amount of memory is 4gb.
+
+NUM_ARGS=0
+E_OPTERROR=1
+
+## memory usage; default is 4 GB
+mem=4g
+
+if [[ $1 == "-m" ]]; then
+    mem=$2
+    shift
+    shift
+fi
+
+set -u
+
+JOSHUA=$(dirname $0)/..
+JAR_PATH=$(ls -t $JOSHUA/target/joshua-*-jar-with-dependencies.jar | head -n1)
+exec java -Xmx${mem} \
+	-Dfile.encoding=utf8 \
+	-Djava.library.path=$JOSHUA/lib \
+	-cp $JOSHUA/target/classes:$JAR_PATH \
+	org.apache.joshua.decoder.JoshuaDecoder -v 2 "$@"

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/0e49bc53/bin/decoder
----------------------------------------------------------------------
diff --git a/bin/decoder b/bin/decoder
deleted file mode 120000
index a3f23fe..0000000
--- a/bin/decoder
+++ /dev/null
@@ -1 +0,0 @@
-joshua-decoder
\ No newline at end of file