summaryrefslogtreecommitdiff
path: root/src/mscorlib/Tools/BclRewriter/BclRewriter.targets
blob: 5515b000a7ddcd7b39f1865f2ce0f38c05aeaa67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">

  <!-- ********************************************************************************************* -->
  <!-- *** Task -->
  <!-- ********************************************************************************************* -->

  <PropertyGroup>
    <BclRewriterModelFile Condition="'$(BclRewriterModelFile)'==''">$(MscorlibDir)model.xml</BclRewriterModelFile>
    <BclRewriterWorkDir>$(IntermediateOutputPath)\BclRewriter</BclRewriterWorkDir>
    <BclRewriterSymbolOutput>$(IntermediateOutputPath)\BclRewriter\$(TargetName).pdb</BclRewriterSymbolOutput>
    <BclRewriterOutput>$(IntermediateOutputPath)\BclRewriter\$(TargetName)$(TargetExt)</BclRewriterOutput>
    <TargetPath>$(BclRewriterOutput)</TargetPath>
  </PropertyGroup>

  <ItemGroup>
    <RewrittenAssembly Include="$(BclRewriterOutput)" />
  </ItemGroup>

  <Target Name="RewriteWithBclRewriter"
          Inputs="$(BclRewriterModelFile);@(AnnotatedAssembly)" Outputs="@(RewrittenAssembly)" DependsOnTargets="$(BclRewriterDependencyTargets)">

    <PropertyGroup>
      <OSPlatform Condition="'$(TargetsWindows)' == 'true'">win</OSPlatform>
      <OSPlatform Condition="'$(TargetsWindows)' != 'true'">unix</OSPlatform>
      <BclRewriterCommand Condition="'$(BclRewriterCommand)'==''">"$(ToolRuntimePath)dotnetcli/$(ToolHost)" "$(ToolsDir)BclRewriter.exe"</BclRewriterCommand>
    </PropertyGroup>

    <Exec Command="$(BclRewriterCommand) -in:&quot;@(AnnotatedAssembly)&quot; -out:&quot;$(BclRewriterOutput)&quot; -include:&quot;$(BclRewriterModelFile)&quot; -platform:$(OSPlatform) -architecture:$(Platform) -flavor:$(_BuildType) -removeSerializable- -define:&quot;$(DefineConstants)&quot; -keepTempFiles+" StandardOutputImportance="Normal" />

    <!-- Update the location of the symbol file-->
    <PropertyGroup>
      <CurrentAssemblyPdb>$(BclRewriterSymbolOutput)</CurrentAssemblyPdb>
    </PropertyGroup>
  </Target>
</Project>