-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[.NET 5] use $(OutputType) Exe for application vs library
In .NET 5, Xamarin.iOS is already using `<OutputType>Exe<OutputType>` to distinguish an iOS application vs an iOS class library. Xamarin.Android, however, is checking the existence of `Properties/AndroidManifest.xml`. This brings up some issues: * When using a multi-targeted project in .NET, we should be using the same convention to distinguish library vs applications on both iOS and Android. * Xamarin.iOS apps have a `static void Main` method. `OutputType=Exe` makes sense, as it tells Roslyn to expect a `Main` method. To consolidate this, I propose: * Use `$(OutputType)` of `Exe` to set `$(AndroidApplication)` to `true`. No longer look for `AndroidManifest.xml` for this default. * Immediately set `$(OutputType)` to `Library`, since we *never* want a `Main` method on Android. To make this work, I had to move these defaults from `Xamarin.Android.Sdk.props` to `Xamarin.Android.Sdk.targets`. This allows these properties to be evaluated *after* the values set in the user's project. I added a test that builds a library, checking that the `__AndroidLibraryProjects__.zip` `EmbeddedResource` has the correct contents.
- Loading branch information
1 parent
20d5b6b
commit 248e71f
Showing
8 changed files
with
50 additions
and
11 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
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