开发者

Parent build file in buildr

开发者 https://www.devze.com 2023-01-18 20:03 出处:网络
I am currently looking at migrating from maven2 to buildr and I am concerned about how get to keep the build scripts DRY.

I am currently looking at migrating from maven2 to buildr and I am concerned about how get to keep the build scripts DRY.

Currently our maven project is defined with parent pom file containing all common build code and is picked up like any other dependency:

<parent>
    <groupId>com.companyname</groupid>
    <artifactId>parent</artifactId>
    <version>1.0.0</artifactId>
</parent>

Now I am looking at buildr and I notice that it does have a simular concept but it would require placing a 开发者_Go百科buildfile one level-up, for example:

/svnrepo/buildfile
/svnrepo/ProjectA
/svnrepo/ProjectB

This is a problem however because these projects are not related and will be checked out and build totally separately. So my question is: how do I best solve this problem? How do I reference a common buildfile while being able to checkout only one project at a time?


I discovered the answer to this problem and I am kicking myself about how easy it is: create a gem.

replace parent-pom.xml with parent.rb and distribute the ruby file as a gem to be required by all other projects.


I think you are confused:

on one hand, your projects are right now built together with Maven, with 4 different repositories that you check out in the right places or use svn:externals. That sounds like a bad idea.

On the other hand, you want to do the same thing with Buildr, but are concerned it's not going to look good ?

Please build those projects separately indeed! If you have code that can be reused from a project to another, like a custom task, then use a svn:externals in each project pointing to a ruby file that the buildfile requires.

0

精彩评论

暂无评论...
验证码 换一张
取 消