Skip to content
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

FrameworkReference support #4928

Merged
merged 10 commits into from
Jun 29, 2019
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 1 addition & 0 deletions docs/design-time-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Design-Time Target | Normal Target
ResolveAssemblyReferencesDesignTime | ResolveAssemblyReferences | Resolves `<Reference>` items to their paths.
ResolveProjectReferencesDesignTime | ResolveProjectReferences | Resolves `<ProjectReference>` items to their output paths.
ResolveComReferencesDesignTime | ResolveComReferences | Resolves `<COMReference>` items to their primary interop assemblies (PIA) paths.
ResolveFrameworkReferencesDesignTime | ResolveFrameworkReferences | Resolves `<FrameworkReference>` items to their paths.
ResolvePackageDependenciesDesignTime | ResolvePackageDependencies | Resolves `<PackageReference>` items to their paths.
CompileDesignTime (new project system)/Compile| Compile | Passes command-line arguments, `<Compile>` items and `<Analyzer>` items to the compiler in normal builds, or to the language service in design-time builds.

Expand Down
Binary file added resources/ManagedImages.xcf
Binary file not shown.
Binary file added resources/Overlay_Private_16x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions resources/Overlay_Private_16x.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Viewbox Width="16" Height="16" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<!-- Insert geometry here -->
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M9,16L9.005,12.016C9.005,12.016 8.78,8.031 12.594,8.031 14.126,8.031 16,8.998 16,12.007L16,16z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M11.0186,11.5625C11.0786,10.8335 11.3526,10.0215 12.5936,10.0215 13.8426,10.0215 13.9846,10.8165 13.9976,11.5625L14.9636,11.5625C14.8786,10.4435 14.8206,9.0315 12.5936,9.0315 10.1986,9.0315 10.1486,10.4375 10.0176,11.5625z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M13,14L12,14 12,13 13,13z M14,12L11,12 10,12 10,15 15,15 15,12z" />
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Viewbox>
Binary file added resources/Overlay_Warning_16x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions resources/Overlay_Warning_16x.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Viewbox Width="16" Height="16" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<!-- Insert geometry here -->
<GeometryDrawing Brush="#FFF6F6F6" Geometry="M12.511,7 16,14 15,16 H8 L7,14 10.5 7 Z" />
<GeometryDrawing Brush="#FFFFCC00" Geometry="F1M12,12L11,12 11,10 12,10z M12,14L11,14 11,13 12,13z M11.891,8.016L11.109,8.016 8.094,14.016 8.609,15 14.375,15 14.859,14z" />
<GeometryDrawing Brush="#FF000000" Geometry="F1M11,12L12,12 12,10 11,10z M11,14L12,14 12,13 11,13z" />
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Viewbox>
3 changes: 3 additions & 0 deletions resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Resources

Files in this directory are used to generate images contained within the project. These files are not included in assemblies directly.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
using Xunit;
using Xunit.Abstractions;

#nullable enable

namespace Microsoft.VisualStudio.Setup
{
public sealed class SwrTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<ID Name="SharedProjectPrivate" Value="19" />
<ID Name="SharedProjectWarning" Value="20" />
<ID Name="WarningSmall" Value="21" />
<ID Name="Framework" Value="22" />
<ID Name="FrameworkPrivate" Value="23" />
<ID Name="FrameworkWarning" Value="24" />
</Symbols>
<Images>
<Image Guid="$(ManagedImagesGuid)" ID="$(ApplicationPrivate)">
Expand Down Expand Up @@ -161,6 +164,24 @@
<Size Value="16" />
</Source>
</Image>
<Image Guid="$(ManagedImagesGuid)" ID="$(Framework)">
<Source Uri="$(Resources)/Icons/Framework_16x.xaml" />
<Source Uri="$(Resources)/Icons/Framework_16x.png">
<Size Value="16" />
</Source>
</Image>
<Image Guid="$(ManagedImagesGuid)" ID="$(FrameworkPrivate)">
<Source Uri="$(Resources)/Icons/FrameworkPrivate_16x.xaml" />
<Source Uri="$(Resources)/Icons/FrameworkPrivate_16x.png">
<Size Value="16" />
</Source>
</Image>
<Image Guid="$(ManagedImagesGuid)" ID="$(FrameworkWarning)">
<Source Uri="$(Resources)/Icons/FrameworkWarning_16x.xaml" />
<Source Uri="$(Resources)/Icons/FrameworkWarning_16x.png">
<Size Value="16" />
</Source>
</Image>
</Images>
<ImageLists />
</ImageManifest>
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Resource>
<Resource Include="Resources\Icons\FrameworkPrivate_16x.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Resource>
<Resource Include="Resources\Icons\FrameworkWarning_16x.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Resource>
<Resource Include="Resources\Icons\Framework_16x.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Resource>
<Resource Include="Resources\Icons\ApplicationPrivate_16x.png" />
<Resource Include="Resources\Icons\ApplicationWarning_16x.png" />
<Resource Include="Resources\Icons\CodeInformationPrivate_16x.png" />
Expand All @@ -194,6 +206,9 @@
<Resource Include="Resources\Icons\NuGetGreyPrivate_16x.png" />
<Resource Include="Resources\Icons\ReferenceGroupWarning_16x.png" />
<Resource Include="Resources\Icons\ReferenceGroup_16x.png" />
<Resource Include="Resources\Icons\FrameworkPrivate_16x.png" />
<Resource Include="Resources\Icons\FrameworkWarning_16x.png" />
<Resource Include="Resources\Icons\Framework_16x.png" />
</ItemGroup>
<ItemGroup>
<None Include="**\*.xlf" />
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Viewbox Width="16" Height="16" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M5.5863,2L4,3.5866 4,5 0,5 0,10 4,10 4,11.4146 5.5853,13 14.4143,13 16,11.4146 16,3.5866 14.4153,2z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M14,11L6,11 6,4 14,4z M5,4L5,7 4,7 4,6 1,6 1,9 4,9 4,8 5,8 5,11 6,12 14,12 15,11 15,4 14,3 6,3z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M11,7L13,7 13,5 11,5z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M7,9L10,9 10,6 7,6z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M11,10L13,10 13,8 11,8z" />
<GeometryDrawing Brush="#FFF0EFF1" Geometry="F1M13,7L11,7 11,5 13,5z M13,10L11,10 11,8 13,8z M10,9L7,9 7,6 10,6z M6,11L14,11 14,4 6,4z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M9,16L9,12.016C9,12.016 8.78,8.031 12.594,8.031 14.126,8.031 16,8.998 16,12.007L16,16z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M11.0186,11.5625C11.0786,10.8335 11.3526,10.0215 12.5936,10.0215 13.8426,10.0215 13.9846,10.8165 13.9976,11.5625L14.9636,11.5625C14.8786,10.4435 14.8206,9.0315 12.5936,9.0315 10.1986,9.0315 10.1486,10.4375 10.0176,11.5625z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M13,14L12,14 12,13 13,13z M14,12L11,12 10,12 10,15 15,15 15,12z" />
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Viewbox>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Viewbox Width="16" Height="16" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M5.5863,1.9996L3.9993,3.5866 3.9993,5.0006 0.000299999999999301,5.0006 0.000299999999999301,9.9996 3.9993,9.9996 3.9993,11.4146 5.5853,13.0006 14.4143,13.0006 16.0003,11.4146 16.0003,3.5866 14.4153,1.9996z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M14,11L6,11 6,4 14,4z M5,4L5,7 4,7 4,6 1,6 1,9 4,9 4,8 5,8 5,11 6,12 14,12 15,11 15,4 14,3 6,3z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M11,7L13,7 13,5 11,5z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M7,9L10,9 10,6 7,6z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M11,10L13,10 13,8 11,8z" />
<GeometryDrawing Brush="#FFF0EFF1" Geometry="F1M13,7L11,7 11,5 13,5z M13,10L11,10 11,8 13,8z M10,9L7,9 7,6 10,6z M6,11L14,11 14,4 6,4z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="M12.511,7 16,14 15,16 H8 L7,14 10.5 7 Z" />
<GeometryDrawing Brush="#FFFFCC00" Geometry="F1M12,12L11,12 11,10 12,10z M12,14L11,14 11,13 12,13z M11.891,8.016L11.109,8.016 8.094,14.016 8.609,15 14.375,15 14.859,14z" />
<GeometryDrawing Brush="#FF000000" Geometry="F1M11,12L12,12 12,10 11,10z M11,14L12,14 12,13 11,13z" />
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Viewbox>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Viewbox Width="16" Height="16" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M5.5863,1.9996L3.9993,3.5866 3.9993,5.0006 0.000299999999999301,5.0006 0.000299999999999301,9.9996 3.9993,9.9996 3.9993,11.4146 5.5853,13.0006 14.4143,13.0006 16.0003,11.4146 16.0003,3.5866 14.4153,1.9996z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M14,11L6,11 6,4 14,4z M5,4L5,7 4,7 4,6 1,6 1,9 4,9 4,8 5,8 5,11 6,12 14,12 15,11 15,4 14,3 6,3z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M11,7L13,7 13,5 11,5z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M7,9L10,9 10,6 7,6z" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M11,10L13,10 13,8 11,8z" />
<GeometryDrawing Brush="#FFF0EFF1" Geometry="F1M13,7L11,7 11,5 13,5z M13,10L11,10 11,8 13,8z M10,9L7,9 7,6 10,6z M6,11L14,11 14,4 6,4z" />
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Viewbox>
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@
<Compile Update="ProjectSystem\Rules\Items\EditorConfigFiles.cs">
<DependentUpon>EditorConfigFiles.xaml</DependentUpon>
</Compile>
<Compile Update="ProjectSystem\Rules\FrameworkReference.cs">
<DependentUpon>FrameworkReference.xaml</DependentUpon>
</Compile>
<Compile Update="ProjectSystem\Rules\ResolvedFrameworkReference.cs">
<DependentUpon>ResolvedFrameworkReference.xaml</DependentUpon>
</Compile>
<Compile Update="Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
Expand Down Expand Up @@ -369,6 +375,14 @@
<Generator>MSBuild:GenerateRuleSourceFromXaml</Generator>
<SubType>Designer</SubType>
</XamlPropertyRule>
<XamlPropertyRule Include="ProjectSystem\Rules\FrameworkReference.xaml">
<Generator>MSBuild:GenerateRuleSourceFromXaml</Generator>
<SubType>Designer</SubType>
</XamlPropertyRule>
<XamlPropertyRule Include="ProjectSystem\Rules\ResolvedFrameworkReference.xaml">
<Generator>MSBuild:GenerateRuleSourceFromXaml</Generator>
<SubType>Designer</SubType>
</XamlPropertyRule>
<XamlPropertyRuleNoCodeBehind Include="ProjectSystem\Rules\Items\AdditionalFiles.BrowseObject.xaml" />
<XamlPropertyRuleNoCodeBehind Include="ProjectSystem\Rules\Items\ApplicationDefinition.BrowseObject.xaml" />
<XamlPropertyRuleNoCodeBehind Include="ProjectSystem\Rules\Items\Compile.BrowseObject.xaml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,14 @@
</PropertyPageSchema>

<!-- Framework references -->
<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)FrameworkReference.xaml">
<Context>Project;BrowseObject</Context>
</PropertyPageSchema>

<PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ResolvedFrameworkReference.xaml">
<Context>ProjectSubscriptionService;BrowseObject</Context>
</PropertyPageSchema>

<PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)CollectedFrameworkReference.xaml">
<Context>ProjectSubscriptionService</Context>
</PropertyPageSchema>
Expand Down Expand Up @@ -375,6 +383,11 @@
<Target Name="CollectSDKReferencesDesignTime" />
<Target Name="CollectResolvedSDKReferencesDesignTime" />

<Target
Name="ResolveFrameworkReferencesDesignTime"
Returns="@(FrameworkReference)"
DependsOnTargets="ResolveFrameworkReferences" />
drewnoakes marked this conversation as resolved.
Show resolved Hide resolved

<!-- This target is used to collect the PackageReferences in the project. This target can be overriden to add\remove packagereferences before they are
sent to NuGet to be restored.-->
<Target Name="CollectPackageReferences" Returns="@(PackageReference)" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Diagnostics.CodeAnalysis;

namespace Microsoft.VisualStudio.ProjectSystem
{
[ExcludeFromCodeCoverage]
[SuppressMessage("Style", "IDE0016:Use 'throw' expression")]
internal partial class FrameworkReference
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Rule Name="FrameworkReference"
drewnoakes marked this conversation as resolved.
Show resolved Hide resolved
Description="Framework Reference Properties"
DisplayName="Framework Reference"
PageTemplate="generic"
xmlns="http://schemas.microsoft.com/build/2009/properties">

<Rule.DataSource>
<DataSource HasConfigurationCondition="False"
ItemType="FrameworkReference"
Persistence="ProjectFile"
SourceOfDefaultValue="AfterContext" />
</Rule.DataSource>

<StringProperty Name="OriginalItemSpec"
drewnoakes marked this conversation as resolved.
Show resolved Hide resolved
ReadOnly="True"
Visible="False" />

<StringProperty Name="IsImplicitlyDefined"
ReadOnly="True"
Visible="False" />

<StringProperty Name="PrivateAssets"
DisplayName="Private Assets" />

</Rule>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Diagnostics.CodeAnalysis;

namespace Microsoft.VisualStudio.ProjectSystem
{
[ExcludeFromCodeCoverage]
[SuppressMessage("Style", "IDE0016:Use 'throw' expression")]
internal partial class ResolvedFrameworkReference
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Rule Name="ResolvedFrameworkReference"
Description="Framework Reference Properties"
DisplayName="Framework Reference"
PageTemplate="generic"
xmlns="http://schemas.microsoft.com/build/2009/properties">

<Rule.DataSource>
<DataSource HasConfigurationCondition="False"
ItemType="FrameworkReference"
MSBuildTarget="ResolveFrameworkReferencesDesignTime"
Persistence="ResolvedReference"
SourceOfDefaultValue="AfterContext"
SourceType="TargetResults" />
</Rule.DataSource>

<StringProperty Name="OriginalItemSpec"
ReadOnly="True"
Visible="False" />

<StringProperty Name="TargetingPackPath"
DisplayName="Targeting Pack Path"
ReadOnly="True" />

<StringProperty Name="TargetingPackName"
DisplayName="Targeting Pack Name"
ReadOnly="True" />

<StringProperty Name="TargetingPackVersion"
DisplayName="Targeting Pack Version"
ReadOnly="True" />

<StringProperty Name="Profile"
DisplayName="Profile"
ReadOnly="True" />

<StringProperty Name="RuntimePackPath"
drewnoakes marked this conversation as resolved.
Show resolved Hide resolved
DisplayName="Runtime Pack Path"
ReadOnly="True" />

<StringProperty Name="RuntimePackName"
DisplayName="Runtime Pack Name"
ReadOnly="True" />

<StringProperty Name="RuntimePackVersion"
DisplayName="Runtime Pack Version"
ReadOnly="True" />

<StringProperty Name="IsImplicitlyDefined"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're expecting both of these properties (IsImplicitlyDefined/PrivateAssets) to be copied to the ResolvedFrameworkReference, but they aren't currently: https://github.com/dotnet/sdk/pull/3355/files#r297966595.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotnet/sdk#3355 was updated to include IsImplicitlyDefined but not PrivateAssets. It seems like your conversation with @dsplaisted was unfinished in this regard, and I'm not sure what the better path forward here is. I'll make a note on #4762 to track this.

ReadOnly="True"
Visible="False" />

<StringProperty Name="PrivateAssets"
DisplayName="Private Assets" />

</Rule>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="cs" original="../FrameworkReference.xaml">
<body>
<trans-unit id="Rule|FrameworkReference|Description">
<source>Framework Reference Properties</source>
<target state="new">Framework Reference Properties</target>
<note />
</trans-unit>
<trans-unit id="Rule|FrameworkReference|DisplayName">
<source>Framework Reference</source>
<target state="new">Framework Reference</target>
<note />
</trans-unit>
<trans-unit id="StringProperty|PrivateAssets|DisplayName">
<source>Private Assets</source>
<target state="new">Private Assets</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
Loading