需要底漆的MSBuild的新手 [英] Need primer for a Msbuild newbie

查看:286
本文介绍了需要底漆的MSBuild的新手的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们维持在VB / C#.NET的开发工作,一个中等大小的Windows应用程序。不过现在的构建和部署过程中为这个应用程序是手动的。我决心使这个过程中使用的MSBuild在那些我不知道现在还在自动化。

We maintain a medium sized windows application developed in vb/c# .net in work. Still now the build and deploy process for this app is manual. I am determined to make this process automated using MSBuild on which i have no knowledge still now.

我们的应用程序有一个简单的构建结构,设置已分为四种解决方案(的.sln)项目,只需要建立四个前哨淋巴结的顺序。然后发布一个项目(也就是最后的sln的一部分待建)到一个目录。这就对了。一个简单的过程,已经耗费手工打造时间为30分钟,我是pretty的肯定,这可以在不ATLEAST 1/4次方时使用的MSBuild人工干预来实现。

Our app has a simple build structure, set of projects already grouped into four solutions(.sln) and just need to build the four slns in an order. And then publish a project(which is part of the last sln to be built) to a directory. That is it. A simple process which is already consuming 30 mins of manual build time and i'm pretty sure that this can be accomplished without manual interference using msbuild in atleast 1/4 th of the time.

我所有的目标设定好,我开始四处寻找网上的MSBuild的资源来完成我的过程,但可以环视许多事情搞糊涂了。需要一个指针或如何启动和从哪里开始我的简单场景一个很好的解释。帮助是非常AP preciated。

All my goals set good, i started looking around web for MSBuild resources to accomplish my process but may be looking around many things confused me. Need a pointer or a good explanation on how to start and where to start for my simple scenario. Help is much appreciated.

推荐答案

这听起来像是一个非常简单的脚本编写。即使是一个批处理文件会做:

This sounds like a very easy script to write. Even a batch file would do:

msbuild \path\to\first.sln /p:Configuration=Release
msbuild \path\to\second.sln /p:Configuration=Release
msbuild \path\to\third.sln /p:Configuration=Release
msbuild \path\to\fourth.sln /p:Configuration=Release
call deploy

当然,更好的办法是有一个服务器在运行,说的 CruiseControl.NET ,给出一个Web界面到构建状态和历史记录。

Of course, much better would be to have a server running, say CruiseControl.NET, that gives a web interface into the build status and history.

在MS建设,主要有两个控制点来电:目标和它的属性。我们的目标是什么编制,资源,编译,部署等属性控制如何的目标是建立。

In MS Build, there are two main control points for the caller: The Target and its Properties. The Target is what to compile, resources, compilation, deployment, etc. The Properties control how that Target is built.

您可以控制​​使用的配置属性(见上文)的配置。如果你打开​​你的 的凸出的文件,你会发现的PropertyGroup 元素。这些都可以通过命令行可设置使用 / P> / code> ARG。

You can control the configuration using the Configuration property (see above). If you open your .proj files, you will notice PropertyGroup elements. These are settable via the commandline using the /p arg.

下面是规格为二的args:

Here are the specs for the two args:

/target:<targets>  Build these targets in this project. Use a semicolon or a
                 comma to separate multiple targets, or specify each
                 target separately. (Short form: /t)
                 Example:
                   /target:Resources;Compile

/property:<n>=<v>  Set or override these project-level properties. <n> is
                 the property name, and <v> is the property value. Use a
                 semicolon or a comma to separate multiple properties, or
                 specify each property separately. (Short form: /p)
                 Example:
                   /property:WarningLevel=2;OutDir=bin\Debug\

这篇关于需要底漆的MSBuild的新手的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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