Scala script headers not parsed correctly - workaround tips
Hi,
I am back to an issue with the script header is not parsed properly. With the following header, the entire file is treated as if header.
Basically the trailing !# that signifies the end of the script header is not detected/parsed properly by IJ.
#!/bin/bash -v
export SCALA_HOME="/shared/scala-2.9.2"
export PROJDIR="/shared/classint"
export LIBS=/$PROJDIR/libs
export CLASSES=$PROJDIR/target/classes
export CLASSPATH="$LIBS/mysql-connector-java-5.1.22-bin.jar:$SCALA_HOME/lib/*:$CLASSES"
export PATH=$SCALA_HOME/bin:$PATH
export SCALA_SRC=$PROJDIR/src/main/scala
export JAVA_SRC=$PROJDIR/src/main/java
echo $CLASSPATH
which scala
scala -version
cd /shared/
exec scalac -d $CLASSES -classpath $CLASSPATH $SCALA_SRC/com/admobius/appcrawler/*.scala
exec scala -classpath $CLASSPATH $0 $@
!#
// begin scala code..
So .. is there any workaround to get the script header to be recognized and parsed properly?
请先登录再写评论。
Hey i found another workaround by trial and error.
by adding quotes to one of the command line parameters, it seems to have triggered the scala parser to do the right thing
exec scalac -d $CLASSES -classpath $CLASSPATH "$SCALA_SRC/com/admobius/appcrawler/*.scala"
NOte that appears to be a bug in IJ, should not be necessary to add those quotes. But.. in any case at least this works now - the rest of the file is being parsed properly.