Created
November 15, 2012 01:19
-
-
Save saltnlight5/4076022 to your computer and use it in GitHub Desktop.
kotlinc_bin tools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Author: Zemian Deng, Date: 2012-11-13_22:53:54 | |
# | |
# Compile Kotlin source files and write into 'out' directory. | |
# | |
KOTLIN_DIR=$(cd $(dirname $0)/.. && pwd) | |
SRC='$KOTLIN_DIR/src' | |
if [[ $# -ge 1 ]]; then SRC=$1; shift; fi | |
CP=${CP:=} | |
for F in `ls -1 $KOTLIN_DIR/lib/*.jar`; do | |
CP="$F:$CP" | |
done | |
KOTLIN_CMD=$KOTLIN_DIR/bin/kotlinc-jvm | |
if [[ "$OS" == Windows* ]]; then | |
CP=`cygpath -mp $CP` | |
KOTLIN_CMD="$KOTLIN_CMD.bat" | |
fi | |
$KOTLIN_CMD -classpath "$CP" -output $KOTLIN_DIR/out -src $SRC "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Author: Zemian Deng, Date: 2012-11-13_22:53:54 | |
# | |
# Run Kotlin Program. User only needs to give the package name, and it will auto add the .namepace suffix. | |
# | |
KOTLIN_DIR=$(cd $(dirname $0)/.. && pwd) | |
PKG='namespace' | |
if [[ $# -ge 1 ]]; then PKG="$1.namespace"; shift; fi | |
CP=${CP:=} | |
CP="$KOTLIN_DIR/out:$CP" | |
for F in `ls -1 $KOTLIN_DIR/lib/*.jar`; do | |
CP="$F:$CP" | |
done | |
if [[ "$OS" == Windows* ]]; then CP=`cygpath -mp $CP`; fi | |
java -cp "$CP" $PKG "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment