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

382 Коммитов

Автор SHA1 Сообщение Дата
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
Rolf Bjarne Kvinge 3ce9ac43d8
[mtouch/mmp] Share the mono native code. (#8564)
Also move the mono native code to the Application class from the Target
class, since it's per-Application, not per-Target.
2020-05-12 12:10:50 +02:00
Rolf Bjarne Kvinge 3d2981c130
[mtouch/mmp] Share Application.MonoGCParams. (#8566) 2020-05-12 09:20:20 +02:00
Rolf Bjarne Kvinge ea25433d75
[mtouch/mmp] Share EnableProfiling. (#8563) 2020-05-11 16:42:21 +02:00
Rolf Bjarne Kvinge b18466f7f2
[mtouch/mmp] Share Abi code. (#8562) 2020-05-11 16:27:19 +02:00
Rolf Bjarne Kvinge 44653d7553
[mtouch/mmp] Share the RegistrarMode enum. (#8553) 2020-05-11 08:57:41 +02:00
Rolf Bjarne Kvinge 2926083d20
[runtime/mmp] Put libxammac and xamarin headers for Xamarin.Mac in the same directory as the corresponding files for Xamarin.iOS. (#8542)
That's in /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/SDKs/Xamarin.macOS.sdk/[lib|include]

This allows for a bit more code share between mtouch and mmp.
2020-05-08 13:04:32 +02:00
Rolf Bjarne Kvinge 0e03a929e4
Merge pull request #8541 from rolfbjarne/linker-no-constructor
[linker] Don't pass information to linker steps by selectively creating them or using constructors.

Instead use the built-in logic to determine if a linker step should light up,
and use information available in the LinkContext to determine how steps should
behave.

This is required for .NET, where linker steps can't have custom constructors.

Several steps have not been modified, because they're not all required in .NET.
2020-05-07 18:18:57 +02:00
Rolf Bjarne Kvinge 0511006ec2
[mtouch/mmp] Introduce more specific helper functions for locating libxamarin*.dylib and Xamarin*.framework. (#8538)
This allows a little bit more sharing between mmp and mtouch.
2020-05-07 16:20:07 +02:00
Rolf Bjarne Kvinge d884c2a2c7 [linker] We don't need to pass the linker options to create sub steps anymore. 2020-05-07 15:51:47 +02:00
Rolf Bjarne Kvinge 17ac227fb3 [linker] Stop passing data to the OptimizeGeneratedCode steps using a constructor. 2020-05-07 15:51:47 +02:00
Rolf Bjarne Kvinge 196ea91a72 [linker] Always create the CoreRemoveSecurity step, and instead detect if it should be active using the LinkContext field. 2020-05-07 15:51:38 +02:00
Rolf Bjarne Kvinge 1b3cb7747e [linker] Always create the [Core]RemoveAttributes steps, and instead detect if it should be active using the LinkContext field. 2020-05-07 15:51:38 +02:00
Rolf Bjarne Kvinge 0dde91584c [linker] Stop passing data to the CoreHttpMessageHandler step using a constructor. 2020-05-07 15:51:38 +02:00
Rolf Bjarne Kvinge 03c6f8d1cc
[mmp] Remove the Driver.linker_options field, and use BuildTarget.LinkerOptions instead. (#8540)
This will eventually allow for more code sharing between mtouch and mmp.
2020-05-07 15:01:26 +02:00
Rolf Bjarne Kvinge 48b7ef4696
[mtouch/mmp] Pass the path to mscorlib explicitly to the partial static registrar code instead of relying on resolving it successfully. (#8525)
This makes the code simpler when we have to add support for .NET.

This requires modifying the linker to accept a null FrameworkDirectory.
2020-05-07 08:37:17 +02:00
Rolf Bjarne Kvinge 296eabd9ac
[mmp] Always pass --nolink when generating the partial static registrar code. (#8524)
The fact that the mobile profile allows linking doesn't mean it should be done
(it doesn't actually link because we run the registrar before linking happens,
but this way the code is less confusing and there are no unnecessary
differences between full and mobile).
2020-05-06 16:43:55 +02:00
Rolf Bjarne Kvinge d574250a27
Remove XAMARIN_APPLETLS, it seems like it's always defined, which means it's not needed. (#8523)
Also remove outdated comment about Xamarin.Mac/Classic, since XM/Classic is dead.
2020-05-06 14:11:02 +02:00
Rolf Bjarne Kvinge a1c8b59e8a
[mmp] No need to pass --xamarin-full-framework when generating the partial static registrar code. (#8520)
It's already implied with the --framework argument.
2020-05-06 14:10:31 +02:00
Rolf Bjarne Kvinge 352dc6b796
[mmp] Simplify partial static registrar generation command a little bit. (#8516) 2020-05-06 09:24:47 +02:00
Rolf Bjarne Kvinge cf2b43ef5d
[mmp] Use our explicit clang execution instead of using xcrun. (#8517)
This way we use the Xcode.app we've configured in Make.config.
2020-05-06 09:15:46 +02:00
Rolf Bjarne Kvinge c81f254a28
[mtouch/mmp] Share Driver.GetFrameworks. (#8511) 2020-05-05 16:52:56 +02:00
Rolf Bjarne Kvinge acfb101a78
[mtouch/mmp] Share the Application.References field. (#8507) 2020-05-05 15:35:02 +02:00
Rolf Bjarne Kvinge fc990997b4
[mmp] Use absolute paths when generating the partial static registrar code. (#8509)
Makes it easier to c&p commands and execute them elsewhere.
2020-05-05 15:31:17 +02:00
Rolf Bjarne Kvinge 5e398e0f02
[mmp] No need to lipo a single executable file. (#8510)
Just copy it instead.
2020-05-05 15:31:06 +02:00
Rolf Bjarne Kvinge d73c21d43e
[mmp] Don't re-compute (possibly incorrectly) the system framework directories to find assemblies in. (#8454) 2020-04-27 08:34:37 +02:00
Rolf Bjarne Kvinge 28eddda439
Extract the ApplePlatform and LinkMode enums into their own files. (#8411) 2020-04-17 09:45:18 +02:00
Rolf Bjarne Kvinge 02481c1525
[mmp] Handle not being able to resolve an assembly gracefully. Fixes #8399. (#8406)
Fixes https://github.com/xamarin/xamarin-macios/issues/8399.
2020-04-16 16:24:57 +02:00
Rolf Bjarne Kvinge e4f8460277
[mmp/mtouch] Share more code. (#8394)
* Rearrange files in Xamarin.Mac a bit to ease code sharing between mmp and
  mtouch, by putting mono's static and dynamic libraries in
  /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Sdks/Xamarin.macOS.sdk
  to match how Xamarin.iOS does it.

* Don't use 'usr' as an intermediate directory. This removes another special
  case.

* Share many of the functions and properties that return specific directories,
  and document (as comments) what each function/property is supposed to
  return.
2020-04-16 14:19:45 +02:00
Sebastien Pouliot 1a8f0e6811
[mmp] Fix PostLinkScanTypeReferenceStep from running two times (#8402)
This came with the merge from xcode11.4 into master. Thankfully there
were unit tests to caught it, because Eyeballs Mark I did not.

Fix https://github.com/xamarin/xamarin-macios/issues/8400
2020-04-15 20:33:29 -04:00
Rolf Bjarne Kvinge 511124f4b1
[mmp] Explicitly resolve assemblies from the GAC / system mono. (#8377)
Cecil has a fall-back mode where it looks in the GAC / system mono for
assemblies when failing to find them elsewhere. This is not the expected
behavior when using Xamarin.Mac in the Full/XM mode, because then we should
only resolve to assemblies shipped with Xamarin.Mac.

Unfortunately doing so will break apps (our own tests break), so instead
change our resolution to be explicit about where we find assemblies, and if we
find assemblies in the GAC / system mono when we're not supposed to, then show
a warning.

Also add a fall-back mechanism, where we use the old logic instead, in case
the new logic is not 100% compatible with the old one.

This showed up when I tried to port mmp to dotnet, because then Cecil stopped
looking in the GAC / system mono for assemblies (Cecil has a special case when
running on Mono to look in Mono's GAC), and tests started failing.
2020-04-14 16:32:42 +02:00
Rolf Bjarne Kvinge 794fd9983d
[mmp] Make the system mono location customizable. Fixes #7923. (#8369)
This also makes things a bit easier with regards to the .NET 5 work.

Fixes https://github.com/xamarin/xamarin-macios/issues/7923.
2020-04-14 09:09:55 +02:00
Rolf Bjarne Kvinge 4b917ad2de
Create a general rule to create makefile fragments for project files. (#8320)
The generator project file still needs some custom logic, because we can't put
the generated makefile fragment next to the csproj (that would break the
API/generator diff).
2020-04-08 16:59:17 +02:00
Rolf Bjarne Kvinge 8e0a6d5319
[mmp] Remove unused files. (#8310) 2020-04-08 16:20:10 +02:00
Rolf Bjarne Kvinge c0abd628d3
[mtouch/mmp] Use the standard DEBUG define to determine when we're running from inside an IDE. (#8311)
We're using the Release configuration to build the mtouch and mmp binaries
that we ship, which means that we can use the Debug configuration for
debugging from an IDE, and use the standard conditional compilation symbols to
identify that case.
2020-04-08 16:20:04 +02:00
Rolf Bjarne Kvinge d3674f7efc
[mmp] Move tools/mmp/tests to tests/mmp-aot-tests. (#8317)
This is to avoid having projects within other projects' directories, which
ends up being cumbersome in .NET 5 due to default inclusion behavior.
2020-04-08 16:19:39 +02:00
Rolf Bjarne Kvinge 3d7a38e464
[mtouch/mmp] Use a single SdkVersions.cs in tools/common. (#8318)
No need to have two identical files around.
2020-04-08 16:19:34 +02:00
Rolf Bjarne Kvinge 0299a66604
[mtouch/mmp] Simplify makefile a bit. (#8319) 2020-04-08 16:19:19 +02:00
Alex Soto dddcba9dc4
Merge pull request #8207 from dalexsoto/master-xcode11.4
[xcode11.4] Merge d16-5-xcode11.4 into master
2020-03-27 10:58:32 -04:00
Rolf Bjarne Kvinge b55b8e8e0b
[mmp] Remove MonoMacPreserveCode, it's not needed anymore. (#8204)
It's preserving code for NativeImplementationBuilder, which we removed many,
many years ago.
2020-03-27 11:26:29 +01:00
Alex Soto 3ff3e07ebe Merge remote-tracking branch 'xamarin/d16-5-xcode11.4' 2020-03-26 19:59:14 -04:00
Rolf Bjarne Kvinge d0b170bf8f
[d16-5-xcode11.4][mtouch/mmp] Only use stdout from xcrun as the path of the file that was found. Fixes #8147. (#8150) (#8164)
xcrun can print stuff to stderr even if it succeeds and prints what it found
to stdout, which means we have to separate stdout and stderr when capturing
xcrun's output.

This also means that we need a few changes to our RunCommand API:

* Add support for capturing stdout and stderr separately by providing
  different callbacks/StringBuilder instances.
* Use overloads instead of default arguments, because with default arguments
  we end up with ambiguous matches in a lot of places with the new overloads.

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

Backport of #8150.
2020-03-20 19:44:58 +01:00
Rolf Bjarne Kvinge c6e9932be9
[mtouch/mmp] Only use stdout from xcrun as the path of the file that was found. Fixes #8147. (#8150)
* [mtouch/mmp] Only use stdout from xcrun as the path of the file that was found. Fixes #8147.

xcrun can print stuff to stderr even if it succeeds and prints what it found
to stdout, which means we have to separate stdout and stderr when capturing
xcrun's output.

This also means that we need a few changes to our RunCommand API:

* Add support for capturing stdout and stderr separately by providing
  different callbacks/StringBuilder instances.
* Use overloads instead of default arguments, because with default arguments
  we end up with ambiguous matches in a lot of places with the new overloads.

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

* [tests] Fix mmptest build.

* [mtouch/mmp] Fix process log output.
2020-03-20 17:46:43 +01:00
Jo Shields b23c379dd8
Bump to mono:2020-02 (#7795)
Bump mono to 2020-02 head to be in sync with Android.

Co-authored-by: Imran Hameed <imhameed@microsoft.com>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@gmail.com>
2020-03-20 10:38:47 -04:00
Rolf Bjarne Kvinge 4d7186028e
[mtouch/mmp] Improve target framework code. (#8137)
* Unify target framework code between mtouch and mmp.
* Simplify the code in mmp: have three possible valid target frameworks for
  most of code, and add special code to handle setting any other valid target
  frameworks to redirect to one of those three valid target frameworks (and
  warn if given any of those valid, but not "main", target frameworks). Any
  other code can then depend on the target framework having exactly one of
  those specific values, which means we can make IsUnified* variables
  convenience properties instead.
* Unify a bit more of the argument parsing code between mtouch and mmp, since
  that made a few other things easier.
* Add TargetFramework.IsValidFramework to have one validation implementation.
* Move the implementation of TargetFramework.MonoFrameworkDirectory to mmp
  itself, it's not really related to the target framework.
* Remove Driver.IsUnified and IsClassic from mmp, they're not used anymore.
* Formally deprecate --xamarin-[full|system]-framework in mmp, they've really been deprecated for many years.
* Remove LinkerOptions.TargetFramework, it's not used anymore.
* Get rid of mmp's userTargetFramework fried, it's duplicated with the
  targetFramework field.
* Add a few tests, and tweak others a bit.

Breaking changes:

* Both mtouch and mmp require --target-framework now. The only direct
  consumers should be the MSBuild tasks, which already pass --target-framework
  all the time. This simplifies code, and removes assumptions.
2020-03-19 09:28:09 +01:00
Rolf Bjarne Kvinge 974ce49f9b
[mmp] Define DEV in the project file's Debug configuration for mmp to work correctly when built from within the IDE. (#8142) 2020-03-19 09:27:14 +01:00
Rolf Bjarne Kvinge bacd958be0 [mtouch/mmp] Rework how we find developer tools. Partial fix for #4634 and fixes #8005. (#8121) (#8128)
Partial fix for https://github.com/xamarin/xamarin-macios/issues/4634.
Fixes https://github.com/xamarin/xamarin-macios/issues/8005.
2020-03-18 13:07:08 -04:00
Rolf Bjarne Kvinge 2985e0d455
[mmp] Fix install_name_tool invocation. (#8132)
This regressed in 13a56ffb95.
2020-03-18 12:15:20 +01:00
Rolf Bjarne Kvinge 13a56ffb95
[mtouch/mmp] Rework how we find developer tools. Partial fix for #4634 and fixes #8005. (#8121)
Partial fix for https://github.com/xamarin/xamarin-macios/issues/4634.
Fixes https://github.com/xamarin/xamarin-macios/issues/8005.
2020-03-17 15:49:39 +01:00
Alex Soto f5b3a6f1c4
Merge remote-tracking branch 'xamarin/xcode11.4' into d16-5-xcode11.4 2020-03-08 13:16:04 -04:00