#!/bin/sh
# Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

SCRIPT_DIR=$(dirname $0)
DARTC_HOME=$(dirname $SCRIPT_DIR)
DARTC_LIBS=$DARTC_HOME/lib

if [ -x /usr/libexec/java_home ]; then
  export JAVA_HOME=$(/usr/libexec/java_home -v '1.6+')
fi

exec java $DART_JVMARGS -ea -classpath "$DARTC_LIBS/dartc.jar:$DARTC_LIBS/corelib.jar:$DARTC_LIBS/domlib.jar:$DARTC_LIBS/htmllib.jar:$DARTC_LIBS/jsonlib.jar:$DARTC_LIBS/closure-compiler.jar:$DARTC_LIBS/args4j/2.0.12/args4j-2.0.12.jar:$DARTC_LIBS/guava/r09/guava-r09.jar:$DARTC_LIBS/json/r2_20080312/json.jar:$DARTC_LIBS/rhino/1_7R3/js.jar" \
  com.google.dart.compiler.DartCompiler $@
