-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
64 lines (56 loc) · 2.12 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name := "sctags"
scalaVersion := "2.12.3"
version := "1.0"
scalacOptions ++= Seq("-feature","-deprecation")
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-compiler" % scalaVersion.value
)
assemblyJarName in assembly := name.value
mainClass in assembly := Some("sctags.SCTags")
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false, includeDependency = false)
assemblyOption in assembly := (assemblyOption in assembly).value.copy(prependShellScript = Some(Seq(
"""#!/bin/bash""",
"""CMD=$0""",
"""ARGS=()""",
"""for opt in "$@"; do""",
""" case $opt in """,
""" --version)""",
""" echo 'Exuberant Ctags 5.9~forScala https://github.com/luben/sctags'""",
""" exit 0""",
""" ;;""",
""" --list-languages)""",
""" echo 'Scala'""",
""" exec ctags --list-languages""",
""" ;;""",
""" --language-force=*)""",
""" CTAGS_LANG="${opt#*=}"""",
""" ;;""",
""" *)""",
""" ARGS[${#ARGS[@]}]=$opt""",
""" shift""",
""" ;;""",
""" esac""",
"""done""",
"""if [[ -n "$CTAGS_LANG" && "$CTAGS_LANG" != "scala" && "$CTAGS_LANG" != "Scala" ]]; then""",
""" exec ctags --language-force=$CTAGS_LANG ${ARGS[@]}""",
"""else""",
""" if [[ -z $SCALA_LIB ]]; then""",
""" if [[ -n $SCALA_HOME ]]; then""",
""" SCALA_LIB="$SCALA_HOME/lib"""",
""" else""",
""" SCALA_BIN=$(which scala)""",
""" if [[ $? != 0 ]]; then""",
""" echo "Could not find scala executable on your path: $PATH"""",
""" echo "Please set SCALA_HOME or SCALA_LIB environment variable"""",
""" exit 1;""",
""" fi""",
""" if [[ -L "$SCALA_BIN" ]]; then""",
""" SCALA_BIN=$(readlink -f $SCALA_BIN)""",
""" fi""",
""" SCALA_HOME=$(dirname "$SCALA_BIN")/..""",
""" SCALA_LIB="$SCALA_HOME/lib"""",
""" fi""",
""" fi""",
""" exec java -Xbootclasspath/"a:$SCALA_LIB/scala-compiler.jar:$SCALA_LIB/scala-library.jar:$SCALA_LIB/scala-reflect.jar" -jar "$CMD" ${ARGS[@]}""",
"""fi"""
)))