最佳实践项目功能子模块与水银和Eclipse? [英] Best Practices for Project Feature Sub-Modules with Mercurial and Eclipse?

查看:119
本文介绍了最佳实践项目功能子模块与水银和Eclipse?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一对夫妇为几个不同的客户ANT项目;目录结构我有我的项目是这样的:

I have a couple of ANT projects for several different clients; the directory structure I have for my projects looks like this:

L___standard_workspace
    L___.hg
    L___validation_commons-sub-proj  <- JS Library/Module
    |   L___java
    |   |   L___jar
    |   L___old_stuff
    |   L___src
    |   |   L___css
    |   |   L___js
    |   |       L___validation_commons
    |   L___src-test
    |       L___js
    L___v_file_attachment-sub-proj  <- JS Library/Module
    |   L___java
    |   |   L___jar
    |   L___src
    |   |   L___css
    |   |   L___js
    |   L___src-test
    |       L___js
    L___z_business_logic-sub-proj  <- JS Library/Module
    |   L___java
    |   |   L___jar
    |   L___src
    |       L___css
    |       L___js
    L____master-proj               <- Master web-deployment module where js libraries are compiled to.
        L___docs
        L___java
        |   L___jar
        |   L___src
        |       L___AntTasks
        |           L___build
        |           |   L___classes
        |           |       L___com
        |           |           L___company
        |           L___dist
        |           L___nbproject
        |           |   L___private
        |           L___src
        |               L___com
        |                   L___company
        L___remoteConfig
        L___src
        |   L___css
        |   |   L___blueprint
        |   |   |   L___plugins
        |   |   |   |   L___buttons
        |   |   |   |   |   L___icons
        |   |   |   |   L___fancy-type
        |   |   |   |   L___link-icons
        |   |   |   |   |   L___icons
        |   |   |   |   L___rtl
        |   |   |   L___src
        |   |   L___jsmvc
        |   L___img
        |   |   L___background-shadows
        |   |   L___banners
        |   |   L___menu
        |   L___js
        |   |   L___approve
        |   |   L___cart
        |   |   L___confirm
        |   |   L___history
        |   |   L___jsmvc
        |   |   L___mixed
        |   |   L___office
        |   L___stylesheets
        |   L___swf
        L___src-standard

在工作拷贝模块编译子项目成被放置在主项目目录的Javascript一个JavaScript文件。

Within the working copy the modules compile the sub-project into a single Javascript file that is placed in the Javascript directory of the master project.

例如,目录:


  • validation_commons-副突出

  • v_file_attachment-副突出

  • z_business_logic-副突出

  • validation_commons-sub-proj
  • v_file_attachment-sub-proj
  • z_business_logic-sub-proj

......所有的组合和缩小的(有点像编译)为在 _master-凸出/ JS 目录中的一个不同的JavaScript文件名;并在最后步骤中的 _master-凸出编译被部署到服务器

...all are combined and minified (sort of like compiled) into a different Javascript filename in the _master-proj/js directory; and in the final step the _master-proj is compiled to be deployed to the server.

现在在问候的方式,我想用汞设置此,希望我能够做的就是从克隆自己基线库主项目及其子项目到客户端的工作拷贝,使模块可以(采用汞柱)被添加到一个特定客户的工作拷贝。

Now in regards to the way I'd like to set this up with hg, what I'd like to be able to do is clone the master project and its sub-projects from their own base-line repositories into a client's working-copy, so that modules can be added (using hg) to a particular customer's working copy.

此外然而,当我做出一些改变/修复一个客户的工作拷贝错误,我希望能够有选择地推动更改/ bug修复回主项目/分项目的基线库,对于最终拉动改变用途/修复成可能包含需要修复的漏洞一样其他客户工作拷贝。

Additionally however, when I do make some changes to/fix bugs in one customer's working copy, I would like to be able to optionally push the changes/bug fixes back to the master project/sub-project's base-line repository, for purposes of eventually pulling the changes/fixes into other customer's working copies that might contain the same bugs that need to be fixed.

在这样我就可以在不同的客户端使用相同的错误修复。

In this way I will be able to utilize the same bug fixes across different clients.

不过......我不确定为此使用汞和Eclipse的最佳途径。

However...I am uncertain of the best way to do this using hg and Eclipse.

读到这里中,你可以使用汞的的转换的扩展使用的子目录分割成一个单独的项目 - filemap 选项。

I read here that you can use hg's Convert Extension to split a sub-directory into a separate project using the --filemap option.

不过,我还是有点困惑,是否会更好地使用转换扩展或是否会更好,只是容纳每个模块在自己的仓库,检查出来到每个客户端一个工作区。

However, I'm still a little bit confused as to if it would be better to use the Convert Extension or if it would be better to just house each of the modules in their own repository and check them out into a single workspace for each client.

推荐答案

是的,它看起来像的 subrepos 是你在找什么,但我想,也许这是一个错误的问题的正确答案,我强烈怀疑你会碰到类似的issues:外部

Yep, it looks like subrepos are what you are looking for, but I think maybe that is the right answer for the wrong question and I strongly suspect that you'll run into similar issues that occur when using svn:externals

相反,我建议你发布你的组合和缩小的JS文件到人工制品库和使用依赖管理者,如常春藤来拉你的文物的特定版本到您的主项目。这种方法可以让您对您的主项目采用分项工程的版本更大的控制权。

Instead I would recommend that you "publish" your combined and minified JS files to an artefact repository and use a dependency manager such as Ivy to pull specific versions of your artefacts into your master project. This approach give you far greater control over the sub-project versions your master project uses.

如果您需要bug修复到一个子项目为特定的客户端,你可以做的主线为子项目的修复程序,发布一个新的版本(最好通过的自动生成管道)和更新自己的主项目,以使用新版本。哦,你想发布前进行测试与他们的主项目的新版本?在这种情况下,你把你的修复之前,结合并在本地运行如下的子项目,将其发布到的本地仓库并让客户端的主项目拿起该版本为您的测试。

If you need to make bug fixes to a sub-project for a particular client, you can just make the fixes on the mainline for that sub-project, publish a new version (ideally via an automated build pipeline) and update their master project to use the new version. Oh, you wanted to test the new version with the their master project before publishing? In that case, before you push your fix, combine and minify your sub-project locally, publish it to a local repository and have the client's master project pick up that version for your testing.

这篇关于最佳实践项目功能子模块与水银和Eclipse?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆