Skip to content

Incorporate Intellisense XML into ref-assembly nuget packages #979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jun 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Documentation/intellisense.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Intellisense XML Incorporation into Ref-Pack


Intellisense XML's are produced in the `dotnet/dotnet-api-docs` repo. They are currently **not** published to a NuGet package or another easily consumable artifact. Thus, the process of ingestion of these XML files is a manual one at this time.

1. Go to OPS build site at https://ops.microsoft.com/#/sites/Docs/docsets/dotnet-api-docs?tabName=builds and obtain the latest build artifacts
- Filter by `Build Type = Intellisense`
- Download latest package (it's a `zip` file)
2. Extract the zip contents and retain only the contents of `_intellisense\netcore-3.0` subfolder
- Copy these contents over to a new folder hierarchy that looks like this:

```
DOTNET-API-DOCS_NETCOREAPP3.0-0.0.0.1-WIN32-X86
\---_intellisense
\---netcore-3.0
```

- Create `version.txt` directly under the top-level folder, and save the commit-sha of the build obtained from the OPS site.

3. Repeat the process (using the same files) and create `dotnet-api-docs_netcoreapp3.0-0.0.0.1-win64-x64\` folder.

*FUTURE NOTE:
The version number `0.0.0.1` would change for each subsequent update to a new value, like `0.0.0.2`, etc.*


4. Compress each of the above folders like this:

```PowerShell
Compress-Archive -Path .\dotnet-api-docs_netcoreapp3.0-0.0.0.1-win32-x86\* -DestinationPath .\dotnet-api-docs_netcoreapp3.0-0.0.0.1-win32-x86.zip
Compress-Archive -path .\dotnet-api-docs_netcoreapp3.0-0.0.0.1-win64-x64\* -DestinationPath .\dotnet-api-docs_netcoreapp3.0-0.0.0.1-win64-x64.zip
```

- It's very important to use Powershell, and no other tools, to create these zip files.

5. Upload the zip files using Azure Storage Explorer to `netcorenativeassets` blob store under this path:
- `resource-packages -> external -> windows -> dotnet-api-docs_netcoreapp3.0`
6. Update the versions
- `global.json` for `native-tools.dotnet-api-docs_netcoreapp3.0`
- `ReferenceAssembly.targets` for `DotNetApiDocsNetCoreApp30` property
- Also update `global.json` in `dotnet-wpf-int` repository (if applicable).
7 changes: 7 additions & 0 deletions Microsoft.Dotnet.Wpf.sln
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PresentationFramework-Syste
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PresentationFramework-SystemXmlLinq", "src\Microsoft.DotNet.Wpf\src\Extensions\PresentationFramework-SystemXmlLinq\PresentationFramework-SystemXmlLinq.csproj", "{A78C427C-F7FE-486A-8777-1701E6E81BE0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{88264221-65BC-4E7E-8891-D26467BC250C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -611,6 +613,11 @@ Global
{7D204145-BB36-4239-AD55-24DCE26BE997} = {B0EFDB12-C931-4E7F-A6C2-D4AC111D7EDF}
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2} = {B0EFDB12-C931-4E7F-A6C2-D4AC111D7EDF}
{9163F98E-E941-45F5-9A57-47F375F50333} = {B0EFDB12-C931-4E7F-A6C2-D4AC111D7EDF}
{64366C3F-3542-4CC1-85A8-CC6B8C9B8C84} = {88264221-65BC-4E7E-8891-D26467BC250C}
{38B84251-D518-4E47-A18F-5B061619983C} = {88264221-65BC-4E7E-8891-D26467BC250C}
{2B18C965-BE75-4814-876D-8659D4A8A943} = {88264221-65BC-4E7E-8891-D26467BC250C}
{25EDAA5F-CA1E-4792-9CC3-0B4373E9C77F} = {88264221-65BC-4E7E-8891-D26467BC250C}
{A78C427C-F7FE-486A-8777-1701E6E81BE0} = {88264221-65BC-4E7E-8891-D26467BC250C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B4340004-DAC0-497D-B69D-CFA7CD93F567}
Expand Down
6 changes: 4 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
<PropertyGroup>
<MicrosoftBuildFrameworkPackageVersion>15.9.20</MicrosoftBuildFrameworkPackageVersion>
<MicrosoftBuildUtilitiesCorePackageVersion>15.9.20</MicrosoftBuildUtilitiesCorePackageVersion>
<StrawberryPerlVersion>5.28.1.1-1</StrawberryPerlVersion>
<NetFramework48RefAssembliesVersion>0.0.0.1</NetFramework48RefAssembliesVersion>
<XUnitVersion>2.4.0</XUnitVersion>
<XUnitRunnerConsoleVersion>$(XUnitVersion)</XUnitRunnerConsoleVersion>
<XUnitRunnerVisualStudioVersion>$(XUnitVersion)</XUnitRunnerVisualStudioVersion>
Expand All @@ -65,6 +63,10 @@
removed as part of https://github.com/dotnet/wpf/issues/816
-->
<MicrosoftDotNetWpfTestPackageVersion>1.0.0-beta.19263.1</MicrosoftDotNetWpfTestPackageVersion>

<!-- These versions are specified in global.json -->
<StrawberryPerlVersion>5.28.1.1-1</StrawberryPerlVersion>
<NetFramework48RefAssembliesVersion>0.0.0.1</NetFramework48RefAssembliesVersion>
</PropertyGroup>
<PropertyGroup>
<RestoreSources>
Expand Down
18 changes: 17 additions & 1 deletion eng/WpfArcadeSdk/tools/Packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ $(PreparePackageAssetsDependsOn):
<PackageAsset Include="$(OutDir)*.dll" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\$(DestinationSubFolder)"/>
<PackageAsset Include="$(OutDir)*.exe" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\$(DestinationSubFolder)"/>
<PackageAsset Include="$(OutDir)*.pdb" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\$(DestinationSubFolder)"/>

<PackageAsset Include="$(ReferenceAssemblyDir)*.dll" RelativePath="$(ArtifactsPackagingDir)\$(DestinationSubFolder)"/>
<PackageAsset Include="$(ReferenceAssemblyDir)*.xml" RelativePath="$(ArtifactsPackagingDir)\$(DestinationSubFolder)"/>
</ItemGroup>
-->
<CreateItem Include="$(OutDir)*.dll"
Expand All @@ -123,17 +125,25 @@ $(PreparePackageAssetsDependsOn):
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '$(ExcludePdbs)'!='true' and '@(PackagingAssemblyContent)'==''">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>

<CreateItem Include="$(ReferenceAssemblyDir)*.dll"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\ref\$(TargetFramework)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '$(ExcludeRefAssemblies)'!='true'">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>

<!-- Intellisense XML's bundled alongwith ref-pack content -->
<CreateItem Include="$(ReferenceAssemblyDir)*.xml"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\ref\$(TargetFramework)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '$(ExcludeRefAssemblies)'!='true'">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>

<CreateItem Include="$(OutDir)%(PackagingAssemblyContent.Identity)"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(DestinationSubFolder)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'!=''">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>
</CreateItem>
<!--
$(XlfLanguages) is defined by XliffTasks.
The conversion of .resx files to .xlf files, and the building of resource assemblies (.resources.dll) and
Expand Down Expand Up @@ -303,6 +313,12 @@ $(PreparePackageAssetsDependsOn):
<PackagePath>ref</PackagePath>
</Content>

<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\ref\**\*.xml"
Condition="Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\ref\')">
<Pack>true</Pack>
<PackagePath>ref</PackagePath>
</Content>

<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\content\**\*.*"
Condition="('$(CreateArchNeutralPackage)'!='true' Or '$(IncludeAssembliesInArchNeutralPackage)'== 'true') and Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\content\')" >
<Pack>true</Pack>
Expand Down
45 changes: 43 additions & 2 deletions eng/WpfArcadeSdk/tools/ReferenceAssembly.targets
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
<Project>

<PropertyGroup>
<CoreBuildDependsOn>
<EnsureReferenceAssemblyPrerequisitesDependsOn>
$(EnsureReferenceAssemblyPrerequisitesDependsOn);
EnsureReferenceDestination;
CopyIntellisenseXmls
</EnsureReferenceAssemblyPrerequisitesDependsOn>
</PropertyGroup>

<PropertyGroup>
<CoreBuildDependsOn>
EnsureReferenceAssemblyPrerequisites;
$(CoreBuildDependsOn)
</CoreBuildDependsOn>
<ResolveReferencesDependsOn>
EnsureReferenceDestination;
EnsureReferenceAssemblyPrerequisites;
$(ResolveReferencesDependsOn)
</ResolveReferencesDependsOn>
</PropertyGroup>

<Target Name="EnsureReferenceAssemblyPrerequisites"
DependsOnTargets="$(EnsureReferenceAssemblyPrerequisitesDependsOn)" />

<Target Name="EnsureReferenceDestination" >
<!-- Create and export properties used in Reference assembly generation -->
<!-- -->
Expand Down Expand Up @@ -43,4 +56,32 @@
<TargetRefPath>@(RefAssemblies)</TargetRefPath>
</PropertyGroup>
</Target>

<Target Name="CopyIntellisenseXmls"
Condition="'$(ProduceReferenceAssembly)' == 'true'"
Outputs="@(IntermediateRefAssembly->'$(ReferenceAssemblyDir)%(FileName).xml')">
<PropertyGroup>
<!-- Also in global.json -->
<DotNetApiDocsNetCoreApp30>0.0.0.1</DotNetApiDocsNetCoreApp30>
<IntellisenseXmlDir>$(RepositoryToolsDir)native\bin\dotnet-api-docs_netcoreapp3.0\$(DotNetApiDocsNetCoreApp30)\_intellisense\netcore-3.0\</IntellisenseXmlDir>
</PropertyGroup>

<Error Condition="!Exists('$(IntellisenseXmlDir)')"
Text="Intellisense Xml sources not found: IntellisenseXmlDir=$(IntellisenseXmlDir)" />

<!--
EnsureReferenceDestination guarantees that there is exactly 1 ref assembly
-->
<PropertyGroup>
<IntellisenseXmlFile>@(IntermediateRefAssembly->'$(IntellisenseXmlDir)%(FileName).xml')</IntellisenseXmlFile>
</PropertyGroup>

<Message Condition="!Exists('$(IntellisenseXmlFile)')"
Text="$(IntellisenseXmlFile) is missing" />

<Copy SourceFiles="$(IntellisenseXmlFile)"
Condition="Exists('$(IntellisenseXmlFile)')"
DestinationFolder="$(ReferenceAssemblyDir)"
SkipUnchangedFiles="true"/>
</Target>
</Project>
1 change: 1 addition & 0 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"native-tools": {
"strawberry-perl": "5.28.1.1-1",
"net-framework-48-ref-assemblies": "0.0.0.1",
"dotnet-api-docs_netcoreapp3.0": "0.0.0.1",
"msvcurt-c1xx": "0.0.0.4"
}
}