Граф коммитов

10 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 4d2db6463b
[dotnet] Fix templates to use NativeHandle instead of IntPtr. Fixes #13979. (#14001)
Also make the (NativeHandle) constructor protected instead of public, to make
it clearer that it's not for public consumption.

And modify the template tests to execute the template if we can.

Fixes https://github.com/xamarin/xamarin-macios/issues/13979.
2022-02-01 17:22:53 +01:00
Chris Hamons 6ce1ff7093
[NET6] Add binding project template for iOS and MacCatalyst (#13840)
- Fixes https://github.com/xamarin/xamarin-macios/issues/13578
- Uses older-style namespace with {} instead of top level due to https://github.com/xamarin/xamarin-macios/issues/13837
2022-01-25 10:05:56 -06:00
Peter Collins c930ef845c
[dotnet/Templates] Add preview language (#12965)
Fixes: https://github.com/xamarin/xamarin-macios/issues/12955

Update the .NET 6 project templates to include "(Preview)" in the title
and include the "Mobile" classification where applicable. The phrase
".NET 6" has also been added to the description to help them stand out
from the regular Xamarin templates.
2021-10-11 08:00:01 +02:00
Rolf Bjarne Kvinge 24ea02759f
[dotnet] Support SupportedOSPlatformVersion. Fixes #12336. (#12638)
* Add support for the SupportedOSPlatformVersion MSBuild property, and write
  it to the Info.plist for the corresponding minimum OS version.
* If there are any minimum OS version in the Info.plist, we'll now show an
  error if it doesn't match SupportedOSPlatformVersion.

This unfortunately means that if there's any minimum OS version in any
Info.plist, then that will most likely have to be moved to the
SupportedOSPlatformVersion property (or removed entirely if that's the right
choice), since it's unlikely to match the default value for
SupportedOSPlatformVersion. However, this was deemed to be the best option for
the future (it's a one-time pain during migration).

Also add new tests, update existing tests, and update the templates.

Fixes https://github.com/xamarin/xamarin-macios/issues/12336.
2021-09-08 09:20:05 +02:00
Rolf Bjarne Kvinge ab88892fd1
[dotnet] Update logic for default global namespaces and fix the templates. Fixes #12457. (#12471)
* Add 'ImplicitUsings=true' to all the templates.
* Make the implicit global namespaces C#-only.
* Add the implicit global namespaces to the 'Using' itemgroup instead of the
  'Import' itemgroup.
* Make sure the global namespaces are set from AutoImport.props, so that the
  user may remove any global namespace they don't want in their project file
  (by doing something like: `<Using Remove="Foundation" />`)

Ref: https://github.com/dotnet/sdk/issues/19521
Ref: https://github.com/dotnet/sdk/issues/19793

Fixes https://github.com/xamarin/xamarin-macios/issues/12457.
2021-08-19 07:47:03 +02:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Rolf Bjarne Kvinge 6c06a9fa81
[dotnet/templates] Use file-scoped namespaces. Fixes #12085. (#12197)
Fixes https://github.com/xamarin/xamarin-macios/issues/12085.
2021-07-23 21:06:17 +02:00
Rolf Bjarne Kvinge a010778b30
[dotnet] Add support for implicit namespace imports. Fixes #12084. (#12173)
* [dotnet] Add support for implicit namespace imports. Fixes #12084.

Also update our templates to remove any using statements for implicitly imported
namespaces.

Fixes https://github.com/xamarin/xamarin-macios/issues/12084.

* [monotouch-test] Fix compilation error due to implicit namespace causing type conflict.

Fixes these errors:

    xamarin-macios/tests/monotouch-test/ImageIO/MutableImageMetadataTest.cs(54,54): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
    xamarin-macios/tests/monotouch-test/ImageIO/MutableImageMetadataTest.cs(54,88): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
    xamarin-macios/tests/monotouch-test/ImageIO/ImageMetadataTest.cs(40,54): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
    xamarin-macios/tests/monotouch-test/ImageIO/ImageMetadataTest.cs(40,88): error CS0104: 'CGImageProperties' is an ambiguous reference between 'CoreGraphics.CGImageProperties' and 'ImageIO.CGImageProperties'
2021-07-23 15:07:03 +02:00
Rolf Bjarne Kvinge d307a844ad
[dotnet] Enable nullability in template projects. (#12118)
And fix any warnings that came up.
2021-07-16 16:17:14 +02:00
Rolf Bjarne Kvinge 7ac3417ee9
[dotnet/templates/tests] Update template code. (#12109)
* Move the templates to a common subdirectory.
* Add .NET unit test to verify that all the templates build and that they have
  no warnings.
* Modify the template code to:
   * Use the UIApplication.Main overload that takes a Type.
   * Use top-level statements for the Main method to simplify code.
   * Remove a few unnecessary usings.

Partial fix for #12085.
2021-07-14 17:58:31 +02:00