[Xamarin.Android.Build.Tasks] CopyResource should fail with an error code - #2237
Merged
Conversation
dellis1972
requested changes
Sep 28, 2018
…code Context: dotnet#609 In a recent change, we removed `StubApplication.java`, but downstream in `monodroid` we had MSBuild tasks that still expected the file to exist. We got an error such as: Xamarin.Android.Common.Debugging.targets(319,2): error MSB4018: The "CopyResource" task failed unexpectedly. Xamarin.Android.Common.Debugging.targets(319,2): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object Xamarin.Android.Common.Debugging.targets(319,2): error MSB4018: at Xamarin.Android.Tasks.CopyResource.Run (System.Reflection.Assembly assm, System.String ResourceName, System.String OutputPath, Microsoft.Build.Utilities.TaskLoggingHelper Log) [0x00058] in <5782345e71104ee895a29d54bde93c43>:0 Xamarin.Android.Common.Debugging.targets(319,2): error MSB4018: at Xamarin.Android.Tasks.CopyResource.Execute () [0x00018] in <5782345e71104ee895a29d54bde93c43>:0 Xamarin.Android.Common.Debugging.targets(319,2): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in <528faf194f4946628868b84241d6ad15>:0 Xamarin.Android.Common.Debugging.targets(319,2): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x001f6] in <528faf194f4946628868b84241d6ad15>:0 The `CopyResource` MSBuild task should fail more gracefully: log a coded error, and mention the file name that was missing. In addition to this change: - Added `CopyResourceTests` to verify resources that should be working, and the error code if it fails. We should add to the list if there are other files we want to verify are working. This test is very fast (<1s for entire class), because it doesn't need to build an entire project. - Documented the `XA0116` error code.
jonathanpeppers
force-pushed
the
copyresource
branch
from
September 28, 2018 12:59
78a59cc to
8a00a83
Compare
dellis1972
approved these changes
Sep 28, 2018
Contributor
|
Test Failure if BCL and unrelated. Merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context: #609
In a recent change, we removed
StubApplication.java, but downstreamin
monodroidwe had MSBuild tasks that still expected the file toexist.
We got an error such as:
The
CopyResourceMSBuild task should fail more gracefully: log acoded error, and mention the file name that was missing.
In addition to this change:
CopyResourceTeststo verify resources that should beworking, and the error code if it fails. We should add to the list
if there are other files we want to verify are working. This test is
very fast (<1s for entire class), because it doesn't need to build
an entire project.
XA0116error code.