-
Notifications
You must be signed in to change notification settings - Fork 555
[XM] Improve XM msbuild support and add roslyn netstandard test case #1846
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
Conversation
- Significant changes to target file under msbuild, ImplicitFacade processing in particular - Tests are disabled due to https://bugzilla.xamarin.com/show_bug.cgi?id=53164 where we can't tests local target files only global - Requires a mono msbuild with mono/msbuild@95ab657 for tests to pass - Until then, this is a workaround: sudo cp /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/Roslyn/System.Reflection.Metadata.dll /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/
|
Build success |
| --> | ||
|
|
||
| <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <!-- Unfortuntly Microsoft.NETFramework.CurrentVersion.targets defines this and is not included in Mobile/Modern builds so we'll add it here --> |
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.
Unfortuntly?
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.
Unfortunately my spelling is as bad as it looks...
| Copyright (C) 2015 Xamarin Inc. All rights reserved. | ||
| *********************************************************************************************** | ||
| --> | ||
| <!-- Rename file --> |
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.
Maybe delete this comment?
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.
Woops.
| <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
| <Import Project="Xamarin.Mac.ObjCBinding.Common.targets" /> | ||
|
|
||
| <PropertyGroup> |
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.
Will this work with F# projects too (does XM even have support for F#)?
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.
It does in theory. I did not look into getting it working with msbuild, but let me see how bad it is...
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.
So I tested it out and with msbuild fsharp works with this change, I did not dig into why.
Now, that file in particular is with binding project, but they really don't have F# support (you can bind the libs and use them in F# though).
|
Build success |
| <!-- Implicitly references all portable design-time facades if the user is referencing a System.Runtime-based portable library --> | ||
| <Target Name="ImplicitlyExpandDesignTimeFacades" DependsOnTargets="$(ImplicitlyExpandDesignTimeFacadesDependsOn)"> | ||
|
|
||
| <PropertyGroup> |
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.
Indent all the elements under the Target.
| --> | ||
|
|
||
| <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <!-- Microsoft.NETFramework.CurrentVersion.targets defines this and that target file is not pulled in to Mobile/Modern builds --> |
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.
IMHO, it would be useful to make this more prominent/visible for future readers, especially the part that the default targets file will not be pulled in for Mobile/Modern builds.
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.
Also, mention or mark the portions of this file which are from Microsoft.NETFramework.CurrentVersion.targets, and point out any changes from that. It will be useful for debugging in future or sync'ing up changes from that file.
| this file. This file also defines targets to produce an error if the specified targets | ||
| file does not exist, but the project is built anyway (command-line or IDE build). | ||
|
|
||
| Copyright (C) 2015 Xamarin Inc. All rights reserved. |
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.
Copyright needs an update?
| Condition="'$(UseXamMacFullFramework)' == 'true' And '$(IsXBuild)' == 'true' "/> | ||
|
|
||
| <Import Project="$(MSBuildThisFileDirectory)Xamarin.Mac.msbuild.targets" | ||
| Condition="'$(IsXBuild)' == 'false' "/> |
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 usual pattern is - '$(IsXBuild)' != 'true', that way the default/empty value "means" false. Just a nitpick.
|
The was marked dont-merge because it started failing tests locally for me, but it turns out after research that I reinstalled mono and "lost" the System.Reflection.Metadata.dll hack noted above. That meant it would fail first build and pass second. With the hack it works first and second time. |
|
@radical 's code review requests are in. |
|
LGTM! 👍 |
|
Build success |
|
While reviewing the diff one last time, I noticed my (commented out for now) tests were not executing the built project. While technically it isn't needed, seeing if the app actually works seems like a great idea. Landed change in PR. Will submit when it builds green. |
|
Build failure |
|
Test failure was a random one: |
sudo cp /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/Roslyn/System.Reflection.Metadata.dll /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/