singrdk/base/Targets/ILAssembly.targets

113 lines
3.9 KiB
Plaintext
Raw Normal View History

2008-03-05 09:52:00 -05:00
<!--
##############################################################################
#
# Microsoft Research Singularity
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# File: Targets\ILAssembly.targets
Projects that import this file can set the following properties:
AssemblyName Name of assembly, excluding file extension
OutputType 'Exe' or 'Library'
NoStrongName 'true' to turn off assembly strong name signing
2008-11-17 18:29:00 -05:00
OutputPath Specifies output path for the assembly. Default is $(APPILLSDIR).
2008-03-05 09:52:00 -05:00
Projects can declare the following items:
Compile Source file (.cs or .sg, etc.)
-->
<Project DefaultTarget="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Supply defaults. -->
<PropertyGroup>
<NoStrongName Condition="'$(NoStrongName)'==''">false</NoStrongName>
2008-11-17 18:29:00 -05:00
<OutputPath Condition="'$(OutputPath)'==''">$(APPILLSDIR)</OutputPath>
2008-03-05 09:52:00 -05:00
</PropertyGroup>
<!-- Build the command line for the ilasm compiler. -->
<PropertyGroup>
2008-11-17 18:29:00 -05:00
<CompilerFlags>/nologo /pdb /quiet</CompilerFlags>
2008-03-05 09:52:00 -05:00
</PropertyGroup>
<Choose>
<When Condition="'$(OutputType)'=='Exe'">
<PropertyGroup>
<AssemblyExt Condition="'$(AssemblyExt)'==''">.exe</AssemblyExt>
<CompilerFlags>$(CompilerFlags) /exe</CompilerFlags>
</PropertyGroup>
</When>
<When Condition="'$(OutputType)'=='Library'">
<PropertyGroup>
<AssemblyExt Condition="'$(AssemblyExt)'==''">.dll</AssemblyExt>
<CompilerFlags>$(CompilerFlags) /dll</CompilerFlags>
</PropertyGroup>
</When>
<Otherwise>
<ItemGroup>
<Error Include="The value '$(OutputType)' is not valid for the 'OutputType' property."/>
</ItemGroup>
</Otherwise>
</Choose>
<PropertyGroup>
<AssemblyFileName>$(AssemblyName)$(AssemblyExt)</AssemblyFileName>
<OutputAssemblyPath>$(OutputPath)\$(AssemblyFileName)</OutputAssemblyPath>
<CompilerFlags>$(CompilerFlags) /output=$(OutputAssemblyPath)</CompilerFlags>
<CompilerFlags Condition="'$(NoStrongName)'!='true'">$(CompilerFlags) /key=$(OutputPath)\public.snk</CompilerFlags>
</PropertyGroup>
<!-- TARGETS -->
<Target Name="CreateStrongName" Condition="'$(NoStrongName)'!='true'">
<MSBuild Projects="$(SINGULARITY_ROOT)\Build\BuildKey.proj"/>
</Target>
<Target Name="CheckErrors">
<Error Condition="'@(Error)'!=''" Text="%(Error.Identity)"/>
<Error Condition="'$(AssemblyName)'==''" Text="The 'AssemblyName' property is required."/>
<Error Condition="'$(OutputPath)'==''" Text="The 'OutputPath' property is required."/>
<Error Condition="'$(OutputType)'==''" Text="The 'OutputType' property is required."/>
</Target>
<Target Name="ShowDebugInfo" DependsOnTargets="CheckErrors">
<Message Text="Projects: @(ProjectReference,' ')"/>
<Message Text="Dependent project: %(ProjectReference.Identity)"/>
<Message Text="_aliased_refs: %(_aliased_refs.Identity)"/>
<Message Text="Reference: %(Reference.Identity) alias %(Reference.Alias)"/>
</Target>
<Target Name="BuildAssembly"
Inputs="@(Compile);$(MSBuildProjectFullPath)"
Outputs="$(OutputAssemblyPath)"
DependsOnTargets="CheckErrors;CreateStrongName">
<Message Text="Compiling IL assembly - $(AssemblyName)$(AssemblyExt)"/>
<MakeDir Directories="$(OutputPath)"/>
<Exec Command="$(ILASM) $(CompilerFlags) @(Compile,' ')"/>
</Target>
<Target Name="Build"
Outputs="$(OutputAssemblyPath)"
DependsOnTargets="BuildAssembly">
</Target>
<Target Name="Rebuild" DependsOnTargets="BuildAssembly">
</Target>
<Target Name="ShowCommands">
<Message Text="$(ILASM) $(CompilerFlags) @(Compile,' ')"/>
</Target>
<Target Name="GetContentItems" Outputs="@(Content)" />
</Project>