|
76 | 76 | <Target Name="RestoreTargetFrameworkDirectory" |
77 | 77 | Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'" |
78 | 78 | BeforeTargets="ResolveAvailableReferenceAssemblies"> |
79 | | - <ItemGroup> |
| 79 | + <ItemGroup Condition="'$(NETStandardLibraryPackageVersion)' == ''"> |
| 80 | + <!-- .NET Standard 1.x --> |
| 81 | + <_NetStandardReferences Include="@(Reference)" |
| 82 | + Condition=" |
| 83 | + '%(NuGetPackageId)' == 'Microsoft.Win32.Primitives' |
| 84 | + OR '%(NuGetPackageId)' == 'XXXSystem.AppContext' |
| 85 | + OR '%(NuGetPackageId)' == 'System.Collections' |
| 86 | + OR '%(NuGetPackageId)' == 'System.Collections.Concurrent' |
| 87 | + OR '%(NuGetPackageId)' == 'XXXSystem.Console' |
| 88 | + OR '%(NuGetPackageId)' == 'System.Diagnostics.Debug' |
| 89 | + OR '%(NuGetPackageId)' == 'System.Diagnostics.Tools' |
| 90 | + OR '%(NuGetPackageId)' == 'System.Diagnostics.Tracing' |
| 91 | + OR '%(NuGetPackageId)' == 'System.Globalization' |
| 92 | + OR '%(NuGetPackageId)' == 'System.Globalization.Calendars' |
| 93 | + OR '%(NuGetPackageId)' == 'System.IO' |
| 94 | + OR '%(NuGetPackageId)' == 'System.IO.Compression' |
| 95 | + OR '%(NuGetPackageId)' == 'System.IO.Compression.ZipFile' |
| 96 | + OR '%(NuGetPackageId)' == 'XXXSystem.IO.FileSystem' |
| 97 | + OR '%(NuGetPackageId)' == 'XXXSystem.IO.FileSystem.Primitives' |
| 98 | + OR '%(NuGetPackageId)' == 'System.Linq' |
| 99 | + OR '%(NuGetPackageId)' == 'System.Linq.Expressions' |
| 100 | + OR '%(NuGetPackageId)' == 'System.Net.Http' |
| 101 | + OR '%(NuGetPackageId)' == 'System.Net.Primitives' |
| 102 | + OR '%(NuGetPackageId)' == 'System.Net.Sockets' |
| 103 | + OR '%(NuGetPackageId)' == 'System.ObjectModel' |
| 104 | + OR '%(NuGetPackageId)' == 'System.Reflection' |
| 105 | + OR '%(NuGetPackageId)' == 'System.Reflection.Extensions' |
| 106 | + OR '%(NuGetPackageId)' == 'System.Reflection.Primitives' |
| 107 | + OR '%(NuGetPackageId)' == 'System.Resources.ResourceManager' |
| 108 | + OR '%(NuGetPackageId)' == 'System.Runtime' |
| 109 | + OR '%(NuGetPackageId)' == 'System.Runtime.Extensions' |
| 110 | + OR '%(NuGetPackageId)' == 'System.Runtime.Handles' |
| 111 | + OR '%(NuGetPackageId)' == 'System.Runtime.InteropServices' |
| 112 | + OR '%(NuGetPackageId)' == 'System.Runtime.InteropServices.RuntimeInformation' |
| 113 | + OR '%(NuGetPackageId)' == 'System.Runtime.Numerics' |
| 114 | + OR '%(NuGetPackageId)' == 'XXXSystem.Security.Cryptography.Algorithms' |
| 115 | + OR '%(NuGetPackageId)' == 'XXXSystem.Security.Cryptography.Encoding' |
| 116 | + OR '%(NuGetPackageId)' == 'XXXSystem.Security.Cryptography.Primitives' |
| 117 | + OR '%(NuGetPackageId)' == 'XXXSystem.Security.Cryptography.X509Certificates' |
| 118 | + OR '%(NuGetPackageId)' == 'System.Text.Encoding' |
| 119 | + OR '%(NuGetPackageId)' == 'System.Text.Encoding.Extensions' |
| 120 | + OR '%(NuGetPackageId)' == 'System.Text.RegularExpressions' |
| 121 | + OR '%(NuGetPackageId)' == 'System.Threading' |
| 122 | + OR '%(NuGetPackageId)' == 'System.Threading.Tasks' |
| 123 | + OR '%(NuGetPackageId)' == 'System.Threading.Timer' |
| 124 | + OR '%(NuGetPackageId)' == 'System.Xml.ReaderWriter' |
| 125 | + OR '%(NuGetPackageId)' == 'System.Xml.XDocument'" /> |
| 126 | + <_NetStandardNuGetPackageFoldersNoSlash Include="$([System.IO.Path]::GetDirectoryName('%(_NetStandardReferences.Identity)'))" /> |
| 127 | + <_NetStandardNuGetPackageFolders Include="$([MSBuild]::NormalizeDirectory('%(_NetStandardNuGetPackageFoldersNoSlash.Identity)'))" /> |
| 128 | + </ItemGroup> |
| 129 | + |
| 130 | + <ItemGroup Condition="'$(NETStandardLibraryPackageVersion)' != ''"> |
| 131 | + <!-- .NET Standard 2+ --> |
80 | 132 | <_NuGetPackageFoldersItems Include="$(NuGetPackageFolders)" /> |
81 | 133 | <_NetStandardNuGetPackageFolders Include="$([MSBuild]::NormalizeDirectory('%(_NuGetPackageFoldersItems.Identity)', 'netstandard.library', '$(NETStandardLibraryPackageVersion)', 'build', 'netstandard2.0', 'ref'))" /> |
82 | 134 | </ItemGroup> |
|
106 | 158 | <!-- Automatically annotate .NET Standard assemblies --> |
107 | 159 | <Target Name="AddStandardAssembliesForAnnotation" |
108 | 160 | BeforeTargets="ResolveOutputReferenceAssemblies"> |
109 | | - <ItemGroup> |
110 | | - <UnannotatedReferenceAssembly Include="@(Reference->'%(FileName)')" |
111 | | - Condition="'%(Reference.NuGetPackageId)' == 'NETStandard.Library' AND Exists('$(AnnotatedReferenceAssemblyDirectory)%(Reference.FileName)%(Reference.Extension)')" |
112 | | - OriginalReference="%(Reference.Identity)" |
113 | | - IsNetStandard="True" /> |
114 | | - </ItemGroup> |
| 161 | + <ItemGroup Condition="'$(NETStandardLibraryPackageVersion)' == ''"> |
| 162 | + <!-- .NET Standard 1.x --> |
| 163 | + <UnannotatedReferenceAssembly Include="@(Reference->'%(FileName)')" |
| 164 | + Condition="Exists('$(AnnotatedReferenceAssemblyDirectory)%(Reference.FileName)%(Reference.Extension)') |
| 165 | + AND ('%(Reference.NuGetPackageId)' == 'Microsoft.Win32.Primitives' |
| 166 | + OR '%(Reference.NuGetPackageId)' == 'XXXSystem.AppContext' |
| 167 | + OR '%(Reference.NuGetPackageId)' == 'System.Collections' |
| 168 | + OR '%(Reference.NuGetPackageId)' == 'System.Collections.Concurrent' |
| 169 | + OR '%(Reference.NuGetPackageId)' == 'XXXSystem.Console' |
| 170 | + OR '%(Reference.NuGetPackageId)' == 'System.Diagnostics.Debug' |
| 171 | + OR '%(Reference.NuGetPackageId)' == 'System.Diagnostics.Tools' |
| 172 | + OR '%(Reference.NuGetPackageId)' == 'System.Diagnostics.Tracing' |
| 173 | + OR '%(Reference.NuGetPackageId)' == 'System.Globalization' |
| 174 | + OR '%(Reference.NuGetPackageId)' == 'System.Globalization.Calendars' |
| 175 | + OR '%(Reference.NuGetPackageId)' == 'System.IO' |
| 176 | + OR '%(Reference.NuGetPackageId)' == 'System.IO.Compression' |
| 177 | + OR '%(Reference.NuGetPackageId)' == 'System.IO.Compression.ZipFile' |
| 178 | + OR '%(Reference.NuGetPackageId)' == 'XXXSystem.IO.FileSystem' |
| 179 | + OR '%(Reference.NuGetPackageId)' == 'XXXSystem.IO.FileSystem.Primitives' |
| 180 | + OR '%(Reference.NuGetPackageId)' == 'System.Linq' |
| 181 | + OR '%(Reference.NuGetPackageId)' == 'System.Linq.Expressions' |
| 182 | + OR '%(Reference.NuGetPackageId)' == 'System.Net.Http' |
| 183 | + OR '%(Reference.NuGetPackageId)' == 'System.Net.Primitives' |
| 184 | + OR '%(Reference.NuGetPackageId)' == 'System.Net.Sockets' |
| 185 | + OR '%(Reference.NuGetPackageId)' == 'System.ObjectModel' |
| 186 | + OR '%(Reference.NuGetPackageId)' == 'System.Reflection' |
| 187 | + OR '%(Reference.NuGetPackageId)' == 'System.Reflection.Extensions' |
| 188 | + OR '%(Reference.NuGetPackageId)' == 'System.Reflection.Primitives' |
| 189 | + OR '%(Reference.NuGetPackageId)' == 'System.Resources.ResourceManager' |
| 190 | + OR '%(Reference.NuGetPackageId)' == 'System.Runtime' |
| 191 | + OR '%(Reference.NuGetPackageId)' == 'System.Runtime.Extensions' |
| 192 | + OR '%(Reference.NuGetPackageId)' == 'System.Runtime.Handles' |
| 193 | + OR '%(Reference.NuGetPackageId)' == 'System.Runtime.InteropServices' |
| 194 | + OR '%(Reference.NuGetPackageId)' == 'System.Runtime.InteropServices.RuntimeInformation' |
| 195 | + OR '%(Reference.NuGetPackageId)' == 'System.Runtime.Numerics' |
| 196 | + OR '%(Reference.NuGetPackageId)' == 'XXXSystem.Security.Cryptography.Algorithms' |
| 197 | + OR '%(Reference.NuGetPackageId)' == 'XXXSystem.Security.Cryptography.Encoding' |
| 198 | + OR '%(Reference.NuGetPackageId)' == 'XXXSystem.Security.Cryptography.Primitives' |
| 199 | + OR '%(Reference.NuGetPackageId)' == 'XXXSystem.Security.Cryptography.X509Certificates' |
| 200 | + OR '%(Reference.NuGetPackageId)' == 'System.Text.Encoding' |
| 201 | + OR '%(Reference.NuGetPackageId)' == 'System.Text.Encoding.Extensions' |
| 202 | + OR '%(Reference.NuGetPackageId)' == 'System.Text.RegularExpressions' |
| 203 | + OR '%(Reference.NuGetPackageId)' == 'System.Threading' |
| 204 | + OR '%(Reference.NuGetPackageId)' == 'System.Threading.Tasks' |
| 205 | + OR '%(Reference.NuGetPackageId)' == 'System.Threading.Timer' |
| 206 | + OR '%(Reference.NuGetPackageId)' == 'System.Xml.ReaderWriter' |
| 207 | + OR '%(Reference.NuGetPackageId)' == 'System.Xml.XDocument')" |
| 208 | + OriginalReference="%(Reference.Identity)" |
| 209 | + IsNetStandard="True" /> |
| 210 | + </ItemGroup> |
| 211 | + |
| 212 | + <ItemGroup Condition="'$(NETStandardLibraryPackageVersion)' != ''"> |
| 213 | + <!-- .NET Standard 2+ --> |
| 214 | + <UnannotatedReferenceAssembly Include="@(Reference->'%(FileName)')" |
| 215 | + Condition="'%(Reference.NuGetPackageId)' == 'NETStandard.Library' AND Exists('$(AnnotatedReferenceAssemblyDirectory)%(Reference.FileName)%(Reference.Extension)')" |
| 216 | + OriginalReference="%(Reference.Identity)" |
| 217 | + IsNetStandard="True" /> |
| 218 | + </ItemGroup> |
115 | 219 | </Target> |
116 | 220 |
|
117 | 221 | <Target Name="UpdateNetStandardAssemblies" |
|
121 | 225 | <Reference Remove="%(UnannotatedReferenceAssembly.OriginalReference)" |
122 | 226 | Condition="'%(UnannotatedReferenceAssembly.IsNetStandard)' == 'True' AND Exists('%(UnannotatedReferenceAssembly.OutputAssembly)')" /> |
123 | 227 | <Reference Include="@(UnannotatedReferenceAssembly->'%(OutputAssembly)')" |
124 | | - Condition="'%(UnannotatedReferenceAssembly.IsNetStandard)' == 'True' AND Exists('%(UnannotatedReferenceAssembly.OutputAssembly)')" /> |
| 228 | + Condition="'%(UnannotatedReferenceAssembly.IsNetStandard)' == 'True' AND Exists('%(UnannotatedReferenceAssembly.OutputAssembly)')" |
| 229 | + HintPath="" /> |
125 | 230 | </ItemGroup> |
126 | 231 | </Target> |
127 | 232 |
|
|
0 commit comments