Skip to content

Add special handling for CPS project properties - #1338

Merged
mattwar merged 9 commits into
dotnet:masterfrom
mattwar:ConfiguredPropertyFix
Jan 27, 2017
Merged

mattwar merged 9 commits into
dotnet:masterfrom
mattwar:ConfiguredPropertyFix

Conversation

@mattwar

@mattwar mattwar commented Jan 25, 2017 •

Copy link
Copy Markdown
Contributor

Customer scenario

The dotnet core project property pages that should operate as configuration/platform dependent are operating as configuation/platform independent and so it is not possible to correctly edit project settings.

This change enables the associated C# and VB property pages to operate as configuration specific pages. There is an additional CPS rule added that is just a duplicate of the non-configuration specific version (CPS needs them to be separate). There is also a temporary fix to bridge the differences between how CPS defines/uses property descriptors and how the property page code expects them to work, that is only enabled for projects handled by CPS (dotnet core).

Bugs this fixes:

#413

This fix is dependent on https://mseng.visualstudio.com/VSIDEProj/_git/VSIDEProj.CPS/pullrequest/178637?_a=overview being accepted.

Workarounds, if any

No work arounds, other than having customers edit project files manually.

Risk

There is risk that the fix does not thoroughly fix the problem, but even a mostly correct solution is better that the current state.

Performance impact

Low/None

Is this a regression from a previous update?

No, this is a new feature area.

Root cause analysis:

Missing legacy feature capability in CPS.

How was the bug found?

Ad hoc usage/testing.

@mattwar

mattwar commented Jan 25, 2017

Copy link
Copy Markdown
Contributor Author

@basoundr @srivatsn please review

<DataSource Persistence="ProjectFile" HasConfigurationCondition="True" />
</Rule.DataSource>

<StringProperty Name="ApplicationIcon" DisplayName="Application Icon" Visible="True" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we make this rule only have properties that are actually configuration-specific and remove those from GeneralBrowseObject?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We'll also need to run @nguerrera's loc tool to generate the localized XAML rules as well. The tool is in https://github.com/nguerrera/xliff-converter with instruction to run in the readme. To make sure we are not doubling the number of strings, please run after you refactor the properties from the generalbrowseobject to this new rule.

</Rule.Categories>

<Rule.DataSource>
<DataSource Persistence="ProjectFile" HasConfigurationCondition="True" />

@srivatsn srivatsn Jan 25, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All the DataSources need a SourceOfDefaultValue="AfterContext" attribute. See this PR for details- https://github.com/dotnet/roslyn-project-system/pull/1267/files #Resolved

@srivatsn

Copy link
Copy Markdown
Contributor

Tagging @dotnet/project-system as well.

@mattwar mattwar self-assigned this Jan 25, 2017
@mattwar

mattwar commented Jan 26, 2017

Copy link
Copy Markdown
Contributor Author

Now we just need code reviews and @MattGertz approval. Code reviews... anyone?

@MattGertz

Copy link
Copy Markdown

Per yesterday's new sky-high bar, hand-editing the project file is now an acceptable workaround. Let's insert this into 15.1 instead.

@mattwar

mattwar commented Jan 26, 2017

Copy link
Copy Markdown
Contributor Author

@MattGertz The other half of this fix was already accepted yesterday into CPS.

@nguerrera nguerrera Jan 26, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is resetting already translated strings. If we were doing this post RTW, a hand-off/handback cycle would recycle them. If we do it now, then we need to find a workaround, which I think would be: copy GeneralBrowseObject.*.xlf to GeneralConfiguredBrowseObject.*.xlf and rerun tool.

@MattGertz

Copy link
Copy Markdown

Ah, I didn't realize that those two linked up. Thanks for the clarification. Approved to bring.

@nguerrera nguerrera left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adjusting "comment" to "requesting changes" based on the fact that we are taking this to RTW shiproom. We need to not require a loc handback to recycle strings moved from one file to another.

@mattwar

mattwar commented Jan 26, 2017

Copy link
Copy Markdown
Contributor Author

@nguerrera I've done as you've suggested, but the files still include new strings. A couple still seem to be in error, as they already have a translation but the xlf generator didn't think so. That I can probably fix by hand. However, the biggest problem is I've added a missing property to the file, and that doesn't have an existing translation.

@mattwar

mattwar commented Jan 26, 2017

Copy link
Copy Markdown
Contributor Author

@nguerrera Okay, I've removed the new property for RTM. It is not necessary for dotnet core. That means there are no new translated strings now.

@nguerrera

Copy link
Copy Markdown
Contributor

You need the --two-way on the converter to regenerate the localized xaml files from xlf.

@mattwar

mattwar commented Jan 26, 2017

Copy link
Copy Markdown
Contributor Author

Hurray!

@nguerrera nguerrera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, the new file has to be added to setup authoring too.

<DependentUpon>GeneralBrowseObject.xaml</DependentUpon>
</Compile>
<Compile Include="ProjectSystem\Rules\ConfiguredBrowseObject.cs">
<DependentUpon>GeneralConfiguredBrowseObject.xaml</DependentUpon>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How come these file names don`t line up like the others?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure they have to. Look inside the .cs files and notice even more horror.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Afaict the class inside the .cs file is named after the Rule name inside the xaml file. I chose to have the file name match the class name inside instead of matching the xaml file name. If you know otherwise, please enlighten me.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not the expert here. It just seemed all the others were 1:1:1 for class name/file name/xaml name at quick and naive glance. Is that not in fact the case already elsewhere?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@natidea

natidea commented Jan 26, 2017

Copy link
Copy Markdown
Contributor

Approved to merge via 375362

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants