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

frameworkPackage.targets « pkg - github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c2df42f6153b589a47768e674994c469ba9e3fbb (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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" InitialTargets="_CheckForFiles;IncludeFiles;SetValidateFramework" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <IsLineupPackage Condition="'$(PackageTargetRuntime)' == '' AND '$(IncludeLibFiles)' != 'true'">true</IsLineupPackage>
    <PreventImplementationReference Condition="'$(PackageTargetRuntime)' != ''">true</PreventImplementationReference>

    <NETStandardVersion Condition="'$(NETStandardVersion)' == ''">2.0</NETStandardVersion>
    <NETStandardPackageRefPath Condition="'$(NETStandardPackageRefPath)' == ''">$(PackagesDir)$(NETStandardPackageId.ToLower())\$(NETStandardPackageVersion)\build\netstandard$(NETStandardVersion)\ref</NETStandardPackageRefPath>

    <IncludeReferenceFiles Condition="'$(IncludeReferenceFiles)' == '' AND '$(PackageTargetRuntime)' == ''">true</IncludeReferenceFiles>
    <IncludeLibFiles Condition="'$(IncludeLibFiles)' == '' AND '$(PackageTargetRuntime)' != ''">true</IncludeLibFiles>
    <IncludeNativeFiles Condition="'$(IncludeNativeFiles)' == '' AND '$(PackageTargetRuntime)' != ''">true</IncludeNativeFiles>

    <RefFileTargetPath Condition="'$(RefFileTargetPath)' == ''">ref/$(TargetFramework)</RefFileTargetPath>
    <LibFileTargetPath Condition="'$(LibFileTargetPath)' == '' AND '$(PackageTargetRuntime)' == ''">lib/$(TargetFramework)</LibFileTargetPath>
    <LibFileTargetPath Condition="'$(LibFileTargetPath)' == '' AND '$(PackageTargetRuntime)' != ''">runtimes/$(PackageTargetRuntime)/lib/$(TargetFramework)</LibFileTargetPath>

    <NativeFileTargetPath Condition="'$(NativeFileTargetPath)' == '' AND '$(PackageTargetRuntime)' != ''">runtimes/$(PackageTargetRuntime)/native</NativeFileTargetPath>
    <NativeBinDir Condition="'$(PackageTargetRuntimeSuffix)' == 'aot'">$(NativeBinDir)_aot</NativeBinDir>
  </PropertyGroup>

  <!-- Bring in ref content from binplaced ref props -->
  <Import Condition="'$(IncludeReferenceFiles)' == 'true'" Project="$(RefBinDir)\*.props" />
  <ItemGroup Condition="'$(IncludeReferenceFiles)' == 'true'">
    <_buildRIDWithMetadata Include="@(BuildRID)">
      <TargetRuntime>%(Identity)</TargetRuntime>
      <Version>$(PackageVersion)</Version>
    </_buildRIDWithMetadata>
    <Dependency Include="@(_buildRIDWithMetadata->'runtime.%(Identity).$(Id)')" />

    <Dependency Include="Microsoft.NETCore.Platforms">
      <Version>$(PlatformPackageVersion)</Version>
      <TargetFramework>$(TargetFramework)</TargetFramework>
    </Dependency>

    <!-- Include the update to v1 lineup package, which now has no runtime package mappings.
         This will reduce the number of packages downloaded when mixing v1 and later
         packages as well as reduce our dependence on conflict resolution for dropping
         those v1 runtime packages -->
    <Dependency Condition="'$(IsLineupPackage)' == 'true'" Include="Microsoft.NETCore.Targets">
      <Version>2.0.0</Version>
      <TargetFramework>$(TargetFramework)</TargetFramework>
    </Dependency>
  </ItemGroup>

  <!-- Bring in lib content from binplaced lib props -->
  <Import Condition="'$(IncludeLibFiles)' == 'true'" Project="$(LibBinDir)\*.props" />

  <ItemGroup Condition="'$(IncludeNativeFiles)' == 'true'">
    <!-- Include native -->
    <ExcludeNative Include="$(NativeBinDir)/*.lib" />
    <NativeFile Include="$(NativeBinDir)/*.*" Exclude="@(ExcludeNative)" />
    <!-- force a missing file if native build is absent -->
    <NativeFile Include="$(NativeBinDir)/MISSING_NATIVE_BUILD" Condition="'@(NativeFile)' == ''" />
  </ItemGroup>

  <Target Name="_CheckForFiles">
    <Error Condition="'$(IncludeReferenceFiles)' == 'true' AND '@(RefFile)' == ''"
           Text="IncludeReferenceFiles was specified but no file props were found in '$(RefBinDir)'" />
    <Error Condition="'$(IncludeLibFiles)' == 'true' AND '@(LibFile)' == ''"
           Text="IncludeLibFiles was specified but no file props were found in '$(LibBinDir)'" />
    <Error Condition="'$(IncludeNativeFiles)' == 'true' AND '@(NativeFile)' == ''"
           Text="IncludeNativeFiles was specified but no files were found in '$(NativeBinDir)'" />
  </Target>

  <Target Name="IncludeFiles">
    <PropertyGroup>
      <_projectDirLength>$(ProjectDir.Length)</_projectDirLength>
    </PropertyGroup>

    <ItemGroup>
      <!-- Include refs -->
      <File Include="@(RefFile)">
        <TargetPath Condition="'%(RefFile.TargetPath)' == ''">$(RefFileTargetPath)%(RefFile.SubFolder)</TargetPath>
      </File>

      <!-- Include lib -->
      <File Include="@(LibFile)">
        <TargetPath Condition="'%(LibFile.TargetPath)' == '' ">$(LibFileTargetPath)%(LibFile.SubFolder)</TargetPath>
      </File>

      <File Include="@(NativeFile)">
        <TargetPath>$(NativeFileTargetPath)</TargetPath>
      </File>
    </ItemGroup>

    <ItemGroup Condition="'$(IncludeSymbolsInPackage)' != 'true'">
      <!-- Set targetpath for sources to be under src so that it is excluded from the lib package -->
      <File Condition="'%(File.IsSourceCodeFile)' == 'true'">
        <TargetPath>src</TargetPath>
        <TargetPath Condition="$([System.String]::Copy('%(FullPath)').StartsWith('$(ProjectDir)'))">src/$([System.String]::Copy('%(FullPath)').Substring($(_projectDirLength)).Replace('\', '/'))</TargetPath>
      </File>
    </ItemGroup>
  </Target>

  <Target Name="GetClosureFiles">
    <!-- sets up ClosureFile items that are organized by file-set -->
    <ItemGroup>
      <ClosureFile Include="@(RefFile)" Condition="Exists('%(FullPath)') AND ('%(Extension)' == '.dll' OR '%(Extension)' == '$(LibraryFileExtension)')" >
        <FileSet>reference</FileSet>
      </ClosureFile>

      <ClosureFile Include="@(LibFile);@(NativeFile)" Condition="Exists('%(FullPath)') AND ('%(Extension)' == '.dll' OR '%(Extension)' == '$(LibraryFileExtension)')">
        <FileSet>runtime</FileSet>
      </ClosureFile>
    </ItemGroup>
  </Target>

  <Target Name="VerifyClosure"
          DependsOnTargets="GetClosureFiles"
          AfterTargets="Build"
          Inputs="%(ClosureFile.FileSet)"
          Outputs="batching-on-FileSet-metadata">
    <ItemGroup>
      <_closureFileNames Include="@(ClosureFile->'%(FileName)')">
        <Original>%(Identity)</Original>
      </_closureFileNames>
      <_closureFileNamesFiltered Include="@(_closureFileNames)" Exclude="@(ExcludeFromClosure)"/>
      <_closureFileFiltered Include="@(_closureFileNamesFiltered->'%(Original)')"/>
    </ItemGroup>

    <Message Importance="High" Text="Verifying closure of $(Id) %(ClosureFile.FileSet) assemblies" />
    <VerifyClosure Sources="@(_closureFileFiltered)"
                   IgnoredReferences="@(IgnoredReference)"
                   DependencyGraphFilePath="$(PackageReportDir)$(Id)$(NuspecSuffix)-%(ClosureFile.FileSet).dgml" />

  </Target>

  <Target Name="VerifyDuplicateTypes"
          DependsOnTargets="GetClosureFiles"
          AfterTargets="Build"
          Inputs="%(ClosureFile.FileSet)"
          Outputs="batching-on-FileSet-metadata">
    <PropertyGroup>
      <_fileSet>%(ClosureFile.FileSet)</_fileSet>
    </PropertyGroup>
    <ItemGroup>
      <_dupTypeFileName Include="@(ClosureFile->'%(FileName)')">
        <Original>%(Identity)</Original>
      </_dupTypeFileName>
      <_dupTypeFileName Include="@(FrameworkClosureFile->'%(FileName)')" Exclude="@(_dupTypeFileName)" Condition="'$(_fileSet)' == '%(FrameworkClosureFile.FileSet)'">
        <Original>%(Identity)</Original>
      </_dupTypeFileName>
      <_dupTypeFileNamesFiltered Include="@(_dupTypeFileName)" Exclude="@(ExcludeFromDuplicateTypes)"/>
      <_dupTypeFileFiltered Include="@(_dupTypeFileNamesFiltered->'%(Original)')"/>
    </ItemGroup>

    <Message Importance="High" Text="Verifying no duplicate types in $(Id) %(ClosureFile.FileSet) assemblies" />
    <VerifyTypes Sources="@(_dupTypeFileFiltered)"
                 IgnoredTypes="@(IgnoredDuplicateType)" />

  </Target>

  <Target Name="VerifyNETStandard"
          DependsOnTargets="GetClosureFiles"
          AfterTargets="Build"
          Inputs="%(ClosureFile.FileSet)"
          Outputs="batching-on-FileSet-metadata">

    <PropertyGroup>
      <_fileSet>%(ClosureFile.FileSet)</_fileSet>
    </PropertyGroup>

    <ItemGroup>
      <_NETStandardFile Include="$(NETStandardPackageRefPath)\*.dll" />

      <_NETStandardMissingFile Include="@(_NETStandardFile->'%(FileName)')" Exclude="@(ClosureFile->'%(FileName)')" />
      <_NETStandardMissingFileError Include="@(_NETStandardMissingFile)" Exclude="@(SuppressNETStandardMissingFile)" />
      <_NETStandardSuppressedMissingFile Include="@(_NETStandardMissingFile)" Exclude="@(_NETStandardMissingFileError)" />
    </ItemGroup>

    <Error Condition="'@(_NETStandardFile)' == ''"
           Text="Could not locate NETStandard package content at '$(NETStandardPackageRefPath)'" />

    <Message Condition="'@(_NETStandardSuppressedMissingFile)' != ''" Text="Files'@(_NETStandardSuppressedMissingFile)' are part of '$(NETStandardPackageId)' but missing from this package's $(_fileSet) files.  This error has been suppressed." />
    <Error Condition="'@(_NETStandardMissingFileError)' != ''" Text="Files '@(_NETStandardMissingFileError)' are part of '$(NETStandardPackageId)' but missing from this package's $(_fileSet) files." />
  </Target>

  <Target Name="GetSymbolPackageFiles" BeforeTargets="GetPackageFiles">
    <ItemGroup>
      <File>
        <IsSymbolFile Condition="'%(Extension)' == '.pdb'">true</IsSymbolFile>
        <IsSymbolFile Condition="'$(SymbolFileExtension)' != '' AND'%(Extension)' == '$(SymbolFileExtension)'">true</IsSymbolFile>
      </File>
    </ItemGroup>
  </Target>

  <Target Name="SetValidateFramework">
    <ItemGroup>
      <!-- Update validation with locally authored RID list -->
      <DefaultValidateFramework Remove="$(TargetFramework)"/>
      <DefaultValidateFramework Include="$(TargetFramework)">
        <RuntimeIDs>@(BuildRID)</RuntimeIDs>
      </DefaultValidateFramework>
    </ItemGroup>
  </Target>
</Project>