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

Remove legacy TFMs #4403

Merged
merged 27 commits into from
Jan 30, 2022
Merged

Remove legacy TFMs #4403

merged 27 commits into from
Jan 30, 2022

Conversation

Redth
Copy link
Member

@Redth Redth commented Jan 29, 2022

The legacy TFM's are not helpful at this point anyway, so removing them may make things less confusing to not have multiple projects. This helps omnisharp parse things better too.

I've added an omnisharp.json file to exclude some projects/files from loading...

However, roslyn still loads a .sln file, so I've added _omnisharp.sln. It's not obvious which 'first' .sln it finds, in testing sometimes the _omnisharp.sln was found first, other times, one within Compatibility was - there's no way seemingly to control which one to load first. So, we could rename the sln to Microsoft.Maui-vscode.sln or something similar if anyone objects to the current name I used.

Once you do load a .sln (you can tell vscode which one to use and omnisharp will re-evaluate things), it will factor in the config file's excludes.

This makes vscode much faster to use on macOS in particular.

Update

Removed all net6.0 versioning from .targets/.props checks, and .csproj's (except templates because those need to have the right TFM though we can probably make that a variable too). This will help make it easier to build against net7.0 and future versions.

This consolidates also now the platform identifier checking, and uses a property msbuild function $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramewrok)') to assign the platform in a property in Directory.Build.props so that it's available to use everywhere (along with some platform properties like _MauiTargetPlatformIsAndroid).

Finally, it also removes some old msbuild logic that's now unnecessary.

Adds an omnisharp.json config file to help ignore some projects that don't load well.

But also add an _omnisharp.sln since Omnisharp basically finds the first solution it can regardless of the config file excludes and will try and load those projects.  This puts it high in the list and is generally convenient to work on the main projects from the repo within omnisharp.
This will make net7.0 easier to start building against too.
These targets actually ship so they need to not just _use_ the Maui properties from directory build props
because we don't want to set these properties for WPF projects...
There's probably a better way we should find to infer this
-->
<PropertyGroup Condition="'$(_MauiTargetPlatformIsWindows)' == 'True' AND $(TargetFramework.Contains('-windows10'))">
Copy link
Member Author

Choose a reason for hiding this comment

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

If there's an easy better way, we can update this right away before merge, but leaving the hack that seemed to work from before for now.

@Redth Redth marked this pull request as ready for review January 30, 2022 18:54
@Redth Redth requested a review from a team as a code owner January 30, 2022 18:54
@Redth Redth enabled auto-merge (squash) January 30, 2022 18:55
@Redth Redth merged commit 553b69b into main Jan 30, 2022
@Redth Redth deleted the remove-legacy-tfms branch January 30, 2022 19:09
@mattleibow mattleibow restored the remove-legacy-tfms branch January 30, 2022 19:15
@mattleibow mattleibow deleted the remove-legacy-tfms branch January 30, 2022 23:43
<PropertyGroup>
<TargetFrameworks>netstandard2.1;netstandard2.0;$(MauiPlatforms)</TargetFrameworks>
<TargetFrameworks>netstandard2.1;netstandard2.0;$(_MauiDotNetTfm);$(MauiPlatforms)</TargetFrameworks>
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason we are still building for netstandard2.1;netstandard2.0? I would assume that Maui only needs to build for net6.0 going forward.

Copy link
Member

Choose a reason for hiding this comment

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

This assembly gets loaded by MSBuild (.NET Framework in VS), so that is why we have netstandard2.0.

I'm not sure why we'd have netstandard2.1, though?

Copy link
Member

@eerhardt eerhardt Feb 2, 2022

Choose a reason for hiding this comment

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

Copy link
Member

@eerhardt eerhardt Feb 2, 2022

Choose a reason for hiding this comment

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

This assembly gets loaded by MSBuild (.NET Framework in VS)

Really? Why?

Copy link
Contributor

Choose a reason for hiding this comment

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

MSBuild task?

@jonathanpeppers
Copy link
Member

The "XamlC" MSBuild task, and maybe others, use some of the core types. It's possible this could be reworked, but this was the same in Xamarin.Forms.

@chucker
Copy link
Contributor

chucker commented Apr 14, 2022

The legacy TFM's are not helpful at this point anyway

This seems to have removed net6.0-macos support from MAUI Essentials. While MAUI itself doesn't support macos1, .NET 6.0 does (including UI support), Xamarin Essentials did work for macOS targets as well, and the UsingMauiEssentials property exists to use MAUI Essentials outside MAUI.

So, for example, Preferences can wrap NSUserDefaults across most Apple platforms; it seems like a mistake to remove support on macos for that.

Footnotes

  1. it supports maccatalyst, which is distinct.

@jonathanpeppers
Copy link
Member

jonathanpeppers commented Apr 15, 2022

@chucker there was never a maui-macos workload, how were you actually using Essentials there?

@chucker
Copy link
Contributor

chucker commented Apr 20, 2022

how were you actually using Essentials there

I wasn't, not in MAUI.

But the blog post introducing Essentials implies that this replaces Xamarin Essentials, and in a Xamarin.Mac project, those did work fine for me, so I figured this project was the replacement when migrating to net6.0-macos.

@jonathanpeppers
Copy link
Member

@chucker I'd recommend just filing a new issue titled "Essentials support for net6.0-macos", so that folks can upvote it.

@samhouts samhouts added the area-docs Conceptual docs, API docs, Samples label Jul 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-docs Conceptual docs, API docs, Samples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants