summaryrefslogtreecommitdiff
path: root/src/mscorlib/Tools/BclRewriter/BclRewriter.targets
blob: e3a62e2b0ad33cad9306b3861219f9cbbd1d0f62 (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
<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>
  </PropertyGroup>
  
  <ItemGroup>
    <RewrittenAssembly Include="$(BclRewriterOutput)" />
  </ItemGroup>
  
  <Target Name="RewriteWithBclRewriter" 
          Inputs="@(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>