跨平台构建环境
作为优秀的开发人员,我们尽可能使我们的代码符合标准,以帮助在平台之间进行移植。 但是有哪些工具可以帮助我们跨多个平台以统一的方式构建代码。
*nix 系列有 make
,但 Windows 需要 nmake
。
我读过SCons,但从未在愤怒中使用过它。 您最喜欢的构建工具是什么,为什么您发现它有效以及是否有任何限制(即支持不良的平台等)。
跨平台 IDE 也是如此。
As good developers we keep our code as standard compliant as possible to help in porting between platforms. But what tools are available that help us build the code in a uniform way across multiple platforms.
*nix family has make
but Windows needs nmake
.
I have read about SCons but never used it in anger. What is your favorite build tool, why do you find it effective and are there any limitations (i.e. platforms with bad support etc).
Cross platform IDEs as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
我个人使用ant、rake、maven2。 我最常使用 ant,并发现它很棒,有几个原因:
因为它是 java,所以它可以在很多平台上运行(无需更改任何脚本)
构建文件是用 XML 编写的,并且相当容易编写
有很多可用的第 3 方扩展,并且它是易于编写插件
I personally use ant, rake, and maven2. I have used ant the most and find it great for several reasons:
Because it is java it works on lots of platforms (without changing any scripts)
The build files are written in XML and fairly easy to write
There are lots of 3rd party extensions available for it and it is easy to write plugins for
我们进行极限交叉开发,我们的代码可以在linux、windows ce、windows 2K、nucleus和uCOS-II上运行。
因为每个环境使用不同的“make”方法(例如,nucleus 客户要求我们通过 code-warrior GUI 进行编译)。
我将 ANT 与 perl 结合使用了大约 2 年,但这导致构建脚本完全不可维护。
现在我们转而使用Python,这增加了脚本的可维护性。
最重要的是,我没有找到现成的工具,不得不构建自己的工具。 也许,当我有时间(2017 年?)时,我会打包我的脚本并分发它们......
we do extreme cross development, and our code runs on linux, windows ce, windows 2K, nucleus and uCOS-II.
since each environment uses different 'make' methodology (out nucleus customer, for example, require us to compile via code-warrior GUI).
i used ANT combined with perl for about 2 years, but this lead the build script to total non-maintainability.
now we moved to use python, which increase the maintainability of the scripts.
bottom line, i did not find a ready-made tool, and had to build my own. maybe, when i have some time (2017 ?) i will pack my scripts and distribute them ....
如果您身处 Java 世界,就会发现有很多跨平台的工具。 Apache Ant 和 Maven 都是构建工具,可以在任何支持 Java 的平台上运行。
Cruise Control(持续集成工具)也适用于 Windows 和 Linux(也是用 Java 编写的)。
我对核心工具没有任何真正的问题,我有时遇到的唯一问题来自构建过程之外的事情,即发布工件 - 这在系统之间会有所不同,所以我发现没有单一的方法设置它。
If you're in the Java world, there are quite a few tools which are cross-platform. Apache Ant and Maven are both build tools which will run on any platform which has Java available for it.
Cruise Control (continuous integration tool) also works on Windows and Linux (it's written in Java as well).
I haven't had any real issues with the core tools, the only problems I've sometimes had have come from things external to the build process, i.e. publishing artifacts - this will vary between systems so I've found there's no single way of setting it up.
对于 C/C++ 开发,我发现 bakefile 效果很好。 相当大的 wxWidgets 项目,一个跨平台的跨平台实用程序和 UI 库,使用它来构建文件生成。
For C/C++ development, I've found that bakefile works well. The fairly large wxWidgets project, a cross-platform cross-platform utility and UI library, uses it for their build file generation.
您可以在 Windows 上使用 gmake 以及 cygwin/minGW 或在 Linux 上构建 Windows 内容。
http://cdtdoug.blogspot.com/2009/05/ mingw-cross-for-linux.html
You can use gmake on Windows as well with cygwin/minGW or build your windows stuff on Linux.
http://cdtdoug.blogspot.com/2009/05/mingw-cross-for-linux.html
Opus Make 或 MKS Toolkit 等工具可提供多平台和支持。 如果您有 make 脚本的现有代码库,则可以更轻松地迁移到其中之一。 我怀疑您可能会在 DDJ 杂志的广告中寻找类似的工具。
There are tools like Opus Make or MKS Toolkit that offers multiplatform and support. If you have an existing codebase of make script, could be easier migrate to one of there. I suspect you may hunt for similar tools in advertising of DDJ magazine.
过去 18 个月来,我们一直在运行适用于 Linux、Windows 和 Mac 的 Java 环境。
我们确实使用过 GWT 一段时间,但这确实给我们带来了很大的痛苦。 如果你那样挥杆的话要小心。
We've been running a Java environment for Linux, Windows and the Mac for the last 18 months.
We did use GWT for a while and this did cause us large amounts of pain. Be careful if you swing that way.
用于 c/c++ 环境的 cmake 很好。 http://www.cmake.org/
cmake for c/c++ environments is good. http://www.cmake.org/