summaryrefslogtreecommitdiff
path: root/scalaplugin
diff options
context:
space:
mode:
Diffstat (limited to 'scalaplugin')
-rw-r--r--scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala10
1 files changed, 9 insertions, 1 deletions
diff --git a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala
index 5a1f261a..2e842a6e 100644
--- a/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala
+++ b/scalaplugin/src/main/scala/mill/scalaplugin/ScalaModule.scala
@@ -159,6 +159,11 @@ object ScalaModule{
def scalaRuntimeIvyDeps(scalaVersion: String) = Seq[Dep](
Dep.Java("org.scala-lang", "scala-library", scalaVersion)
)
+
+ val DefaultShellScript: Seq[String] = Seq(
+ "#!/usr/bin/env sh",
+ "exec java -jar \"$0\" \"$@\""
+ )
}
import ScalaModule._
trait TestScalaModule extends ScalaModule with TaskModule{
@@ -247,6 +252,8 @@ trait ScalaModule extends Module{ outer =>
)
}
+ def prependShellScript: T[String] = T{ "" }
+
def sources = T.source{ basePath / 'src }
def resources = T.source{ basePath / 'resources }
def compile = T.persistent{
@@ -256,7 +263,8 @@ trait ScalaModule extends Module{ outer =>
val dest = T.ctx().dest
createAssembly(
dest,
- (runDepClasspath().filter(_.path.ext != "pom") ++ Seq(resources(), compile())).map(_.path).filter(exists)
+ (runDepClasspath().filter(_.path.ext != "pom") ++ Seq(resources(), compile())).map(_.path).filter(exists),
+ prependShellScript = prependShellScript()
)
PathRef(dest)
}