NAnt 上的并行任务执行
我正在使用 NAnt 以不同的配置为同一软件构建 5 个不同的安装程序包。这些任务可以并行化,因为它们彼此不依赖。构建这些配置的 Installshield 在多核 CPU 使用方面似乎效率低下(4 核机器上的 CPU 使用率上限为 25%)。我一直在寻找一种简单的方法来并行化任务,只找到了这个,这几乎是我需要什么。然而,该项目的源代码不可用,并且它引用了一些在最新版本的 NAnt 0.91 中不可用的类型,而我们需要 .NET 4.0 支持。
除了编写我自己的 NAnt 扩展之外,还有什么解决这个问题的想法吗?
I am using NAnt to build 5 different installer packages for the same software, in different configurations. These tasks can be parallelized as they are not dependent on each other. Installshield which is building these configuration seems inefficient with regards to multi core CPU usage (the usage capped at 25% CPU on a 4 core machine). I have been looking for an easy way to parallize tasks and only found this, which is pretty much what I need. However the source code for this project is not available and it's referencing some types which are not available in the latest version of NAnt 0.91 which we require for .NET 4.0 support.
Any ideas on how to solve this, short of writing my own extension for NAnt?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
老实说,这并不是特别困难,但我不知道有任何其他现成的项目或 NAnt 贡献任务可以做到这一点。因此,您唯一的选择几乎就是编写自己的并行任务实现。也就是说,由于这个人提供了已编译的程序集,因此您可以随时在 Reflector 中查看它们并了解总体思路,如果您明白我的意思的话:)
This isn't particularly difficult quite honestly, but I don't know of any other ready-made project or contrib task for NAnt that will do it. So your only option is pretty much to write your own parallel task implementation. That said, since the guy provides compiled assemblies, you could always give them a look-see in Reflector and get the general idea, if you know what I mean :)
看看 https://github.com/NAntCrossCompile/NAnt.Parallel
有一个正在开发的插件,它允许基于文件、文件夹、字符串集并行执行任务......
Have a look at https://github.com/NAntCrossCompile/NAnt.Parallel
There is a plugin in development which allows the parallel execution of tasks based on sets of files, folders, strings...
我实际上是通过写信给作者找到了源代码。它现在是 CIFactory 项目的一部分,可以通过项目主页。经过一些修改,我能够让它在最新的 NAnt 版本上运行。当我解决一些问题时,我会发布它,主要是关于输出流到哪里。
I actually found the source code by writing to the author. It's now a part of a project colled CIFactory and the source code can be accessed through the project homepage. With a few modifications I was able to get it running on the latest NAnt version. I will publish it when I work out a few kinks, mostly regarding where the output is streamed to.
如果您回头查看该页面,请在评论中进一步查看
源代码链接
源代码可用。 '当然反射器会用正确的插件拆卸......
If you look back on the page, further down in the comments
Links to source code
The source is available. 'course reflector would dissassemble with the right plugin...