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

8441 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot 65901a6f29
[runtime] Update launcher to use `strndup` (#8853)
because now we can :)
2020-06-15 13:46:01 -04:00
Rolf Bjarne Kvinge 748612fbc2
[dotnet] Ship libxamarin.dylib and friends. (#8830)
* [dotnet] Ship libxamarin.dylib and friends.

Add libxamarin[-debug].[a|dylib] to the NuGets.

* [dotnet] Create a DOTNET_PLATFORMS variable in Make.config.

Create a DOTNET_PLATFORMS variable in Make.config and use it everywhere
instead of the PLATFORMS variable we were defining in multiple Makefiles.

Also move the creation of the DOTNET_<platform>_RUNTIME_IDENTIFIERS variables
from dotnet/Makefile to Make.config, it'll soon be needed elsewhere as well.

* [runtime] Conditionally include bits.

* Make the contents of the DOTNET_[PLATFORMS|RUNTIME_IDENTIFIERS] variables depend on the INCLUDE_[IOS|TVOS|WATCH] variables.
2020-06-15 17:47:18 +02:00
Rolf Bjarne Kvinge 8cbf44f55c
[msbuild] Unify MtouchDebug and MmpDebug into _Debug. (#8832)
* [msbuild] Unify MtouchDebug and MmpDebug into _Debug.

* [msbuild] Use _BundlerDebug instead of _Debug.

_Debug is too generic, and more likely to clash with someone else.
2020-06-15 09:17:17 +02:00
Rolf Bjarne Kvinge 8917f2224b
[xharness] Always use nuget to restore nugets, and always use xibuild to run nuget. (#8845) 2020-06-15 09:17:02 +02:00
Rolf Bjarne Kvinge 75341a9f20
[msbuild/tests] Set MSBUILD_EXE_PATH when running unit tests from within VS. Fixes #5042. (#8846)
Also fix several tests to work when executed from within VS due to some difference

There's also a change to the MtouchTask: lookup of framework assemblies won't
succeed anymore if the path to the assembly is just an unrooted filename
(which may happen to be a file in the current directory (as a test proved
accidentally) - in which case it will never be a framework assembly).

Unfortunately this won't make all tests pass, around 20 tests will still fail with:

     #RunTarget-ErrorCount
    	The "GetReferenceNearestTargetFrameworkTask" task could not be instantiated from the assembly "/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/NuGet.Build.Tasks.dll". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. Specified cast is not valid.
    	The "GetReferenceNearestTargetFrameworkTask" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.
      Expected: 0
      But was:  2

but I couldn't figure out how to fix these errors.

Fixes https://github.com/xamarin/xamarin-macios/issues/5042.
2020-06-15 09:16:39 +02:00
Rolf Bjarne Kvinge 2722ff1eec
[tests] Don't add the build output to the assert message our mmp tests, it makes html reports hard to read. (#8847)
The build output is very verbose, which means the html reports are just
impossible to navigate due to the amount of text. The build output will be
printed to the terminal anyway, so it'll still be available.
2020-06-15 09:16:11 +02:00
Chris Hamons 32c4999822
Add NOTICE.txt and cgmanifest tool (#8843)
- Add generated NOTICE.txt with hand included OpentTK license (https://github.com/mono/opentk/blob/master/Documentation/License.txt) not found by CG
- Add small dotnet core tool that updates cgmanifest.json based on new submodules/mono
- Internal User Story: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1140262
2020-06-12 14:30:21 -05:00
Rolf Bjarne Kvinge 65237b9af7 Track our dependencies' main branches.
This also requires a maccore bump.

Diff: d2ef9d7ee0..424fa26148
2020-06-12 09:59:36 +02:00
Sebastien Pouliot a1063fc1c3
[mmp] Update generated code for `main.c` (#8842)
* Remove old imports that are not needed anymore (left over from DRM days)
* Fix formatting (missing tab)
2020-06-11 13:46:02 -04:00
Rolf Bjarne Kvinge 0a870c0a1e
[msbuild] Rename a few CodeSign* variables to Codesign* variables to make Xamarin.iOS and Xamarin.Mac code identical. (#8831)
This is just a case difference in the variable name, and MSBuild properties
are case-insensitive, so this has no functional effect.
2020-06-11 16:34:57 +02:00
Rolf Bjarne Kvinge 5cd7044040
[msbuild] Remove version comparisons that will always have the same result by now. (#8833)
* We require Xcode 6+,, so remove checks for older Xcode versions.
* We require iOS 6+, so remove checks for older iOS versions.
* We don't need to check the Xamarin.iOS version, since we're shipping
  together (code checking Xamarin.iOS version is leftover from when the
  MSBuild tasks were shipped with Xamarin Studio).

This also allowed us to remove an error (and the corresponding message).
2020-06-11 16:00:44 +02:00
Rolf Bjarne Kvinge 24117c5180
[dotnet] Rebuild nugets and global.json when we switch branches or commit something, or change any of the project files involved in package creation. (#8834) 2020-06-11 11:57:28 +02:00
Rolf Bjarne Kvinge 81b38d74a8
[ObjCRuntime] Revert unintentional API changes. (#8829) 2020-06-11 11:44:51 +02:00
Rolf Bjarne Kvinge a6b55083ab
[apidiff] Fix range expression. (#8827)
The C# range expression is somewhat confusing: the lower bound is inclusive,
but the upper bound is exclusive. This means that [0..15] is 15 characters,
not the 16 characters we want here.

Fixes this during API comparison:

    System.ArgumentException: Byte array for GUID must be exactly 16 bytes long.
    Parameter name: b
      at System.Guid..ctor (System.ReadOnlySpan`1[T] b) [0x00111] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Guid.cs:66
      at System.Guid..ctor (System.Byte[] b) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Guid.cs:45
      at Merger.Process (System.String platform, System.String path, System.String os) [0x001d1] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/apidiff/merger.cs:60
      at Merger.Main (System.String[] args) [0x00002] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/apidiff/merger.cs:94
    make[2]: *** [tvos-markdown] Error 1
2020-06-11 11:44:39 +02:00
Sebastien Pouliot 37b62cbaae
[runtime] Only include debug over HTTP for watchOS devices (#8828)
We have better options for watchOS simulator and other platforms.

This only affects `lib*-debug.dylib` and `Xamarin-debug.framework`
as the non-debug binaries don't include debugging support.
2020-06-10 16:27:15 -04:00
Rolf Bjarne Kvinge f0581a4ab0
[src] Remove the remaining Classic code. (#8819)
* [src] Update project files to remove XAMCORE_2_0 and __UNIFIED__.

* [src] Update README to remove outdated docs about XAMCORE_2_0.

* [src] Remove Classic code from System.Net.Http.

* [src] Remove Classic code from the ObjCRuntime namespace.

* [src] Remove Classic code from the native types.

* [src] Remove the Classic defines from the makefiles.

* [src] Remove Classic code from the Constants class.

* [src] Remove Classic code from the MonoNativeFunctionWrapper and MonoPInvokeCallback attributes.

* [src] NUnitLite still needs the XAMCORE_2_0 and __UNIFIED__ defines.

They still have conditional code with those defines:
a977ca5757/NUnitLite-1.0.0/src/framework/Constraints/Numerics.cs (L57)
2020-06-10 19:12:37 +02:00
Rolf Bjarne Kvinge 767169e61a
[msbuild] Move the TargetArchitecture to Xamarin.MacDev.Tasks so that it can be used everywhere. (#8821) 2020-06-10 15:40:43 +02:00
Rolf Bjarne Kvinge 9492308820
[msbuild] Remove duplicate NativeReferenceKind enum. (#8812) 2020-06-10 09:09:53 +02:00
Rolf Bjarne Kvinge 462bc41173
[msbuild] We have a top-level editor config now, so use that. (#8811) 2020-06-10 09:09:43 +02:00
Rolf Bjarne Kvinge 44c32474a3
[src] Remove Classic code from UIKit. (#8809) 2020-06-10 09:09:33 +02:00
Rolf Bjarne Kvinge a94354bb1d
SceneKit (#8808) 2020-06-10 09:08:57 +02:00
Rolf Bjarne Kvinge f47f47a0e0
[src] Remove Classic code from the OpenGL, PassKit, PdfKit, Photos, QTKit, ReplayKit, SearchKit, Security, Social, SpriteKit, SystemConfiguration, Twitter, UserNotification, VideoToolbox, Vision, WebKit and WKWebKit frameworks. (#8807) 2020-06-10 09:08:42 +02:00
Rolf Bjarne Kvinge b3d166edb5
[msbuild] Remove the support for faking the watchOS 4.3 SDK. (#8813)
It's not needed, this was a workaround for an issue with the App Store to get
around an ARM64_32 requirement if building with the watchOS 4.3 SDK. The App
Store does not allow shipping apps built with the watchOS 4.3 SDK anymore, so
this workaround is not useful now.
2020-06-09 15:48:58 +02:00
Rolf Bjarne Kvinge 801a37f637
[msbuild] Unify MtouchArch and XamMacArch into TargetArchitectures. (#8797)
* [msbuild] Unify MtouchArch and XamMacArch into TargetArchitectures.

* [msbuild] Use $(ComputedPlatform) instead of $(_Platform).

They're identical, and this avoids using $(_Platform) before it's defined.
2020-06-09 14:28:36 +02:00
Rolf Bjarne Kvinge 2dbeecd0df
[src] Remove Classic code from the JavaScriptCore, MapKit, MediaLibrary, MediaToolbox, Metal, MetalKit, MetalPerformanceShaders, MobileCoreServices, ModelIO, MultipeerConnectivity, NetworkExtension and NotificationCenter frameworks. (#8796) 2020-06-09 08:21:14 +02:00
Rolf Bjarne Kvinge cc1fa266e8
[src] Remove Classic code from the GameController, GameKit, GameplayKit, GLKit, HealthKit, iAd, IdentityLookup[UI], ImageIO, ImageKit, Intents[UI] and IOSurface frameworks. (#8795) 2020-06-09 08:20:50 +02:00
Rolf Bjarne Kvinge 9e0beede0a
[src] Remove Classic code from Foundation. (#8794) 2020-06-09 08:20:05 +02:00
Rolf Bjarne Kvinge 4e89e3cad7
[src] Remove Classic code from the FinderSync, FileProvider[UI], ExternalAccessory, EventKit[UI], DeviceCheck, CoreWlan and CoreVideo frameworks. (#8793) 2020-06-09 08:18:28 +02:00
Alex Soto 33868e4036
[devops] Add Policheck tool to our pipeline (#8800)
New commits in xamarin/maccore:

* xamarin/maccore@d2ef9d7ee0 Add PoliCheckExclusions.xml (#2228)

Diff: 4bfce64847..d2ef9d7ee0
2020-06-08 14:13:40 -04:00
Rolf Bjarne Kvinge b8dac12704
[tests] Update the MT0051 tests to use newer test helper API. (#8799)
And delete the test case about Xcode 4.4, that's a bit old by now.

However, keep the Xcode 5.1.1 test case (which I've confirmed to work by
installing Xcode 5.1.1), since we'll probably want to have the test around for
when we update our min Xcode requirement (which is currently 6.0).
2020-06-08 18:34:12 +02:00
Rolf Bjarne Kvinge e2efa955b9
[tests] Remove the MT1211 mtouch test. (#8798)
This tests functionality that's been moved to mlaunch.
2020-06-08 17:50:58 +02:00
Sebastien Pouliot 69d094cc63
[README.md] Fix markdown warnings. Don't force 'en-us' URL. (#8790) 2020-06-08 08:36:08 -04:00
Rolf Bjarne Kvinge 60941a1efb
[src] Remove Classic code from the CoreMedia, CoreMidi, CoreML, CoreMotion, CoreNFC, CoreTelephony and CoreText frameworks. (#8786) 2020-06-08 08:59:27 +02:00
Rolf Bjarne Kvinge bc2db4c60a
[msbuild] Share the _DetectSigningIdentity target. (#8785)
Also rework the class hierarchy a little bit, so that Xamarin.iOS and
Xamarin.Mac are identical:

	DetectSigningIdentityTaskBase
	└─── iOS/DetectSigningIdentityTaskCore
	│    └─── iOS/DetectSigningIdentity
	└─── Mac/DetectSigningIdentityTaskCore
	│    └─── Mac/DetectSigningIdentity
2020-06-08 08:58:59 +02:00
Manuel de la Pena ae9c08a550
[AppKit][Tests] Do not fail when we cannot create a NSPasteboard. (#8788)
The test has started failign more commonly, but only in a number of old
OS versions and not all the time. The function should return a new
Pasteboard, but it is true that we are not releasing the old ones,
meaning that the pasteboard is left after the app is done as stated by
the apple documenation.

The test has been updated to:

1. Release the pasteboard.
2. Be inconclusive if the pasteboard service could not create a new one.

fixes: https://github.com/xamarin/xamarin-macios/issues/8787
2020-06-05 16:06:19 -04:00
Jonathan Peppers 050453fa4b
[build] generate Errors.Designer.cs for runtime assemblies (#8763)
Fixes: https://github.com/xamarin/xamarin-macios/issues/8467
Fixes: https://github.com/xamarin/xamarin-macios/issues/8727

If you add this code to an `AppDelegate.cs`:

    [Export ("f:")]
    public void F (DateTime t) { }

This will cause an exception at runtime, on purpose.

Instead of the actual error string, you get:

    System.Resources.MissingManifestResourceException:
      Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "Errors.mtouch.resources" was correctly embedded or linked into assembly "Xamarin.iOS" at compile time, or that all the satellite assemblies required are loadable and fully signed.
      ...
      at Xamarin.Bundler.Errors.get_MT4102 () [0x00000] in tools/mtouch/Errors.Designer.cs:1582

In 00985a55, `mtouch/Errors.designer.cs` was added to various .NET
assemblies, so things would compile. Unfortunately, the `.resx` file
was not included as an `EmbeddedResource`.

*Compiled* `.resx` files are generated by MSBuild:

e3146f30df/src/Tasks/GenerateResource.cs

Or via `resgen.exe`:

https://docs.microsoft.com/dotnet/framework/resources/creating-resource-files-for-desktop-apps

Instead of using this, we could just generate `Errors.Designer.cs`
ourselves. I wrote a small `generate-errors.csharp` script that will
parse the `.resx` file generating `internal const` fields. This will
be more performant at runtime and work well with the linker. The `const`
strings will be compiled into the IL inline if done this way.

After doing this, I got the correct error message in VS for Mac:

    Could not register the assembly 'brokenlocalization': ObjCRuntime.RuntimeException: The registrar found an invalid type `System.DateTime` in signature for method `brokenlocalization.AppDelegate.F`. Use `Foundation.NSDate` instead.
      at Registrar.Registrar.ToSignature (System.Type type, Registrar.Registrar+ObjCMember member, System.Boolean& success, System.Boolean forProperty) [0x00380] in src/ObjCRuntime/Registrar.cs:2611
      at Registrar.Registrar.ComputeSignature (System.Type declaring_type, System.Boolean is_ctor, System.Type return_type, System.Type[] parameters, System.Reflection.MethodBase mi, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00113] in src/ObjCRuntime/Registrar.cs:2526
      at Registrar.Registrar.ComputeSignature (System.Type DeclaringType, System.Reflection.MethodBase Method, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00059] in src/ObjCRuntime/Registrar.cs:2492
      at Registrar.Registrar+ObjCMethod.ComputeSignature () [0x00000] in src/ObjCRuntime/Registrar.cs:923

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-06-05 17:27:57 +02:00
Rolf Bjarne Kvinge d4bd5a5b4a
[mtouch] Remove empty comment tags from localization resx files. (#8781)
Solves build errors like this:

     xamarin-macios/tools/dotnet-linker/packages/xlifftasks/1.0.0-beta.20154.1/build/XliffTasks.targets(91,5): error : 'Errors.cs.xlf' is out-of-date with 'Errors.resx'. Run `msbuild /t:UpdateXlf` to update .xlf files or set UpdateXlfOnBuild=true to update them on every build, but note that it is strongly discouraged to set UpdateXlfOnBuild=true in official/CI build environments as they should not modify source code during the build.

See also: https://github.com/xamarin/xamarin-macios/pull/8157
2020-06-05 17:08:36 +02:00
Rolf Bjarne Kvinge f80bacf042
[msbuild] Share the _DetectSdkLocations target. (#8755) 2020-06-05 17:08:02 +02:00
Rolf Bjarne Kvinge 3c873f944e
[msbuild] Unify CodesignKey and CodeSigningKey into _SpecifiedCodesignKey. (#8758) 2020-06-05 17:07:25 +02:00
Rolf Bjarne Kvinge d8ae295901
[msbuild] Unify MtouchLink and LinkMode info _LinkMode. (#8764) 2020-06-05 17:07:16 +02:00
Rolf Bjarne Kvinge 868079850d
[src] Remove Classic code from the CoreBluetooth, CoreAudioKit, CoreAnimation, ContactsUI, Contacts, CloudKit, ClassKit, CFNetwork, CarPlay, CallKit and BusinessChat frameworks. (#8778) 2020-06-05 16:05:53 +02:00
Rolf Bjarne Kvinge 0c3ab261fd
[src] Remove Classic code from the CoreData, CoreFoundation, CoreGraphics, CoreImage and CoreLocation frameworks. (#8779) 2020-06-05 16:05:19 +02:00
Rolf Bjarne Kvinge 85e3113858
[dotnet-linker] Add support for passing configuration from the MSBuild targets to our linker steps. (#8780)
Add support for passing configuration from the MSBuild targets to our linker
steps using the linker's --custom-data option.

There are just two values being passed now, but this will grow significantly
over time as linker steps are implemented.
2020-06-05 16:04:53 +02:00
Rolf Bjarne Kvinge ab6b418483
[dotnet] Detect, compile and publish Info.plist into the app. (#8752)
* [dotnet] Detect, compile and publish Info.plist into the app.

* Automatically detect any property lists in the root project directory, and
  include them into the build.
* Introduce the existing build targets to detect and compile Info.plist into
  the .NET build.
* Add documentation for default inclusion. This document will grow over time
  as more file types are automatically included.
* Add some tests.

* [dotnet] Adjust default inclusion behavior.

* Use a single platform-specific variable to control all types of
  platform-specific inclusions.

* [dotnet] Move the default inclusion to .targets instead of .props, so that .NET's default inclusion logic is already imported.

.NET sets EnableDefaultItems in their .targets: https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.DefaultItems.targets#L16
2020-06-05 14:47:54 +02:00
Rolf Bjarne Kvinge 580bcd8c18
[src] Remove Classic code from AVFoundation. (#8765) 2020-06-05 08:11:31 +02:00
Rolf Bjarne Kvinge e77e3cfe2f
[src] Remove Classic code from the AudioUnit, AudioToolbox and AssetsLibrary frameworks. (#8762) 2020-06-05 08:10:41 +02:00
Sebastien Pouliot 97d2504d51
[tools] Remove MD5 from tooling (#8769)
Note: affected tools are not included in the code shipping inside the SDK

Usage of deprecated cryptographic algorithms is not approved anymore,
even if not used for cryptographic purpose.

MD5 was used to create immutable GUID since it's output is 128bits which
is just what a GUID wants as it's input (16 bytes). The same can be
achieved (even if a bit slower) with a newer/longer hash function

https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1128148
2020-06-04 22:14:13 -04:00
Manuel de la Pena 04da2a14c3
[CODEOWNERS] Update ownership. (#8771)
Done against my will and due to peer pressure.
2020-06-04 21:11:14 -04:00
Alex Soto ea8063bc5c
[sharpie] Use a better CDN download link (#8766) 2020-06-04 20:19:25 -04:00
Sebastien Pouliot 50aba47fb3
[scenekit] Fix BI1106 warnings (don't expose [Model] but protocol interface) (#8716)
The warning was skipped (an optimization done too early) on some API.
That's fixed with #8712 but SceneKit needed to be updated to make some
API more usable.
2020-06-04 14:13:11 -04:00