blob: fc918f0f83ec40528efa1af0fa41bbf4306720f7 [file] [log] [blame]
Jean Chalardddcb4842012-05-28 17:30:18 +09001#!/bin/sh
2# Copyright 2011, The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# Set up prog to be the path of this script, including following symlinks,
17# and set up progdir to be the fully-qualified pathname of its directory.
18prog="$0"
19while [ -h "${prog}" ]; do
20 newProg=`/bin/ls -ld "${prog}"`
21 newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
22 if expr "x${newProg}" : 'x/' >/dev/null; then
23 prog="${newProg}"
24 else
25 progdir=`dirname "${prog}"`
26 prog="${progdir}/${newProg}"
27 fi
28done
29oldwd=`pwd`
30progdir=`dirname "${prog}"`
31cd "${progdir}"
32progdir=`pwd`
33prog="${progdir}"/`basename "${prog}"`
34cd "${oldwd}"
35
Jean Chalardd055cca2012-08-27 14:51:57 +090036classname=com.android.inputmethod.latin.dicttool.Dicttool
Jean Chalard4c573f32012-08-08 17:15:58 +090037jarfile=dicttool_aosp.jar
Jean Chalardddcb4842012-05-28 17:30:18 +090038frameworkdir="$progdir"
39if [ ! -r "$frameworkdir/$jarfile" ]
40then
Jean Chalardddcb4842012-05-28 17:30:18 +090041 frameworkdir=`dirname "$progdir"`/framework
Ken Wakasa54360422014-06-16 14:46:22 +090042 libdir=`dirname "$progdir"`/lib64
Jean Chalardddcb4842012-05-28 17:30:18 +090043fi
44if [ ! -r "$frameworkdir/$jarfile" ]
45then
46 echo `basename "$prog"`": can't find $jarfile"
47 exit 1
48fi
49
Jean Chalardd055cca2012-08-27 14:51:57 +090050lib=junit.jar
51if [ ! -r "$frameworkdir/$lib" ]
52then
53 echo `basename "$prog"`": can't find lib $lib"
54 exit 1
55fi
56
Jean Chalardddcb4842012-05-28 17:30:18 +090057if [ "$OSTYPE" = "cygwin" ] ; then
58 jarpath=`cygpath -w "$frameworkdir/$jarfile"`
Jean Chalardd055cca2012-08-27 14:51:57 +090059 libpath=`cygpath -w "$frameworkdir/$lib"`
Jean Chalardddcb4842012-05-28 17:30:18 +090060 progdir=`cygpath -w "$progdir"`
61else
62 jarpath="$frameworkdir/$jarfile"
Jean Chalardd055cca2012-08-27 14:51:57 +090063 libpath="$frameworkdir/$lib"
Jean Chalardddcb4842012-05-28 17:30:18 +090064fi
65
66# might need more memory, e.g. -Xmx128M
Ken Wakasa54360422014-06-16 14:46:22 +090067exec java -ea -classpath "$libpath":"$jarpath" -Djava.library.path="$libdir" "$classname" "$@"