From d8f4a1bf8e4b63faaca70b698ccb1bb38dd539fd Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 25 May 2021 17:07:37 +0200 Subject: [PATCH 1/5] Generate targets files that throw for unsupported NS tfm For S.D.Common, S.Speech and S.Sec.Crypto.Pkcs we manually added a targets file to mark the .NETStandard asset as not applicable. This was done to allow defining a minimum supported .NETCoreApp version, even though a compatible .NETStandard asset is available. This commit automatically generates that targets file based on items. --- Directory.Build.props | 1 + Directory.Build.targets | 36 +++++++++++++++++++ .../src => eng}/_._ | 0 .../src/Microsoft.NETCore.Platforms.csproj | 2 +- .../pkg/System.Drawing.Common.pkgproj | 5 +-- .../System.Drawing.Common.targets | 6 ---- .../System.Security.Cryptography.Pkcs.pkgproj | 5 +-- .../System.Security.Cryptography.Pkcs.targets | 6 ---- .../System.Speech/pkg/System.Speech.pkgproj | 5 +-- .../pkg/buildTransitive/System.Speech.targets | 7 ---- 10 files changed, 41 insertions(+), 32 deletions(-) rename {src/libraries/Microsoft.NETCore.Platforms/src => eng}/_._ (100%) delete mode 100644 src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets delete mode 100644 src/libraries/System.Security.Cryptography.Pkcs/pkg/buildTransitive/System.Security.Cryptography.Pkcs.targets delete mode 100644 src/libraries/System.Speech/pkg/buildTransitive/System.Speech.targets diff --git a/Directory.Build.props b/Directory.Build.props index 4269a63738d247..8a78bdb1e5f40e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -256,6 +256,7 @@ false + $(RepositoryEngineeringDir)_._ diff --git a/Directory.Build.targets b/Directory.Build.targets index e6457e6111cfb9..a7675f42df0b55 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -54,6 +54,7 @@ $(RuntimePackageDisclaimer) $(PackageDescription) + $(BeforePack);AddNETStandardCompatErrorFileForPackaging @@ -70,4 +71,39 @@ + + + + + <_NETStandardCompatErrorFilePath>$(BaseIntermediateOutputPath)netstandardcompaterrors\%(NETStandardCompatError.Identity)\$(PackageId).targets + <_NETStandardCompatErrorFileTarget>NETStandardCompatError_$(PackageId)_%(NETStandardCompatError.Supported) + <_NETStandardCompatErrorFileContent> + + + + +]]> + + + + + + + + + + + diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/_._ b/eng/_._ similarity index 100% rename from src/libraries/Microsoft.NETCore.Platforms/src/_._ rename to eng/_._ diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj index 926335be52e986..3259946e31eb80 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +++ b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj @@ -38,7 +38,7 @@ - + diff --git a/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj b/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj index 96aaf224ad16d6..d478641dc5eedf 100644 --- a/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj +++ b/src/libraries/System.Drawing.Common/pkg/System.Drawing.Common.pkgproj @@ -6,10 +6,7 @@ - - + diff --git a/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets b/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets deleted file mode 100644 index fba8a5498c0c51..00000000000000 --- a/src/libraries/System.Drawing.Common/pkg/buildTransitive/System.Drawing.Common.targets +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/src/libraries/System.Security.Cryptography.Pkcs/pkg/System.Security.Cryptography.Pkcs.pkgproj b/src/libraries/System.Security.Cryptography.Pkcs/pkg/System.Security.Cryptography.Pkcs.pkgproj index 740607c0579164..0fd0f8c5b4f177 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/pkg/System.Security.Cryptography.Pkcs.pkgproj +++ b/src/libraries/System.Security.Cryptography.Pkcs/pkg/System.Security.Cryptography.Pkcs.pkgproj @@ -5,10 +5,7 @@ net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks) - - + diff --git a/src/libraries/System.Security.Cryptography.Pkcs/pkg/buildTransitive/System.Security.Cryptography.Pkcs.targets b/src/libraries/System.Security.Cryptography.Pkcs/pkg/buildTransitive/System.Security.Cryptography.Pkcs.targets deleted file mode 100644 index e293d8184ea105..00000000000000 --- a/src/libraries/System.Security.Cryptography.Pkcs/pkg/buildTransitive/System.Security.Cryptography.Pkcs.targets +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/src/libraries/System.Speech/pkg/System.Speech.pkgproj b/src/libraries/System.Speech/pkg/System.Speech.pkgproj index 96e4f97939079b..81e5c8bfd18449 100644 --- a/src/libraries/System.Speech/pkg/System.Speech.pkgproj +++ b/src/libraries/System.Speech/pkg/System.Speech.pkgproj @@ -8,10 +8,7 @@ true - - + diff --git a/src/libraries/System.Speech/pkg/buildTransitive/System.Speech.targets b/src/libraries/System.Speech/pkg/buildTransitive/System.Speech.targets deleted file mode 100644 index 94418a7f2df7b2..00000000000000 --- a/src/libraries/System.Speech/pkg/buildTransitive/System.Speech.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - - - From 01cf8e2b4a17fb39ecbf7bfaa0a8c337bed1e95f Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 25 May 2021 20:28:38 +0200 Subject: [PATCH 2/5] Update Directory.Build.targets --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index a7675f42df0b55..0571b0ebf7d3e4 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -93,7 +93,7 @@ From c69be0a5d8753fa6d729b63a7c0f07292c34421d Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 25 May 2021 22:12:44 +0200 Subject: [PATCH 3/5] Trim dot from tfm for targets name --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 0571b0ebf7d3e4..e2bc208bd4c514 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -80,7 +80,7 @@ BeforeTargets="GetFiles"> <_NETStandardCompatErrorFilePath>$(BaseIntermediateOutputPath)netstandardcompaterrors\%(NETStandardCompatError.Identity)\$(PackageId).targets - <_NETStandardCompatErrorFileTarget>NETStandardCompatError_$(PackageId)_%(NETStandardCompatError.Supported) + <_NETStandardCompatErrorFileTarget>NETStandardCompatError_$(PackageId)_%(NETStandardCompatError.Supported.Trim('.')) <_NETStandardCompatErrorFileContent> Date: Wed, 26 May 2021 09:15:46 +0200 Subject: [PATCH 4/5] Fix overwriting and target name --- Directory.Build.targets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index e2bc208bd4c514..3cfb909020d59f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -80,7 +80,7 @@ BeforeTargets="GetFiles"> <_NETStandardCompatErrorFilePath>$(BaseIntermediateOutputPath)netstandardcompaterrors\%(NETStandardCompatError.Identity)\$(PackageId).targets - <_NETStandardCompatErrorFileTarget>NETStandardCompatError_$(PackageId)_%(NETStandardCompatError.Supported.Trim('.')) + <_NETStandardCompatErrorFileTarget>NETStandardCompatError_$(PackageId)_$([System.String]::new('%(NETStandardCompatError.Supported)').Replace('.', '_')) <_NETStandardCompatErrorFileContent> + Overwrite="true" + WriteOnlyWhenDifferent="true" /> Date: Wed, 26 May 2021 10:24:37 +0200 Subject: [PATCH 5/5] Replace more dots in a target --- Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 3cfb909020d59f..0460647e6de5da 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -80,7 +80,7 @@ BeforeTargets="GetFiles"> <_NETStandardCompatErrorFilePath>$(BaseIntermediateOutputPath)netstandardcompaterrors\%(NETStandardCompatError.Identity)\$(PackageId).targets - <_NETStandardCompatErrorFileTarget>NETStandardCompatError_$(PackageId)_$([System.String]::new('%(NETStandardCompatError.Supported)').Replace('.', '_')) + <_NETStandardCompatErrorFileTarget>NETStandardCompatError_$(PackageId.Replace('.', '_'))_$([System.String]::new('%(NETStandardCompatError.Supported)').Replace('.', '_')) <_NETStandardCompatErrorFileContent>