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

27 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 36af029204
Change all null checking expressions to use 'is' and 'is not'. (#18176)
Change all null checking expressions to use 'is null' and 'is not null'
instead of '== null' and '!= null'.

This was mostly done with sed, so code can probably be improved in many
other ways with manual inspection, but that will come over time.

Also add code to the autoformat script to automatically fix these issues in the future.
2023-05-05 17:52:19 +02:00
Rolf Bjarne Kvinge dc37be300e
Remove bitcode-related code, since bitcode is dead. (#16986) 2022-12-12 15:25:37 +01:00
Rolf Bjarne Kvinge 1296e35205
[registrar] Deduplicate the code to compute the initialization method name for the generated static registrar code. (#16649)
This is a step towards having a registration map (and initialization method) for each assembly.

Ref: https://github.com/xamarin/xamarin-macios/issues/11309

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-11-10 08:56:37 +01:00
Rolf Bjarne Kvinge 2d9f9c3d1f
[autoformat] Add mtouch.csproj. (#16316)
This also required modifying mtouch.csproj, otherwise the wrong settings would
be applied.
2022-10-13 10:42:41 +02:00
VS MobileTools Engineering Service 2 abae256b40
[main] [mtouch] Automatically disable bitcode if using Xcode 14+. Fixes #15210. (#16054)
Apple has deprecated bitcode, and will apparently reject app submissions
containing bitcode starting with Xcode 14. So automatically disable bitcode if
building using Xcode 14+ (and show a warning so that app developers can remove
the 'MtouchEnableBitcode' property from their project files).

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

Backport of #15804

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-09-22 07:32:33 +02:00
Rolf Bjarne Kvinge 77b8b61639
[tools] Make sure to finish the P/Invoke generator output before running the static registrar. Fixes #15190. (#15214)
Otherwise the P/Invoke generator leaves partial results in the static
registrar class, essentially saying things like "we've processed CoreMidi, no
need to add an #include for this framework", and then we'd generate the static
registrar code and that code would lack the #include for CoreMidi.

Finishing the P/Invoke generator output will clear out any state stored in the
static registrar.

Also fix a few other issues to make the generated P/Invoke wrapper code work,
and add a test.

Fixes https://github.com/xamarin/xamarin-macios/issues/15190.
2022-06-09 07:38:45 +02:00
Rolf Bjarne Kvinge 7fd68f8121
[mtouch] Preserve the xamarin_dyn_* functions when we're handling Objective-C exceptions by unwinding managed code. Fixes #14193. (#14852)
This also required a fix to not treat symbols that don't exist for a
particular abi as required.

Fixes https://github.com/xamarin/xamarin-macios/issues/14193.
2022-05-03 10:53:45 +02:00
Rolf Bjarne Kvinge a94e575806
[tools] Unify Application.link_flags and Application.gcc_flags from mtouch and mmp into Application.CustomLinkFlags. (#13509)
* [tools] Unify Application.link_flags and Application.gcc_flags from mtouch and mmp into Application.CustomLinkFlags.

* [tests] Update mtouch tests according to mtouch changes.
2021-12-09 17:16:45 +01: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 405441f544
[mtouch] It seems watchOS simulators can automatically choose the right architecture from fat apps. (#11241)
* [mtouch] It seems watchOS simulators can automatically choose the right architecture from fat apps.

So we can build a fat simulator app, and not depend on mlaunch copying in the
specific architecture at launch time.

A partial fix for https://github.com/xamarin/maccore/issues/2411.

* Bump maccore.

New commits in xamarin/maccore:

* xamarin/maccore@d11721f55e [Xamarin.Hosting] Xcode seems to have changed some logic with regards to getting the primary instruments server. (#2416)
* xamarin/maccore@d27297a098 [Xamarin.Hosting] Don't copy single-arch executable over a fat executable. (#2417)
* xamarin/maccore@6c305d4aa7 [Xamarin.Hosting] Launching may succeed even if the launch request fails. Don't fail in that case. (#2415)
* xamarin/maccore@bccc91d6a0 Support ARM64 and ARM64e simulators (#2418)

Diff: c89fd6a694..d11721f55e
2021-04-21 08:00:02 +02:00
Rolf Bjarne Kvinge 9f710fc9e5
[tools] Stop hardcoding the product name for error messages. (#10615) 2021-02-11 20:17:44 +01:00
Sebastien Pouliot 56d073317a
[tools] Do not check the existing of a file before deleting it (#10443)
because:

> If the file to be deleted does not exist, no exception is thrown.

https://docs.microsoft.com/en-us/dotnet/api/system.io.file.delete?view=net-5.0

and yes this is different from `Directory.Delete` and PR https://github.com/xamarin/xamarin-macios/pull/10441

* Fix MT0015 test failure

The MT0015 test creates a directory where a file is expected.

That's fine except the code for handling this was a bit weird. It
worked because of a `TryDelete` on the path, which avoided the
`UnauthorizedAccessException` when `File.Delete` is used on a path.
Then later there's a `Directory.Exists` check that would throw...

The code now does the `Directory.Exists` first and only call
`File.Delete` if it returns false. The throwing of the exception
is kept since the code (and test) are already present (and this
minimize changes and chance of other surprises)
2021-01-19 08:29:11 -05:00
Sebastien Pouliot d9b0097c3b
[mtouch] Fix embedding Mono (and Xamarin) as frameworks. Fixes #10382 (#10400)
This broke with 1582bf47cc and cause the
frameworks to be nested under another `Frameworks` directory.

See https://github.com/xamarin/xamarin-macios/issues/10382
2021-01-13 08:22:55 -05:00
Rolf Bjarne Kvinge 2a48373e05 [mtouch] Allow referencing Xamarin.iOS.dll when building for Mac Catalyst 2020-12-03 10:43:19 +01:00
Rolf Bjarne Kvinge 70298395d9 [tools] Catalyst requires the GSS framework, just like iOS does. 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge ff57778c38 [mtouch] Use the correct native compiler/linker flags for catalyst apps 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge fdaf51f3a8 [mtouch] Build the partial static registrar for Mac Catalyst 2020-12-03 10:42:26 +01:00
Rolf Bjarne Kvinge 17e5519692 [mtouch] We don't AOT compile anything for catalyst apps. 2020-12-03 10:42:26 +01:00
Manuel de la Pena dcb0c93ab0 [Xcode12] Bring xcode 12 changes into main. 2020-09-23 16:05:22 -04:00
Manuel de la Pena 47d93cd830 [MTouch] Fix broken compilation of extensions due to a bad merge.
libmain in watch extensions can be null. This was inside an if statement
and got removed during the merge.
2020-09-21 17:58:01 -04:00
Manuel de la Pena eb9b690fe0 Merge xcode12 into d16-8. 2020-09-18 17:51:52 -04:00
Rolf Bjarne Kvinge 37a6569aee
[registrar] Make the registrar code non-conditional. (#9609)
Some appextension mtouch code had to be moved to shared code. This code is currently
only used for iOS/tvOS/watchOS, but it will eventually be applicable to macOS as
well.

This makes it possible to re-use the registrar code in dotnet-linker.
2020-09-10 08:31:12 +02:00
Rolf Bjarne Kvinge ebfc7e131c [mtouch/mmp] Simplify some code to add assemblies to a target. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge ccca0cd2c7
[mtouch/mmp] Move Target.Is32Build and Target.Is64Build to shared code. (#9306)
We'll need the iOS implementation for .NET, so use that everywhere.
2020-08-07 08:11:52 +02:00
Rolf Bjarne Kvinge 264fa44f6f
[mtouch/mmp] Move the Driver.PRODUCT constant to an Application.ProductName instance field. (#9280)
A few changes are required to have an Application instance at hand when we need to
get the ProductName from it.

This is necessary for .NET, since there will be a single linker library for all platforms,
which means we can't use a constant.
2020-08-06 16:10:06 +02:00
Rolf Bjarne Kvinge 76fc9dc3bf
Improve our error handling code. (#8591)
* Move much of ErrorHandler.cs into a partial class in ErrorHandler.tools.cs,
  which is referenced by mtouch and mmp (but not our runtime).
* Add ErrorHandler.runtime.cs for runtime-specific bits, including a simpler
  version of ErrorHandler.Show. In particular this gets rid of the call to
  Environment.Exit, which should never happen at runtime.
* Rename MonoTouchException and MonoMacException to ProductException, which
  allows us to remove a lot of ifdefs.
* This required moving Application.LoadSymbols and Target.LoadSymbols to
  shared mtouch/mmp code.
2020-05-14 16:45:05 +02:00
Rolf Bjarne Kvinge 570f5ad8a3
[mtouch/mmp] Rework the project files. (#8575)
* Files outside the project directory now show up with a much more logical
  name in the IDE. External files have a link target which is relative to the
  root xamarin-macios directory, and files included from the mono archive show
  up as such as well.
* Rename a few mtouch/mmp-specific files to contain 'mtouch' or 'mmp' in the
  filename, to avoid having multiple files in the projects with the same name
  (it's confusing every time you search for a filename in the IDE and get
  multiple filenames where only the directory is different).
* Add a tools.sln that contains only the mtouch and mmp projects. This makes
  it easier to work with both mtouch and mmp and the same time, while not
  making VSfM unbearably slow by loading many projects in the same solution.
2020-05-12 16:37:43 +02:00