Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-project build not working #914

Closed
nicl opened this issue Nov 17, 2016 · 4 comments
Closed

Multi-project build not working #914

nicl opened this issue Nov 17, 2016 · 4 comments

Comments

@nicl
Copy link

nicl commented Nov 17, 2016

Hi, I'm trying to package a multi-project build into a single zip file.

lazy val commonSettings =
  net.virtualvoid.sbt.graph.Plugin.graphSettings ++
    scalariformKeysPref ++
    scalariformSettings

lazy val api = (project in file("api"))
  .settings(commonSettings)

lazy val integration = (project in file("integration"))
  .settings(commonSettings)
  .dependsOn(api)

lazy val root = (project in file("."))
  .enablePlugins(UniversalPlugin)
  .settings(
    name := "api",
    version := "1.0"
  )
  .aggregate(api, integration)
  .dependsOn(api, integration)

When I run packageZipTarball I'm get errors like:

(root/universal:packageZipTarball) java.io.IOException: Cannot run program "tar" (in directory "/var/folders/wp/xl36r_2s4595xndg3k75hbz80000gp/T/sbt_8cc085f6/api"): error=2, No such file or directory

Can someone point me to docs/help on how to get this working? At the moment it looks like it is not finding any files to bundle into the zip. I could manually specify the mappings, but I feel like there must be an easier/more correct solution here.

Thanks.

UPDATE: figured out a solution:

mappings in Universal <++= (sourceDirectories in (api, Compile)).map(dirs => dirs.flatMap(d => directory(d))),

in settings for the root project. Would be good to know if this is the 'recommended' way but it seems to work fine.

@nicl nicl closed this as completed Nov 17, 2016
@nicl
Copy link
Author

nicl commented Dec 2, 2016

Update: in fact the advice above is not great. For posterity, the thing I was doing wrong was I'd actually managed to delete the 'dependsOn' for the root project somehow.

@muuki88
Copy link
Contributor

muuki88 commented Dec 3, 2016

Thanks for sharing. I hadn't had time to take a look so far.

@nicl
Copy link
Author

nicl commented Dec 5, 2016

I think the issue here is that you need to understand sbt multi-project builds well enough before trying to use sbt-native-packager with one. Which is fair enough I guess but does require a closer reading of the sbt docs http://www.scala-sbt.org/0.13/docs/Multi-Project.html.

@muuki88
Copy link
Contributor

muuki88 commented Dec 5, 2016

Yes 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants