From a3409d1fd2a3039bed5ea4786fa31d97721d2b9d Mon Sep 17 00:00:00 2001 From: Anipik Date: Mon, 4 May 2020 16:16:49 -0700 Subject: [PATCH 1/7] use arcade target --- eng/outerBuild.targets | 6 ++--- src/libraries/Directory.Build.targets | 34 ++++++++++----------------- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/eng/outerBuild.targets b/eng/outerBuild.targets index dd546d6bd6f6b..7a1e16fa8756f 100644 --- a/eng/outerBuild.targets +++ b/eng/outerBuild.targets @@ -1,7 +1,7 @@ - - + + diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index d03b42639c2e6..bddc4bbcc1795 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -154,28 +154,18 @@ - - - <_RefSourceFileOutputPath>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', '$(AssemblyName).cs')) - <_ExcludeAPIList>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', 'ReferenceSourceExcludeApi.txt')) - <_ExcludeAttributesList>$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt - <_LicenseHeaderTxtPath>$(RepositoryEngineeringDir)LicenseHeader.txt - - - - <_GenAPICmd>$(_GenAPICommand) - <_GenAPICmd>$(_GenAPICmd) "@(IntermediateAssembly)" - <_GenAPICmd>$(_GenAPICmd) --lib-path "$(RefPath.Trim('\/'))" - <_GenAPICmd>$(_GenAPICmd) --out "$(_RefSourceFileOutputPath)" - <_GenAPICmd>$(_GenAPICmd) --exclude-attributes-list "$(_ExcludeAttributesList)" - <_GenAPICmd Condition="Exists('$(_ExcludeAPIList)')">$(_GenAPICmd) --exclude-api-list "$(_ExcludeAPIList)" - <_GenAPICmd>$(_GenAPICmd) --header-file "$(_LicenseHeaderTxtPath)" - <_GenAPICmd Condition="'$(LangVersion)' != ''">$(_GenAPICmd) --lang-version "$(LangVersion)" - - - - - + + <_RefSourceFileOutputPath>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', '$(AssemblyName).cs')) + <_ExcludeAPIList>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', 'ReferenceSourceExcludeApi.txt')) + <_ExcludeAttributesList>$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt + <_LicenseHeaderTxtPath>$(RepositoryEngineeringDir)LicenseHeader.txt + $(RefPath.Trim('\/')) + $(_RefSourceFileOutputPath) + $(GenAPIAdditionalParameters) --exclude-attributes-list "$(_ExcludeAttributesList)" + $(GenAPIAdditionalParameters) --exclude-api-list "$(_ExcludeAPIList)" + $(GenAPIAdditionalParameters) --header-file "$(_LicenseHeaderTxtPath)" + $(GenAPIAdditionalParameters) --lang-version "$(LangVersion)" + From 04b82cd4336d6b923c4aa93a5c0b35cc7eb57cf6 Mon Sep 17 00:00:00 2001 From: Anipik Date: Mon, 4 May 2020 16:18:29 -0700 Subject: [PATCH 2/7] extra space --- eng/outerBuild.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/outerBuild.targets b/eng/outerBuild.targets index 7a1e16fa8756f..2c529a56aa2f9 100644 --- a/eng/outerBuild.targets +++ b/eng/outerBuild.targets @@ -1,4 +1,4 @@ - + Date: Mon, 4 May 2020 17:01:50 -0700 Subject: [PATCH 3/7] fixes generation of reference src from runtime projects --- src/libraries/Directory.Build.targets | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index bddc4bbcc1795..b3becb54be5ec 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -165,6 +165,12 @@ $(GenAPIAdditionalParameters) --exclude-api-list "$(_ExcludeAPIList)" $(GenAPIAdditionalParameters) --header-file "$(_LicenseHeaderTxtPath)" $(GenAPIAdditionalParameters) --lang-version "$(LangVersion)" + @(ReferenceFromRuntime->Count()) + + + + $(RuntimePath.Trim('\/'));$(CoreCLRArtifactsPath.Trim('\/')) + $(GenAPIAdditionalParameters) --follow-type-forwards From 132c135f3e0155e77a2b399df95e7c05c2f235c2 Mon Sep 17 00:00:00 2001 From: Anipik Date: Tue, 5 May 2020 10:46:10 -0700 Subject: [PATCH 4/7] run target to get genapi --- docs/coding-guidelines/updating-ref-source.md | 6 +++--- eng/referenceFromRuntime.targets | 9 +++++++++ src/libraries/Directory.Build.targets | 9 +-------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/coding-guidelines/updating-ref-source.md b/docs/coding-guidelines/updating-ref-source.md index d702db01f695f..b6bcd1ed686fa 100644 --- a/docs/coding-guidelines/updating-ref-source.md +++ b/docs/coding-guidelines/updating-ref-source.md @@ -3,15 +3,15 @@ This document provides the steps you need to take to update the reference assemb ## For most assemblies within libraries 1. Implement the API in the source assembly and [build it](../workflow/building/libraries/README.md#building-individual-libraries). -2. Run the following command (from the src directory) `msbuild /t:GenerateReferenceSource` to update the reference assembly**. +2. Run the following command (from the src directory) `msbuild /t:GenerateReferenceAssemblySource` to update the reference assembly**. 3. Navigate to the ref directory and build the reference assembly. 4. Add, build, and run tests. -** **Note:** If you already added the new API to the reference source, re-generating it (after building the source assembly) will update it to be fully qualified and placed in the correct order. This can be done by running the `GenerateReferenceSource` command from the ref directory. +** **Note:** If you already added the new API to the reference source, re-generating it (after building the source assembly) will update it to be fully qualified and placed in the correct order. This can be done by running the `GenerateReferenceAssemblySource` command from the ref directory. ## For System.Runtime These steps can also be applied to some unique assemblies which depend on changes in System.Private.Corelib. (partial facades like System.Memory, for example). -1) Run `dotnet build -c Release /t:GenerateReferenceSource` from the System.Runtime/ref directory. +1) Run `dotnet build -c Release /t:GenerateReferenceAssemblySource` from the System.Runtime/ref directory. 2) Filter out all unrelated changes and extract the changes you care about (ignore certain attributes being removed). Generally, this step is not required for other reference assemblies. diff --git a/eng/referenceFromRuntime.targets b/eng/referenceFromRuntime.targets index 00d7d54abb80b..08dc709a17130 100644 --- a/eng/referenceFromRuntime.targets +++ b/eng/referenceFromRuntime.targets @@ -111,6 +111,15 @@ + + + + $(RuntimePath.Trim('\/'));$(CoreCLRArtifactsPath.Trim('\/')) + $(GenAPIAdditionalParameters) --follow-type-forwards + + - <_RefSourceFileOutputPath>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', '$(AssemblyName).cs')) <_ExcludeAPIList>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', 'ReferenceSourceExcludeApi.txt')) <_ExcludeAttributesList>$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt <_LicenseHeaderTxtPath>$(RepositoryEngineeringDir)LicenseHeader.txt $(RefPath.Trim('\/')) - $(_RefSourceFileOutputPath) + $([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', '$(AssemblyName).cs')) $(GenAPIAdditionalParameters) --exclude-attributes-list "$(_ExcludeAttributesList)" $(GenAPIAdditionalParameters) --exclude-api-list "$(_ExcludeAPIList)" $(GenAPIAdditionalParameters) --header-file "$(_LicenseHeaderTxtPath)" $(GenAPIAdditionalParameters) --lang-version "$(LangVersion)" - @(ReferenceFromRuntime->Count()) - - - - $(RuntimePath.Trim('\/'));$(CoreCLRArtifactsPath.Trim('\/')) - $(GenAPIAdditionalParameters) --follow-type-forwards From 388d8d4d256271f6610062adb585e97abfb62a0f Mon Sep 17 00:00:00 2001 From: Anipik Date: Wed, 6 May 2020 16:36:37 -0700 Subject: [PATCH 5/7] use referencePath to get references --- eng/referenceFromRuntime.targets | 9 --------- src/libraries/Directory.Build.targets | 25 ++++++++++++++----------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/eng/referenceFromRuntime.targets b/eng/referenceFromRuntime.targets index 08dc709a17130..34d0eb49199c8 100644 --- a/eng/referenceFromRuntime.targets +++ b/eng/referenceFromRuntime.targets @@ -112,15 +112,6 @@ Text="Could not resolve ReferenceFromRuntime item(s) '%(_missingReferenceFromRuntime.OriginalReferenceFromRuntime)' from '$(RuntimeProjectFile)'." /> - - - $(RuntimePath.Trim('\/'));$(CoreCLRArtifactsPath.Trim('\/')) - $(GenAPIAdditionalParameters) --follow-type-forwards - - - diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 40db94e5f46d4..73c49d0b9501a 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -154,17 +154,20 @@ - - <_ExcludeAPIList>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', 'ReferenceSourceExcludeApi.txt')) - <_ExcludeAttributesList>$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt - <_LicenseHeaderTxtPath>$(RepositoryEngineeringDir)LicenseHeader.txt - $(RefPath.Trim('\/')) - $([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', '$(AssemblyName).cs')) - $(GenAPIAdditionalParameters) --exclude-attributes-list "$(_ExcludeAttributesList)" - $(GenAPIAdditionalParameters) --exclude-api-list "$(_ExcludeAPIList)" - $(GenAPIAdditionalParameters) --header-file "$(_LicenseHeaderTxtPath)" - $(GenAPIAdditionalParameters) --lang-version "$(LangVersion)" - + + + <_ExcludeAPIList>$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', 'ReferenceSourceExcludeApi.txt')) + <_ExcludeAttributesList>$(RepositoryEngineeringDir)DefaultGenApiDocIds.txt + <_LicenseHeaderTxtPath>$(RepositoryEngineeringDir)LicenseHeader.txt + $([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '..', 'ref', '$(AssemblyName).cs')) + $(GenAPIAdditionalParameters) --exclude-attributes-list "$(_ExcludeAttributesList)" + $(GenAPIAdditionalParameters) --exclude-api-list "$(_ExcludeAPIList)" + $(GenAPIAdditionalParameters) --header-file "$(_LicenseHeaderTxtPath)" + $(GenAPIAdditionalParameters) --lang-version "$(LangVersion)" + $(GenAPIAdditionalParameters) --follow-type-forwards + + From fedeccdce83a67533e4c7f32c55db26b7f7b9c37 Mon Sep 17 00:00:00 2001 From: Anipik Date: Mon, 11 May 2020 10:58:41 -0700 Subject: [PATCH 6/7] adding GenerateReferenceSource target --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- src/libraries/Directory.Build.targets | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e19c6206fc00f..fd83c8e3f7a59 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,9 +18,9 @@ https://github.com/dotnet/arcade 8547938aefa24475a04877285553f0b2663ae249 - + https://github.com/dotnet/arcade - 8547938aefa24475a04877285553f0b2663ae249 + 8078d8f3f77b7e8b7f6e289cf82cfdfa9c7a9355 https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index 258b54f2c7570..6317305f3a4b6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 5.0.0-beta.20256.5 5.0.0-beta.20256.5 5.0.0-beta.20256.5 - 5.0.0-beta.20256.5 + 5.0.0-beta.20258.8 5.0.0-beta.20256.5 5.0.0-beta.20256.5 2.5.1-beta.20256.5 diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 73c49d0b9501a..fce8e7cbe5d12 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -169,6 +169,10 @@ + + + + From 92083bf1b200e0ba38a441187be3c130e150fe2d Mon Sep 17 00:00:00 2001 From: Anirudh Agnihotry Date: Mon, 11 May 2020 11:15:57 -0700 Subject: [PATCH 7/7] added the target name --- src/libraries/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index fce8e7cbe5d12..0efc8a53b0aca 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -170,7 +170,7 @@ - +