I have a simple build tool Multi-Project problem...
I have the following directory structure represents my java sbt projects:
/project1
/project2
/project3
So all projects share a common direct parent folder. Projects 2 and 3 are referenced in project 1's build.sbt like this:
.dependsOn(project2, project3)
.aggregate(project2, project3)
lazy val project2 = ProjectRef(file("../project2"), "project2")
lazy val project3 = ProjectRef(file("../project3"), "project3")
This way there's a dependency between project1 and the others.
All is fine to this point and everything works as it should.
But now I want to execute the main method from project2 before anything else is executed. When I execute the "run" task from the parent (project1), I want a specific class from project2 to have its main method executed. How do I do this? The sbt documentation explains that "Aggregation means that running a task on the aggregate project will also run it on the aggregated projects.": http://www.scala-sbt.org/0.13.5/docs/Getting-Started/Multi-Project.html#aggregation
I'm not seeing my main class on projet2 been executed. I also added this to project2's build.sbt:
mainClass in (Compile, run) := Some("Main")
The goal of the projet is to generate code at Compiletime and runtime. Project2's job is to generate Java and Javascript code. The could should be generated before the other projects are built.
Is that possible? If not, I'll have to settle for running project2 independently from the other projects.
=]
run in Compile <<= (run in Compile in project2)
– Napkin