Welcome to mirror list, hosted at ThFree Co, Russian Federation.

shims.proj « shims « src - github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b7e085872f923b489869cb6feae4ce3efb900e91 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
  <Import Project="dir.props" />

  <PropertyGroup>
    <PackageConfigurations>
      netcoreapp2.0;
    </PackageConfigurations>
    <BuildConfigurations>
      $(BuildConfigurations);
      $(PackageConfigurations);
    </BuildConfigurations>
  </PropertyGroup>

  <Target Name="GetGenFacadesInputs">
    <ItemGroup>
      <NetFxContracts Include="@(NetFxReference->'$(NetFxRefPath)%(Identity).dll')" Condition="'$(TargetGroup)' != 'netfx'">
        <StrongNameSig Condition="'%(NetfxReference.StrongNameSig)' == ''">StrongName</StrongNameSig>
        <StrongNameSig Condition="'%(NetfxReference.StrongNameSig)' != ''">%(NetfxReference.StrongNameSig)</StrongNameSig>
      </NetFxContracts>
      <NETStandardContracts Include="$(NetStandardRefPath)netstandard.dll" />
      <GenFacadesContracts Include="@(NetFxContracts);@(NETStandardContracts)" />
      <GenFacadesSeeds Include="$(RefPath)*.dll" />
    </ItemGroup>
  </Target>

  <PropertyGroup>
    <GenFacadesResponseFile>$(IntermediateOutputPath)genfacades.rsp</GenFacadesResponseFile>
    <GenFacadesSemaphoreFile>$(IntermediateOutputPath)genfacades.sempahore</GenFacadesSemaphoreFile>
  </PropertyGroup>

  <!-- Generate Facades -->
  <Target Name="RunGenFacades"
          DependsOnTargets="GetGenFacadesInputs"
          Inputs="@(GenFacadesContracts);@(GenFacadeSeeds)"
          Outputs="$(GenFacadesSemaphoreFile)">

    <PropertyGroup>
      <!--<GenFacadesArgs>$(GenFacadesArgs) -contracts:"@(GenFacadesContracts, ',')"</GenFacadesArgs>-->
      <GenFacadesArgs>$(GenFacadesArgs) -seeds:"@(GenFacadesSeeds, ',')"</GenFacadesArgs>
      <GenFacadesArgs>$(GenFacadesArgs) -facadePath:"$(GenFacadesOutputPath)"</GenFacadesArgs>
      <GenFacadesArgs>$(GenFacadesArgs) -producePdb:false</GenFacadesArgs>
      <GenFacadesArgs>$(GenFacadesArgs) -assemblyFileVersion:$(AssemblyFileVersion)</GenFacadesArgs>
      <GenFacadesArgs>$(GenFacadesArgs) -forceZeroVersionSeeds</GenFacadesArgs>
      <!-- TODO: We should remove this flag once we have all the types for netstandard -->
      <GenFacadesArgs>$(GenFacadesArgs) -ignoreMissingTypes</GenFacadesArgs>
    </PropertyGroup>

    <MakeDir Directories="$(IntermediateOutputPath)" />
    <WriteLinesToFile File="$(GenFacadesResponseFile)" Lines="$(GenFacadesArgs)" Overwrite="true" />

    <PropertyGroup>
      <GenFacadesCmd>$(ToolHostCmd) "$(ToolsDir)GenFacades.exe"</GenFacadesCmd>
    </PropertyGroup>

    <Exec Condition="'@(NetFxContracts)' != ''"
          Command="$(GenFacadesCmd) -contracts:&quot;@(NetFxContracts)&quot; @&quot;$(GenFacadesResponseFile)&quot;"
          WorkingDirectory="$(ToolRuntimePath)" />

    <Exec Condition="'@(NETStandardContracts)' != ''"
          Command="$(GenFacadesCmd) -contracts:&quot;@(NETStandardContracts)&quot; @&quot;$(GenFacadesResponseFile)&quot;"
          WorkingDirectory="$(ToolRuntimePath)" />

    <WriteSigningRequired
        Condition="'@(NetFxContracts)' != '' and '$(SkipSigning)' != 'true' and '$(SignType)' != 'public'"
        AuthenticodeSig="Microsoft"
        StrongNameSig="%(NetFxContracts.StrongNameSig)"
        MarkerFile="$(GenFacadesOutputPath)%(NetFxContracts.Filename)%(NetFxContracts.Extension).requires_signing" />

    <WriteSigningRequired
        Condition="'@(NETStandardContracts)' != '' and '$(SkipSigning)' != 'true' and '$(SignType)' != 'public'"
        AuthenticodeSig="Microsoft"
        StrongNameSig="Open"
        MarkerFile="$(GenFacadesOutputPath)%(NETStandardContracts.Filename)%(NETStandardContracts.Extension).requires_signing" />

    <Touch Files="$(GenFacadesSemaphoreFile)" AlwaysCreate="true" />
  </Target>

  <Target Name="Build" DependsOnTargets="RunGenFacades;BinPlace" />
  <Target Name="Clean">
    <RemoveDir Directories="$(IntermediateOutputPath);$(GenFacadesOutputPath)" />
  </Target>
  <Target Name="Rebuild" DependsOnTargets="Clean;Build" />

  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />

  <Target Name="SwitchItemNameForRuntimeBinplaceConfigs" AfterTargets="GetBinPlaceConfiguration">
    <ItemGroup>
      <BinPlaceDir Condition="'%(Identity)' == '%(BinPlaceDir.RuntimePath)'">
        <ItemName>RuntimeBinplaceItem</ItemName>
      </BinPlaceDir>
      <PackageFileDir Condition="'%(Identity)' == '%(PackageFileDir.PackageFileRuntimePath)'">
        <ItemName>RuntimeBinplaceItem</ItemName>
      </PackageFileDir>
    </ItemGroup>
  </Target>

  <Target Name="GetBinPlaceItems">
    <ItemGroup>
      <BinPlaceItem Include="$(GenFacadesOutputPath)*.dll" />
      <ExcludeItemNames Include="@(GenFacadesContracts->'%(Filename)')" Condition="'%(GenFacadesContracts.ExcludeFromRuntime)' == 'true'" />
      <BinPlaceItemNames Include="@(BinPlaceItem->'%(Filename)')" Exclude="@(ExcludeItemNames)" />
      <RuntimeBinplaceItem Include="@(BinPlaceItemNames->'$(GenFacadesOutputPath)%(Identity).dll')" />
      <FileWrites Include="@(BinPlaceItem)" />
    </ItemGroup>
  </Target>

  <Target Name="GetCompatibilityShimsToPackage"
          BeforeTargets="GetFilesToPackage">
    <ItemGroup>
      <!-- All the shims defined in netfxreference.props produced by this project need to be included in the ref path. -->
      <FilesToPackage Include="@(NetFxReference->'$(GenFacadesOutputPath)%(Identity).dll')">
        <TargetFramework>netcoreapp2.0</TargetFramework>
        <TargetPath>/ref/netcoreapp2.0</TargetPath>
      </FilesToPackage>

      <!-- For the implementation path in the package we only want to include the non-manual shims produced by this project
      and the manual shims that we produce against the 2.0.0 implementation will be included to the shims package through
      a project reference, therefore we need to exclude them here.     -->
      <_manualShimProjects Include="manual\*.csproj" />
      <_manualShims Include="@(_manualShimProjects->'%(FileName)')" />
      <_libShims Include="@(NetFxReference)" Exclude="@(_manualShims)" />
    </ItemGroup>
    <PropertyGroup>
      <TargetPath>@(_libShims->'$(GenFacadesOutputPath)%(Identity).dll')</TargetPath>
    </PropertyGroup>
  </Target>
</Project>