Add automated tests for main-class regression.

This commit is contained in:
Josh Suereth 2014-10-27 11:53:55 -04:00
parent 2d3f57ad51
commit 01550a47be
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,22 @@
lazy val main = project.settings(
organization := "org.scala-sbt.testsuite.example",
name := "has-main",
version := "1.0-SNAPSHOT"
)
lazy val user = project.settings(
fullResolvers := fullResolvers.value.filterNot(_.name == "inter-project"),
libraryDependencies += (projectID in main).value,
mainClass in Compile := Some("Test")
)
// NOTE - This will NOT work, as mainClass must be scoped by Compile (and optionally task) to function correctly).
lazy val user2 = project.settings(
fullResolvers := fullResolvers.value.filterNot(_.name == "inter-project"),
libraryDependencies += (projectID in main).value,
mainClass := Some("Test")
)

View File

@ -0,0 +1,5 @@
object Test {
def main(args: Array[String]): Unit = {
println("SUCCESS")
}
}

View File

@ -0,0 +1,3 @@
> main/publishLocal
> user/run
-> user2/run