zoukankan      html  css  js  c++  java
  • nmake vs MSBuild

    nmake 和 msbuild都是两种命令行自动编译系统,功能大同小异。现在的vs 2005已经采用了msbuild系统。
    nmake的格式采用的是比较直白的,文件很简单:
    proxy.obj: ..\proxy.c ..\putty.h ..\network.h ..\proxy.h ..\puttyps.h \
            ..\misc.h ..\windows\winstuff.h ..\mac\macstuff.h \
            ..\macosx\osx.h ..\unix\unix.h ..\puttymem.h ..\tree234.h \
            ..\windows\winhelp.h ..\charset\charset.h
        cl $(COMPAT) $(CFLAGS) $(XFLAGS) /c ..\proxy.c

    而msbuild使用的是xml文件:
        <Compile Include="Form1.cs">
          <SubType>Form</SubType>
        </Compile>
        <Compile Include="Form1.Designer.cs">
          <DependentUpon>Form1.cs</DependentUpon>
        </Compile>

    对比二者,虽然msbuild是后起之秀,但感觉他相比前者更难于用手工编辑,如果纯粹是用ide维护这个文件当然没问题,但是却给需要手动配置的开发者制造了麻烦。需要阅读/输入冗长的xml tag。msbuild可能有带来很多创新,但是不得不遗憾得说他更加远离人类了。
    而且网上也有人开始抱怨:

    I’ve been looking into MSBuild recently. It’s nice, seems to do a good job, and handles the normal tasks that one would expect from a build manager. But I can’t figure out why it was necessary for Microsoft to develop this tool.

    Granted, the build process in Visual Studio 2003 was rather opaque, so a better solution was necessary. However, a standard build system has existed for decades in the form of ‘make’ programs. Microsoft even has its own make utility…namely NMAKE. The NMAKE program has been around for many years.

    MSBuild has some nice features such as In-Process Tasks, Metadata, and Conditionals. But these are merely small additions to a build management process that really hasn’t changed between the old makefiles and the new MSBuild system. MSBuild uses all the same concepts as makefiles. Specifically, it still deals with targets, dependencies, file lists, and commands. Rather than develop a whole new build system, the additional new features could have easily been added as extensions to the NMAKE language. However, rather than update NMAKE, Microsoft instead decided to reinvent the wheel (something that most organizations strive to avoid). Moreover, the MSBuild project files are XML. This makes it much easier for MSBuild to parse the files, but they are much more difficult for humans to read than are makefiles. It also puts a significant burden on a large number of developers the world over to learn a new tool, and a new project file language. Was the ability to more easily parse the file worth the extra effort that is now required of untold thousands of developers? It seems like this was something that should have been avoided.

  • 相关阅读:
    Java实现 蓝桥杯VIP 算法训练 接水问题
    Java实现 蓝桥杯VIP 算法训练 接水问题
    Java实现 蓝桥杯VIP 算法训练 接水问题
    谈Delphi中SSL协议的应用(好多相关文章)
    DELPHI中IDE宏录制小用
    SQLite数据库的体系结构(翻译自sqlite.org)
    NewPascal(也许只是对FreePascal的一种封装)
    Loongnix 系统(MIPS Linux)
    死锁的解决经历
    获得WCF Client端的本地端口
  • 原文地址:https://www.cnblogs.com/smwikipedia/p/1420256.html
Copyright © 2011-2022 走看看