mirror of https://github.com/sbt/sbt.git
Add automated tests for main-class regression.
This commit is contained in:
parent
2d3f57ad51
commit
01550a47be
|
|
@ -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")
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
object Test {
|
||||
def main(args: Array[String]): Unit = {
|
||||
println("SUCCESS")
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
> main/publishLocal
|
||||
> user/run
|
||||
-> user2/run
|
||||
Loading…
Reference in New Issue