Benutzer:MovGP0/NET/MSBuild
Zur Navigation springen
Zur Suche springen
MovGP0 | Über mich | Hilfen | Artikel | Weblinks | Literatur | Zitate | Notizen | Programmierung | MSCert | Physik |
MSBuild[Bearbeiten | Quelltext bearbeiten]Targets and Task[Bearbeiten | Quelltext bearbeiten]
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="HelloWorld">
<Message Text="Hello World!" />
</Target>
</Project>
msbuild myproject.msproj /target:HelloWorld
Properties[Bearbeiten | Quelltext bearbeiten]
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AppServer>\\app.server</AppServer>
<WebServer>\\web.server</WebServer>
</PropertyGroup>
</Project>
equal to: <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AppServer>\\app.server</AppServer>
</PropertyGroup>
<PropertyGroup>
<WebServer>\\web.server</WebServer>
</PropertyGroup>
</Project>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<HelloMessage>Hello World!</HelloMessage>
</PropertyGroup>
<Target Name="HelloWorld">
<Message Text="$(HelloMessage)" />
</Target>
</Project>
msbuild myproject.msproj /t:HelloWorld
Items[Bearbeiten | Quelltext bearbeiten]
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<SolutionFile Include="..\MySolution.sln" />
<Compile Include="Program.cs;Properties\AssemblyInfo.cs" />
<Compile Include="MainForm.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon> <!-- File nesting -->
</Compile>
</ItemGroup>
<Target Name="PrintInfo">
<Message Text="SolutionFile: @(SolutionFile)" />
<Message Text="Files to Compile: @(Compile)" /> <!-- Program.cs;Properties\AssemblyInfo.cs;MainForm.cs;MainForm.Designer.cs -->
</Target>
</Project>
Item Metadata[Bearbeiten | Quelltext bearbeiten]
<Project DefaultTargets="PrintMetadata" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Compile Include="MyClass.cs" />
</ItemGroup>
<Target Name="PrintMetadata">
<Message Text="%40(Compile->'%25(FullPath)')" />
</Target>
</Project>
Conditions[Bearbeiten | Quelltext bearbeiten]
<Project DefaultTargets="PrintContent" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="$(Configuration) == ''"> <!-- set only when not already set -->>
<Configuration>Release</Configuration>
</PropertyGroup>
<ItemGroup>
<Content Include="script.js" />
<Content Include="script.debug.js" Condition="$(Configuration) == 'Debug'" />
</ItemGroup>
<Target Name="PrintContent">
<Message Text="Configuration: $(Configuration)" />
<Mesage Text="Content: @(Content)" /> <!-- script.js -->
</Target>
</Project>
|