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

Adds unified settings with migration #9108

Merged
merged 8 commits into from
Jun 26, 2023
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
1 change: 1 addition & 0 deletions eng/imports/RepoLayout.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<VisualStudioSetupInsertionPath>$(VisualStudioSetupOutputPath)Insertion\</VisualStudioSetupInsertionPath>
<VisualStudioSetupIntermediateOutputPath>$(ArtifactsConfigurationDir)VSSetup.obj\</VisualStudioSetupIntermediateOutputPath>
<VisualStudioXamlRulesDir>$(VisualStudioSetupOutputPath)Rules\</VisualStudioXamlRulesDir>
<VisualStudioExtensionSetupDir>$(RepoRoot)setup\</VisualStudioExtensionSetupDir>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -657,3 +657,6 @@ folder "InstallDir:MSBuild\Microsoft\VisualStudio\Managed\zh-Hant"
file source="$(VisualStudioXamlRulesDir)zh-Hant\ResolvedProjectReference.xaml"
file source="$(VisualStudioXamlRulesDir)zh-Hant\ResolvedSdkReference.xaml"
file source="$(VisualStudioXamlRulesDir)zh-Hant\SdkReference.xaml"

folder "Extensions\Microsoft\ManagedProjectSystem\UnifiedSettings"
Copy link
Member Author

Choose a reason for hiding this comment

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

We're required to place the settings in this specific place: ExtensionRoot\UnifiedSettings*.registration.json

file source="$(VisualStudioExtensionSetupDir)\ProjectSystemSetup\UnifiedSettings\ManagedProjectSystem.registration.json"
Copy link
Member

Choose a reason for hiding this comment

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

Could we pick this up from output rather than the source project? The file has CopyToOutputDirectory so it would be copied somewhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or just don't copy it to the output directory.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a static file, so it's not necessary to pick up from output. @tmeschter removed copying to output dir.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<PropertyGroup>
<!-- This allows passing in MSBuild properties for substitution in SWR files. -->
<PackagePreprocessorDefinitions>$(PackagePreprocessorDefinitions);VisualStudioXamlRulesDir=$(VisualStudioXamlRulesDir)</PackagePreprocessorDefinitions>
<PackagePreprocessorDefinitions>$(PackagePreprocessorDefinitions);VisualStudioXamlRulesDir=$(VisualStudioXamlRulesDir);VisualStudioExtensionSetupDir=$(VisualStudioExtensionSetupDir)</PackagePreprocessorDefinitions>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions setup/ProjectSystemSetup/ProjectSystemSetup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
</PropertyGroup>

<ItemGroup>
<Content Include="UnifiedSettings\ManagedProjectSystem.registration.json">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>

<ProjectReference Include="..\..\src\Microsoft.VisualStudio.ProjectSystem.Managed.VS\Microsoft.VisualStudio.ProjectSystem.Managed.VS.csproj">
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup;GetCopyToOutputDirectoryItems;SatelliteDllsProjectOutputGroup;PkgdefProjectOutputGroup</IncludeOutputGroupsInVSIX>
</ProjectReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"properties": {
"projectsAndSolutions.sdkStyleProjects.fastUpToDateCheck.enabled": {
"type": "boolean",
"title": "@Setting_FastUpToDateCheck_Enabled_Title;{860A27C0-B665-47F3-BC12-637E16A1050A}",
Copy link
Contributor

Choose a reason for hiding this comment

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

The GUID identifies the VS package?

Copy link
Member Author

@adamint adamint Jun 22, 2023

Choose a reason for hiding this comment

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

Correct. I'd comment the json, if it were possible

"default": true,
"requiresRestart": false,
"migration": {
"pass": {
"input": {
"store": "SettingsManager",
"path": "ManagedProjectSystem\\FastUpToDateCheckEnabled"
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

"Migration" implies that the unified settings will move the current value of the setting as specified in the path and store it somewhere else going forward. Is that accurate? Any concerns about round-tripping the settings between VS installs using unified settings and those that don't? Or am I misunderstanding what this means?

Copy link
Member Author

Choose a reason for hiding this comment

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

No concerns about round-tripping, as this migration field takes care of converting legacy <-> unified settings location.
That's correct, they will be stored in a new location determined by the unified settings manager

Copy link
Member

Choose a reason for hiding this comment

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

Are settings stored in both locations then, at least for now? I wonder how conflicts are resolved.

},
"projectsAndSolutions.sdkStyleProjects.fastUpToDateCheck.loggingLevel": {
"type": "string",
"title": "@Setting_FastUpToDateCheck_LoggingLevel_Title;{860A27C0-B665-47F3-BC12-637E16A1050A}",
"default": "none",
"enum": [
"none",
"minimal",
"info",
"verbose"
],
"enumItemLabels": [
"@Setting_FastUpToDateCheck_LoggingLevel_None;{860A27C0-B665-47F3-BC12-637E16A1050A}",
"@Setting_FastUpToDateCheck_LoggingLevel_Minimal;{860A27C0-B665-47F3-BC12-637E16A1050A}",
"@Setting_FastUpToDateCheck_LoggingLevel_Info;{860A27C0-B665-47F3-BC12-637E16A1050A}",
"@Setting_FastUpToDateCheck_LoggingLevel_Verbose;{860A27C0-B665-47F3-BC12-637E16A1050A}"
],
"requiresRestart": false,
"migration": {
"enumIntegerToString": {
"input": {
"store": "SettingsManager",
"path": "ManagedProjectSystem\\FastUpToDateLogLevel"
},
"map": [
{
"result": "none",
"match": 0
},
{
"result": "minimal",
"match": 1
},
{
"result": "info",
"match": 2
},
{
"result": "verbose",
"match": 3
}
]
}
}
},
"projectsAndSolutions.sdkStyleProjects.fileNestingSettings.ignoreSolutionAndProjectSettings": {
"type": "boolean",
"title": "@Setting_FileNesting_IgnoreSolutionAndProjectSettings_Title;{860A27C0-B665-47F3-BC12-637E16A1050A}",
"default": false,
"requiresRestart": false,
"migration": {
"pass": {
"input": {
"store": "SettingsManager",
"path": "Cps.NestingIgnoreSolutionAndProjectProfiles"
}
}
}
},
"projectsAndSolutions.sdkStyleProjects.multiTargetingSettings.preferSingleTargetBuilds": {
"type": "boolean",
"title": "@Setting_FileNesting_PreferSingleTargetBuilds_Title;{860A27C0-B665-47F3-BC12-637E16A1050A}",
"description": "@Setting_FileNesting_PreferSingleTargetBuilds_Description;{860A27C0-B665-47F3-BC12-637E16A1050A}",
"default": false,
"requiresRestart": false,
"migration": {
"pass": {
"input": {
"store": "SettingsManager",
"path": "ManagedProjectSystem\\PreferSingleTargetBuilds"
}
}
}
}
},

"categories": {
"projectsAndSolutions.sdkStyleProjects": {
"title": "@Settings_Category_SdkStyleProjects;{860A27C0-B665-47F3-BC12-637E16A1050A}"
},
"projectsAndSolutions.sdkStyleProjects.fastUpToDateCheck": {
"title": "@Settings_Category_FastUpToDateCheck;{860A27C0-B665-47F3-BC12-637E16A1050A}",
"order": 1,
"additionalKeywords": [ "futd", "up-to-date", "build" ]
},
"projectsAndSolutions.sdkStyleProjects.fileNestingSettings": {
"title": "@Settings_Category_FileNestingSettings;{860A27C0-B665-47F3-BC12-637E16A1050A}",
"order": 2
},
"projectsAndSolutions.sdkStyleProjects.multiTargetingSettings": {
"title": "@Settings_Category_MultiTargetingSettings;{860A27C0-B665-47F3-BC12-637E16A1050A}",
"order": 3,
"additionalKeywords": [ "build" ]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,43 @@
<data name="27" xml:space="preserve">
<value>.NET Core 2015 Project Files (*.xproj);*.xproj</value>
</data>
<data name="Setting_FastUpToDateCheck_Enabled_Title">
<value>Don't call MSBuild if a project appears to be up to date</value>
</data>
<data name="Setting_FastUpToDateCheck_LoggingLevel_Title">
<value>Logging Level</value>
</data>
<data name="Setting_FastUpToDateCheck_LoggingLevel_None">
<value>None</value>
</data>
<data name="Setting_FastUpToDateCheck_LoggingLevel_Minimal">
<value>Minimal</value>
</data>
<data name="Setting_FastUpToDateCheck_LoggingLevel_Info">
<value>Info</value>
</data>
<data name="Setting_FastUpToDateCheck_LoggingLevel_Verbose">
<value>Verbose</value>
</data>
<data name="Setting_FileNesting_IgnoreSolutionAndProjectSettings_Title">
<value>Ignore solution and project settings</value>
</data>
<data name="Setting_FileNesting_PreferSingleTargetBuilds_Title">
<value>Prefer single-target builds when starting a project</value>
</data>
<data name="Setting_FileNesting_PreferSingleTargetBuilds_Description">
<value>When starting a project that targets multiple frameworks the build time can be reduced by building only a single one.</value>
</data>
<data name="Settings_Category_SdkStyleProjects">
<value>SDK-style projects</value>
</data>
<data name="Settings_Category_FastUpToDateCheck">
<value>Up to date checks</value>
</data>
<data name="Settings_Category_FileNestingSettings">
<value>File nesting settings</value>
</data>
<data name="Settings_Category_MultiTargetingSettings">
<value>Multi-targeting settings</value>
</data>
</root>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading