dbuild
dbuild copied to clipboard
Add support for Mercurial project repositories
It appears from the documentation that only git or svn repositories are currently supported by dbuild. Assuming that I've got the right impression, this limitation prevents me from adding our Kiama project to the Scala community build since Kiama lives on Google Code in a Mercurial repository.
Are there any plans to add Mercurial support?
Hello, there are no plans to add Mercurial support at this time. However, we would welcome contributions to add support for further version control systems. Implementing a new module is actually rather easy. You can check the trait ProjectResolver, in: https://github.com/typesafehub/dbuild/blob/v0.9.2/core/src/main/scala/com/typesafe/dbuild/project/resolve/ProjectResolver.scala#L12
canResolve() could just check for a uri of the form "hg:..." (or "hgs:..."?).
resolve() fetches the selected uri into the directory pointed to by dir. The uri fragment denotes the required tag, or commit, or branch; resolve() must return a new ProjectBuildConfig in which the branch or other qualifier in the uri fragment is replaced by a repeatable commit identifier.
You may refer to the simple svn implementation for an example:
https://github.com/typesafehub/dbuild/blob/v0.9.2/support/src/main/scala/com/typesafe/dbuild/support/svn/ProjectResolver.scala
Finally, you will just need to append the resolver to the lists at:
https://github.com/typesafehub/dbuild/blob/v0.9.2/build/src/main/scala/com/typesafe/dbuild/build/Checkout.scala#L53
and
https://github.com/typesafehub/dbuild/blob/v0.9.2/build/src/main/scala/com/typesafe/dbuild/build/LocalBuildMain.scala#L23
If you need any additional information, please just let me know.
I will see if I can find some time for this, but I'm not likely to in the near future, unfortunately. For now I will not be able to include Kiama in the Scala community build.
Mercurial has fallen out of favor