-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix building of csproj samples directly #1168
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works on my machine! I followed the standard steps and Android launches in the emulator! I'll try Mac next but this is already huge!
For iOS I ran:
And got this error:
And for MacCatalyst I ran:
And got this error:
And I tried another command line to launch MacCatalyst:
And got the same error:
Is there a different command line I should use for iOS and MacCatalyst? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@Eilon I'm not sure on those exceptions. I'm seeing the same thing |
Unfortunately these are intermittent it seems on catalyst. @dalexsoto any insights yet into these? |
& $(DotNet.Path) build src/Controls/samples/Controls.Sample.Droid/Maui.Controls.Sample.Droid-net6.csproj -c $(BuildConfiguration) -bl:$(LogDirectory)/$(BuildConfiguration)-android.binlog | ||
& $(DotNet.Path) build src/Controls/samples/Controls.Sample.iOS/Maui.Controls.Sample.iOS-net6.csproj -c $(BuildConfiguration) -bl:$(LogDirectory)/$(BuildConfiguration)-iOS.binlog | ||
& $(DotNet.Path) build src/Controls/samples/Controls.Sample.MacCatalyst/Maui.Controls.Sample.MacCatalyst-net6.csproj -c $(BuildConfiguration) -bl:$(LogDirectory)/$(BuildConfiguration)-MacCatalyst.binlog | ||
& $(DotNet.Path) build src/Controls/samples/Controls.Sample.SingleProject/Maui.Controls.Sample.SingleProject.csproj -c $(BuildConfiguration) -bl:$(LogDirectory)/$(BuildConfiguration)-SingleProject.binlog | ||
& $(DotNet.Path) build Microsoft.Maui-net6.sln -c $(BuildConfiguration) -bl:$(LogDirectory)/$(BuildConfiguration).binlog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These projects are all in Microsoft.Maui-net6.sln
, so they are already getting built. We shouldn't need to build them twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason to build them is to verify that they are able to build not via the SLN file
For example right now on our main branch if you run
dotnet build any_of_these_projects.csproj
it fails.
So the purpose of adding all of these is to make sure that they stay working and that new PRs don't break them
<BuildForWinUI Condition="'$(SolutionFileName)' == 'Microsoft.Maui.WinUI.sln' AND '$(Packing)' == ''">true</BuildForWinUI> | ||
<BuildForAndroid Condition="'$(SolutionFileName)' == 'Microsoft.Maui.Droid.sln' AND '$(Packing)' == ''">true</BuildForAndroid> | ||
<BuildForNet6 Condition="'$(Packing)' == 'true' OR $(SolutionFileName.Contains('net6')) == true OR '$(BuildForWinUI)' == 'true' OR '$(BuildForAndroid)' == 'true'">true</BuildForNet6> | ||
<BuildForNet6 Condition="'$(Packing)' == 'true' OR $(MSBuildProjectFile.Contains('SingleProject')) == true OR $(MSBuildProjectFile.Contains('net6')) == true OR $(SolutionFileName.Contains('net6')) == true OR '$(BuildForWinUI)' == 'true' OR '$(BuildForAndroid)' == 'true'">true</BuildForNet6> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Condition
is starting to get out of hand, can we invert the condition here so it will be a lot shorter? Check for the legacy Xamarin .sln
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, but since it's a weird hack either way I'd rather not mess with it. I'll probably do it wrong a few times while trying to invert it :-) Ideally we can just delete this whole thing in a few weeks and all of our legacy slns?!?
Description of Change