-
Notifications
You must be signed in to change notification settings - Fork 564
[build] improve Xamarin.Android.sln usability in VS Windows #3877
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
[build] improve Xamarin.Android.sln usability in VS Windows #3877
Conversation
|
Do we have an explanation for the file sharing issue on |
|
VS Windows keeps MSBuild nodes alive, and if they have previously loaded At least under .NET framework, it seems like they are just using |
| .PHONY: prepare | ||
| prepare: prepare-build | ||
| mono --debug $(PREPARE_EXE) $(_PREPARE_ARGS) | ||
| msbuild $(BOOTSTRAP_MSBUILD_FLAGS) $(BOOTSTRAP_SOLUTION) |
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.
Why do we need this change on Windows?
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 PR removes the "bootstrap" MSBuild tasks from the SLN, so we need make prepare to build them now.
I think it makes sense to build them at that step? or do you think make all should do that?
|
I think we need to do the "same" thing in Java.Interop -- not that I'm asking @jonathanpeppers to do so -- as that may help the VSMac experience. (I think it'll also be needed to land PR #3393...) |
Xamarin.Android.sln has two issues that make `Xamarin.Android.sln` not
work too well in VS Windows:
* It builds MSBuild tasks and uses them within the same solution, such
as `xa-prep-tasks.csproj` and
`Xamarin.Android.Tools.BootstrapTasks.csproj`.
* We have conditional `@(ProjectReference)`
To improve things, I completely removed the `$(XAIntegratedTests)`
MSBuild property and any `@(ProjectReference)` that were conditional.
I moved the two bootstrap `.csproj` files to a new
`Xamarin.Android.BootstrapTasks.sln` which gets built during `make
prepare` or `msbuild Xamarin.Android.sln /t:Prepare`.
VS Windows was also complaining about the
`CreateManifestResourceNames` target missing for projects that merely
import `Microsoft.Common.targets` such as `r8.csproj`. I added an
empty target in `Configuration.props` to fix all cases of this.
Unfortunately, things are still not perfect as you can hit errors such
as:
Unable to copy file "obj\Debug\Xamarin.Android.Build.Tasks.dll" to "C:\src\xamarin-android\bin\Debug\lib\xamarin.android\xbuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll".
The process cannot access the file 'C:\src\xamarin-android\bin\Debug\lib\xamarin.android\xbuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll' because it is being used by another process.
Could not copy "obj\Debug\Xamarin.Android.Build.Tasks.dll" to "C:\src\xamarin-android\bin\Debug\lib\xamarin.android\xbuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll".
Exceeded retry count of 10. Failed. The file is locked by: "Microsoft Visual Studio 2019 (26660), MSBuild.exe (18800), MSBuild.exe (17416)" Xamarin.Android.Build.Tasks
This occurs if you modify `Xamarin.Android.Build.Tasks.csproj`.
I am not yet sure if we can get around this remaining problem, but we
can revisit in the future.
e2cbb2d to
dc56205
Compare
Xamarin.Android.sln has two issues that make
Xamarin.Android.slnnotwork too well in VS Windows:
as
xa-prep-tasks.csprojandXamarin.Android.Tools.BootstrapTasks.csproj.@(ProjectReference)To improve things, I completely removed the
$(XAIntegratedTests)MSBuild property and any
@(ProjectReference)that were conditional.I moved the two bootstrap
.csprojfiles to a newXamarin.Android.BootstrapTasks.slnwhich gets built duringmake prepareormsbuild Xamarin.Android.sln /t:Prepare.VS Windows was also complaining about the
CreateManifestResourceNamestarget missing for projects that merelyimport
Microsoft.Common.targetssuch asr8.csproj. I added anempty target in
Configuration.propsto fix all cases of this.Unfortunately, things are still not perfect as you can hit errors such
as:
This occurs if you modify
Xamarin.Android.Build.Tasks.csproj.I am not yet sure if we can get around this remaining problem, but we
can revisit in the future.