수색…


비고

이 섹션에서는 msbuild가 무엇인지, 왜 개발자가 그것을 사용하고 싶어하는지에 대한 개요를 제공합니다.

또한 msbuild 내의 큰 주제를 언급하고 관련 주제에 링크해야합니다. msbuild의 설명서가 새롭기 때문에 이러한 관련 항목의 초기 버전을 만들어야 할 수도 있습니다.

설치 또는 설정

MSBuild 2015

Windows에서 MSBuild를 얻는 방법에는 세 가지가 있습니다.

Linux의 경우

사용자 지정 MSBuild 대상 만들기

<PropertyGroup>
     <!-- Definition of a Property named "TestCondition". A PropertyGroup may also be placed inside a Target. -->
    <TestCondition>True</TestCondition>
</PropertyGroup>

<!-- This Target will run after the "Clean" Target, subject to a Condition. -->
<Target Name="SpecificTarget" AfterTargets="Clean" Condition=" '$(TestCondition)' == 'True' ">
    <!-- Displaying a custom message -->
    <Message Text="Here is my Specific Target" Importance="Low" />
    <!-- Here come your specific code. -->
</Target>

안녕하세요 세계

HelloWorld.proj

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="SayHello">  

    <!-- Properties can be passed as command line parameters. i.e. /p:Name=MyName 
    or /p:Name="My Name" (Use quotes if the value includes spaces) -->  
    <PropertyGroup>
        <Name Condition="'$(Name)'==''">Rolo</Name>
    </PropertyGroup>  

    <!-- Items can't be passed as command line parameters. -->   
    <!-- Items can include metadata. i.e. URL -->  
    <ItemGroup>  
        <People Include="World"/>  
        <People Include="StackOverflow">  
            <URL>http://stackoverflow.com</URL>
        </People>
        <People Include="Google">  
            <URL>http://google.com</URL>  
        </People>  
    </ItemGroup>  

    <!-- Targets can be called using it's name. i.e. /t:SayHello -->  
    <Target Name="SayHello">  
        <!-- You can have as many Tasks as required inside a Target. -->  
        <!-- Tasks can be executed conditionally. -->  
        <Message Condition="'%(People.URL)'==''" Text="Hello %(People.Identity), my name is $(Name)! "/>  
        <Message Condition="'%(People.URL)'!=''" Text="Hello %(People.Identity), my name is $(Name)!. Your URL is %(People.URL) "/>  
    </Target>  
</Project>  

다음으로 실행 :

  • msbuild HelloWorld.proj
  • msbuild HelloWorld.proj / p : Name = "John Doe"
  • msbuild HelloWorld.proj / p : Name = "Batman"/ t : SayHello


Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow