diff --git a/sbt/src/sbt-test/run/non-local-main/build.sbt b/sbt/src/sbt-test/run/non-local-main/build.sbt new file mode 100644 index 000000000..0010f0c27 --- /dev/null +++ b/sbt/src/sbt-test/run/non-local-main/build.sbt @@ -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") +) + + diff --git a/sbt/src/sbt-test/run/non-local-main/main/src/main/scala/Test.scala b/sbt/src/sbt-test/run/non-local-main/main/src/main/scala/Test.scala new file mode 100644 index 000000000..e5ced234e --- /dev/null +++ b/sbt/src/sbt-test/run/non-local-main/main/src/main/scala/Test.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + println("SUCCESS") + } +} \ No newline at end of file diff --git a/sbt/src/sbt-test/run/non-local-main/test b/sbt/src/sbt-test/run/non-local-main/test new file mode 100644 index 000000000..f46eeb9d3 --- /dev/null +++ b/sbt/src/sbt-test/run/non-local-main/test @@ -0,0 +1,3 @@ +> main/publishLocal +> user/run +-> user2/run \ No newline at end of file