forked from dotnet/android
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] <FilterAssemblies/> shouldn't throw FNFE (
dotnet#3720) A few places during a Xamarin.Android build, we have the following pattern: if (DesignTimeBuild && !File.Exists (assemblyPath)) { Log.LogDebugMessage ($"Skipping non-existent dependency '{assemblyPath}' during a design-time build."); continue; } In the case of a `<ProjectReference/>` not building, there starts to be a problem here. What happens during a regular build, is we end up throwing a `FileNotFoundException` in `<FilterAssemblies/>`. If we remove the `if (DesignTimeBuild)` check, we would instead see the behavior you would get for a .NET Console app referencing a .NET Framework library project: (ResolveProjectReferences target) -> C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1875,5): warning : The referenced project '..\MyLibrary\MyLibrary.csproj' does not exist. (CoreCompile target) -> Foo.cs(1,20,1,23): error CS0246: The type or namespace name 'Bar' could not be found (are you missing a using directive or an assembly reference?) 1 Warning(s) 1 Error(s) We get a warning about a missing `<ProjectReference/>` and any C# compiler errors that would be encountered. I think this makes more sense and developers will less likely point fingers at `<FilterAssemblies/>`? I added a test around this scenario, too.
- Loading branch information
1 parent
6d85759
commit 783ac9e
Showing
4 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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