lightbend-labs / dbuild

Multi-project build tool, based on sbt.
https://lightbend-labs.github.io/dbuild
Other
83 stars 14 forks source link

dbuild on the local filesystem #159

Closed mosesn closed 7 years ago

mosesn commented 9 years ago

Problem

I don't know how to use dbuild if I want to use it to just build some local projects.

The specific problem I have is that I have a monolithic repository with several sbt projects inside of it. There isn't a one-to-one mapping of git repositories to sbt projects. How can I tell dbuild to not bother checking out a new repository, but instead just use the local one?

gkossakowski commented 9 years ago

I don't think you can avoid checking out repository for each project separately. However, you can specify the same repository. Then, you have to point dbuild at directory where each project lives. You can do that using extra.directory option, see for example Play's definition:

  extra: ${vars.base.extra} {
      projects: ["Play"]
      directory: "framework"
      [...]
    }
cunei commented 9 years ago

Incidentally, when git clones a local repository, it will use by default hard links to the original repository's data whenever possible; therefore, if you ask dbuild to clone the initial repository several times, that will only require very little additional disk space, and should not require a full copy of the original repository for each cloned repository.

mosesn commented 9 years ago

OK, if I want to improve this, how would I go about doing it?

cunei commented 7 years ago

Hello @mosesn, as mentioned in the previous answers you can use dbuild with a single repository that contains multiple projects: you just have to use the same source URL for multiple dbuild projects, and different subdirectories for the "directory" option for each. Even if you see multiple clones being made, there will actually only be one copy, that is kept by dbuild in the "clones" directory; all the other copies are just hard links and do not occupy space, other than for the built files. If your original URL is a repository on your local file system, specified using the "file:///..." format, then the clone made by dbuild will also be just a hard link to your existing local repository, and it will not use any significant disk space. I hope this explanation is of help; I am closing the ticket but please let me know if you need further information concerning this matter.