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

115 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot 72a6d60d2b
[tests][dotnet] Bump MSBuild.StructuredLogger to 2.1.472 to fix ArgumentNullException in our tests (#11422) 2021-05-03 19:51:52 -04:00
Sebastien Pouliot 4e48aa2ae1
[generator][dotnet] Add support for `[Uns|S]upportedOSPlatformAttribute` (#10580)
This moves our current/legacy attributes to the ones added in dotnet 5 [1].

Short Forms (only in bindings)

| Old                                   | New                                 |
|---------------------------------------|-------------------------------------|
| [iOS (7,0)]                           | [SupportedOSPlatform ("ios7.0")]    |
| [NoIOS]                               | [UnsupportedOSPlatform ("ios")]     |

Long Forms

| Old                                   | New                                 |
|---------------------------------------|-------------------------------------|
| [Introduced (PlatformName.iOS, 7,0)]  | [SupportedOSPlatform ("ios7.0")]    |
| [Obsoleted (PlatformName.iOS, 12,1)]  | [Obsolete (...)]                    |
| [Deprecated (PlatformName.iOS, 14,3)] | [UnsupportedOSPlatform ("ios14.3")] |
| [Unavailable (PlatformName.iOS)]      | [UnsupportedOSPlatform ("ios")]     |

Other changes

* `[SupportedOSPlatform]` and `[UnsupportedOSPlatform]` are not allowed on `interface` [2] which means they cannot be used for protocols. This is currently handled by inlining the existing attributes on all members.
* `[ObsoletedInOSPlatform]` was removed in net5 RC. This PR is now mapping the existing attributes to `[Obsolote]`, however multiple ones cannot be added so they need to be platform specific.

Remaining work (manual bindings update) tracked in https://github.com/xamarin/xamarin-macios/issues/11055

References

* [1] https://github.com/xamarin/xamarin-macios/issues/10170
* [2] https://github.com/dotnet/runtime/issues/47599
* [3] https://github.com/dotnet/runtime/issues/47601
2021-04-10 11:09:14 -04:00
Sebastien Pouliot a9251bb9ae
Bump MSBuild.StructuredLogger to 2.1.404 (#11182)
Required to bump dotnet runtime to preview 4 as the binary log format
was updated (and this affects our ability to run some tests)

https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/device-tests/20210407.33/4632319/sim/;/tests/vsdrops_index.html
2021-04-09 19:58:28 -04:00
Rolf Bjarne Kvinge b30777f420
Bump to .NET 6.0.100-preview.3.21161.23 (#10772)
* Bump to .NET 6.0.100-preview.3.21152.10

* Bump to 6.0.100-preview.3.21152.10.

* Bump to 6.0.100-preview.3.21161.7.

* Bump to .NET 6.0.100-preview.3.21161.23.

* [dotnet-linker] Bump ILink and use the supported method of getting an assembly's location.

* Bump to MSBuild.StructuredLogger 2.1.364 to get support for newer binlog versions.

* Fix build failure

Fixes:

    TestHelpers/BuildEngine.cs(161,24): error CS0433: The type 'ProjectEvaluationFinishedEventArgs' exists in both 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'StructuredLogger, Version=2.1.0.0, Culture=neutral, PublicKeyToken=d4c7181801cb6448' [/Users/builder/azdo/_work/1/s/xamarin-macios/tests/msbuild/Xamarin.MacDev.Tests/Xamarin.MacDev.Tests.csproj]

* Update parsing binlog properties.

* Be more defensive.

* [tests] Make sure the InternalsVisibleToAttribute constructor isn't linked away.

* [tests] Implement better printing of binlogs.

The latest MSBuild.StructuredLogger made some internal changes to the Message
property which confuses some of our test logic. So implement manual printing
of the log entries that we care about to make sure they conform to the
expected format by the tests (the output is mimicing what 'msbuild /v:diag
foo.binlog' would show).
2021-03-24 16:59:33 +01:00
Rolf Bjarne Kvinge bf7c3268bc
[dotnet] Use the reference assemblies from the .NET 6 version we're referencing. (#10813) 2021-03-09 14:57:56 +01:00
Sebastien Pouliot 6992a5a10a
[generator] Do not inline duplicate attributes when processing protocols (#10683)
- this requires small (but tricky) generator changes
- duplicate availability attributes detection is tested by introspection
- it also requires removing dupes in manual bindings (which was the
  current, if not the _named_, goal for this PR)

Long story:

It's always been hard to detect and enforce removal of extraneous
availability attributes since the generator inlined them _freely_
when processing ObjC protocols.

That meant introspection could not report dupes and led to many
extra attributes. This was **not** a problem in binding files since we
could ignore them. IOW their presence (in the input) does not mean they
are _all_ dupes in generated code (output).

However dupes in manual bindings were also (forced to be) _ignored_ and
those were part of the assemblies we ship. Again it was not a big deal,
nor a source of much extra metadata/size, so it was ignored.

Forward to today, manual bindings needs to be updated for net6 [1] so any
extra we have requires more (manual) work. Cleaning this problem up in
the generator code reduce the (manual) work we need to do.

It also means introspection can detect dupes (in generated and manual
code) so we don't end up adding more (which would also require more
manual work to support both set of attributes).

[1] https://github.com/xamarin/xamarin-macios/pull/10580
2021-03-01 08:39:52 -05:00
Rolf Bjarne Kvinge 85fe6340f6
Bump .NET to 6.0.100-preview.2.21114.3. (#10666)
* Bump .NET to 6.0.100-preview.2.21114.3.

* [dotnet-linker] Several steps are now gone, so load our custom step before the new first step (MarkStep).

* [dotnet-linker] Dump the current steps if we fail to call InsertBefore/InsertAfter.

* [dotnet-linker] Load the CollectAssembliesStep as the first step, and make it load every assembly.

* [dotnet] Set InvariantGlobalization=true because that's the only thing .NET supports for now.

* [dotnet-linker] Use recommended workaround for linker's inability to do load assemblies in custom step.

* [tests] Bump version of MSBuild.StructuredLogger to get support for new log version.

Otherwise this happens in tests that read binary logs:

    System.NotSupportedException : Unsupported log file format. Latest supported version is 9, the log file has version 10.

* [introspection] Ignore P/Invokes to QCall for LogThreadPool* P/Invokes.

* [dotnet-linker] Inject a dummy implementation of mono_config_parse_memory as a temporary solution for mono's removal of the same method.
2021-02-23 07:49:09 +01:00
Rolf Bjarne Kvinge c98b51feb7
[bgen] Avoid a NullReferenceException when reporting multiple attributes on a type. Fixes #10310. (#10311)
Fixes https://github.com/xamarin/xamarin-macios/issues/10310.
2020-12-17 15:12:32 +01:00
Rolf Bjarne Kvinge 9e20285ebb
[tests] Merge the msbuild-mac tests into the Xamarin.MacDev.Tests project. (#10129) 2020-12-04 13:05:51 +01:00
Rolf Bjarne Kvinge c640775699 [dotnet] Bump to .NET 6.0.100-alpha.1.20556.2. and net6.0
New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@f8768d9 Advance into the world of net6.0

Diff: 9abe69e6f5..f8768d99ef
2020-11-10 11:41:06 +01:00
Sebastien Pouliot 0922f354fe
[generator] Fix potential warnings/errors when `[Sealed]` is used on types. Fix #9065 (#9782)
Fix build warnings
```
build/mac/mobile/ReplayKit/RPScreenRecorder.g.cs(113,22): warning CS0628: 'RPScreenRecorder.RPScreenRecorder(IntPtr)': new protected member declared in sealed class
build/mac/full/ReplayKit/RPScreenRecorder.g.cs(113,22): warning CS0628: 'RPScreenRecorder.RPScreenRecorder(IntPtr)': new protected member declared in sealed class
```
which still happens even if we disable XM in `main` :|

Added generator test based on Whitney's test case from github issue

ref: https://github.com/xamarin/xamarin-macios/issues/9065
2020-10-05 22:01:36 -04:00
Manuel de la Pena 2c78255dbe
[Metal][Generator] Fix the SetBuffers methods in protocols. Fixes #9649 (#9651)
Add fixes for Metal for XAM_CORE_4. Fixing the methods takes us to a dangerous path, so we do not do it unless we have issues about the methods.

Fixes https://github.com/xamarin/xamarin-macios/issues/9649
2020-10-01 14:27:55 -04:00
Rolf Bjarne Kvinge 22fe547944
[tests] Make the .NET bgen tests actually reference the .NET BCL. (#9693)
Make the bgen tests pass in the path to the attribute library, platform
assembly and all the .NET reference assemblies to bgen. This way we execute
these tests using the .NET version of everything.
2020-09-24 14:57:05 +02:00
Rolf Bjarne Kvinge 621bf6c085
[tests] Fix running several test suites from the command line. Fixes xamarin/maccore@2279. (#9348)
Fixes https://github.com/xamarin/maccore/issues/2279
2020-08-12 10:34:55 +02:00
Rolf Bjarne Kvinge 2e59986723
[tests] Migrate the generator tests to use package references. (#9239) 2020-07-30 16:20:39 +02:00
Rolf Bjarne Kvinge 2b2f1d08dc
[tests] Remove Classic code from all tests. (#8702) 2020-05-28 16:35:09 +02:00
Waleed Chaudhry 729e241e4a
[Localization] Add generator error messages (#7531) 2020-01-08 16:07:46 -05:00
Vincent Dondain a558d84457 Merge branch 'xcode11.2' into master-merge-xcode11.2 2019-11-05 15:25:49 -05:00
Manuel de la Pena 5670872dc6
[Generator] Allow 1 level nester classes. Fixes: #7304 (#7309)
We have only encountered a case in which we had to add a nested
class/enum as the return type of a property. This fix ensures that we
can work with 1 level nested classes. A more general situation with
nested/nested/nested/.. classes is not taken into account because:

1. Would complicate too much the code.
2. Is fixing problems we do not have AFAIK.

So I'm keeping the fix simple, as I said, we have never faced anything
deeper than one level.
2019-10-25 20:06:00 -04:00
Rolf Bjarne Kvinge a8fdf6db6e
Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process. (#7177)
* Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process.

mono changed how quotes should be escaped when passed to
System.Diagnostic.Process, so we need to change accordingly.

The main difference is that single quotes don't have to be escaped anymore.

This solves problems like this:

    System.ComponentModel.Win32Exception : ApplicationName='nuget', CommandLine='restore '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable/CellCustomTable.sln' -Verbosity detailed -SolutionDir '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable'', CurrentDirectory='/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories', Native error= Cannot find the specified file
      at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0029f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-08/external/bockbuild/builds/mono-x64/mcs/class/System/System.Diagnostics/Process.cs:778

ref: https://github.com/mono/mono/pull/15047

* Rework process arguments to pass arrays/lists around instead of quoted strings.

And then only convert to a string at the very end when we create the Process
instance.

In the future there will be a ProcessStartInfo.ArgumentList property we can
use to give the original array/list of arguments directly to the BCL so that
we can avoid quoting at all. These changes gets us almost all the way there
already (except that the ArgumentList property isn't available quite yet).

We also have to bump to target framework version v4.7.2 from v4.5 in several
places because of 'Array.Empty<T> ()' which is now used in more places.

* Parse linker flags from LinkWith attributes.

* [sampletester] Bump to v4.7.2 for Array.Empty<T> ().

* Fix typo.

* Rename GetVerbosity -> AddVerbosity.

* Remove unnecessary string interpolation.

* Remove unused variable.

* [mtouch] Simplify code a bit.

* Use implicitly typed arrays.
2019-10-14 16:18:46 +02:00
Waleed Chaudhry 1dc3beabfa
[Generator] Provide clear error message on type mismatch with BindAs error (#7016)
* [Generator] Provide clear error message on type mismatch with BindAs attribute that results in  generator crashing. Fixes 6863.
2019-09-19 21:05:22 -04:00
Rolf Bjarne Kvinge df523c8b18 Merge remote-tracking branch 'origin/xcode11' into d16-3. 2019-09-17 08:30:12 +02:00
Rolf Bjarne Kvinge 303aa0a649 Merge remote-tracking branch 'origin/xcode11' into master-xcode11 2019-09-13 18:35:18 +02:00
Rolf Bjarne Kvinge f6e0531197 Merge xcode11 into d16-3. 2019-09-12 08:29:02 +02:00
Rolf Bjarne Kvinge 3ee1329e0e
[generator] Handle inheriting the same member from multiple protocols. Fixes #6366. (#6961)
* [generator] Handle inheriting the same member from multiple protocols. Fixes #6366.

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

* Update xtro.
2019-09-11 05:12:43 -07:00
Rolf Bjarne Kvinge cce789d481
[generator] Handle subclasses of NSObject as ref/out parameters in third-party libraries. Fixes #6828. (#6829) (#6847)
For third-party libraries we need to look up the base type using the BaseType attribute.

Fixes https://github.com/xamarin/xamarin-macios/issues/6828.
2019-08-26 07:14:26 -07:00
Rolf Bjarne Kvinge 4e70034b96
[generator] Handle subclasses of NSObject as ref/out parameters in third-party libraries. Fixes #6828. (#6829)
For third-party libraries we need to look up the base type using the BaseType attribute.

Fixes https://github.com/xamarin/xamarin-macios/issues/6828.
2019-08-26 01:06:13 -07:00
Rolf Bjarne Kvinge d4192a59f0
[xcode11] Remove the WatchKit framework from iOS while keeping API stability. Fixes #6492. (#6503)
* [WatchKit] Remove this framework for iOS while keeping backwards compatibility. Fixes #6492.

* Copy all generated sources and modify them to throw PlatformNotSupported exceptions.
* Adjust some existing source code to also throw PlatformNotSupported exceptions.
* Sprinkle Obsolete attributes generously.
* Stop generating code for the WatchKit framework for iOS.

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

* [introspection] Adjust test.

* [mtouch] Don't link with WatchKit, and show a warning if we detect code that want to use WatchKit.

* [xtro] Remove WatchKit for iOS.

* [introspection] Don't check obsoleted NSString fields for null.

There's probably a reason the field was obsoleted.

* [introspection] Add exception for the WatchKit framework.

* [xtro] Ignore obsolete enums.

There's probably a reason they're obsoleted.

In particular it solves a confusion between WKWebKit.WKErrorCode and
WatchKit.WKErrorCode: for iOS, the latter is obsoleted, and this way we always
process the former instead.

* [mtouch] Adjust wording for MT4178 to be more accurate.

* [WatchKit] Make more API obsolete/hidden.

Two classes managed to slip past the first time.

* [tests] Adjust test after WatchKit removal.
2019-08-14 17:46:55 +02:00
Alex Soto 7bf95d97b0
[generator] Add support for [Native] enums inside [StrongDictionaries] (#6763) 2019-08-13 18:36:36 -04:00
monojenkins 0443822a3f [xcode11] [Generator] Do not used harcoded 'error' var name, use the one in the declaration. (#6637) 2019-07-24 13:28:07 +02:00
Manuel de la Pena 2648b2ecec
[Generator] Do not used harcoded 'error' var name, use the one in the declaration. (#6620) 2019-07-24 01:03:10 +02:00
Rolf Bjarne Kvinge a495077533
[xcode11] Stop building/shipping 32-bit Xamarin.Mac bits. Partial fix for #6300. (#6393)
This includes:

* 32-bit version of Xamarin.Mac.dll and OpenTK.dll
* XamMac.dll and XamMac.CFNetwork.dll
* 32-bit versions of the runtime libraries (libxammac.a and friends).
* 32-bit version of the partial static library for Xamarin.Mac.
* Classic support in the generator.

We still ship a few Classic files so that Visual Studio for Mac continue to detect that Xamarin.Mac is installed (otherwise VSfM won't open Classic projects, which makes it impossible to use the migration wizard).

This makes our build slightly faster.

Partial fix for #6300.
2019-07-15 10:19:24 -07:00
Rolf Bjarne Kvinge f9d39c640b
Merge pull request #6164 from monojenkins/backport-pr-6159-to-d16-2
[d16-2] [Metal] Sprinkle [return: Release] on all 'new*' selectors. Fixes #5941.
2019-06-19 17:29:43 +02:00
Rolf Bjarne Kvinge 14cac96c90
[d16-2] Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279) (#6361)
* Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279)

* Bump VSMac to 8.1.0.2742 to fix msbuild issues

This is required to get the support for the msbuild `ToolsVersion`
change from `15.0` to `Current`.

* [tests][msbuild] Fix Binding resources test with updated msbuild

Test failure with updated msbuild and vsmac 8.1:

```
Xamarin.iOS.Tasks.NativeReferencesNoEmbedding("iPhone").ShouldNotUnnecessarilyRebuildBindingProject(True)
     Binding project build did not create package?
  Expected: True
  But was:  False

at Xamarin.iOS.Tasks.NativeReferencesNoEmbedding.ShouldNotUnnecessarilyRebuildBindingProject (System.Boolean framework) [0x000a0] in <74b8f7d8a53e40109916d305bb4d7403>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cul
ture) [0x0006a] in <0519fa732e8845b6a809ce9180f541db>:0
```

The test builds the project multiple times. Before the 3rd build, the project
file's timestamp is updated and expects that the binding package will be
rebuilt. But it is not, because the target `_CreateBindingResourcePackage`
doesn't depend on that project file. So, add that to the target inputs.

* [nuget] Use xibuild to run nuget

Fix errors seen during `nuget restore` for tests:

```
Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xammac_tests/xammac_tests.csproj(213,3): error MSB4024: The imported project file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" could not be loaded. Could not find file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets"
```

* [xibuild] Fix incorrect mscorlib.dll being used (#6068)

* [xibuild] Fix incorrect mscorlib.dll being used

The `GuiUnit_NET_4_5` project, when built with `xibuild` uses the wrong `mscorlib.dll`.

From https://github.com/xamarin/xamarin-macios/issues/5760#issuecomment-472457202 :

```
- mscorlib.dll is being used from mono/4.5 and the other system assemblies are from mono/4.5-api
- GuiNet* project is built with xibuild

What is happening here is:

	xibuild sets[1] `SetToolsetProperty ("TargetFrameworkRootPath", FrameworksDirectory + Path.DirectorySeparatorChar);`
	which points to `/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks`.
	This causes $(FrameworkPathOverride) to be set[2] to `/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks/.NETFramework/v4.5`,
	but that doesn't have a mscorlib.dll, so it gets reset[3] to /Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5/.

	If we don't set TargetFrameworkRoothPath, then we get `FrameworkPathOverride = /Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5-api`,
	causing `_ExplicitReference=/Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5-api/mscorlib.dll`(correct one) to be used.
```

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

1. https://github.com/xamarin/xamarin-macios/blob/master/tools/xibuild/Main.cs#L209
2. https://github.com/mono/msbuild/blob/xplat-master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L79
3. https://github.com/mono/msbuild/blob/xplat-master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L84

* Revert "Workaround https://github.com/xamarin/xamarin-macios/issues/5760 in generator csproj"

This reverts commit 9bd927bb7f.

The previous commit for xibuild removes the need for this.

* [xibuild] Handle "incorrectly" cased msbuild property names  (#6202)

msbuild property names are case insensitive. While generating the custom
app.config, in `SetToolsetProperty(..)` we try to update the property if
it already exists. But the name lookup was case sensitive, thus causing
the lookup to fail, resulting in two entries for the same property name
differing only in case. Eg. `MSBuildSDKsPath` vs `MSBuildSdksPath`.

Fixed to ignore case.

Fixes https://github.com/mono/mono/issues/14765 .
2019-06-19 17:28:01 +02:00
Ankit Jain e271d5e18d Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279)
* Bump VSMac to 8.1.0.2742 to fix msbuild issues

This is required to get the support for the msbuild `ToolsVersion`
change from `15.0` to `Current`.

* [tests][msbuild] Fix Binding resources test with updated msbuild

Test failure with updated msbuild and vsmac 8.1:

```
Xamarin.iOS.Tasks.NativeReferencesNoEmbedding("iPhone").ShouldNotUnnecessarilyRebuildBindingProject(True)
     Binding project build did not create package?
  Expected: True
  But was:  False

at Xamarin.iOS.Tasks.NativeReferencesNoEmbedding.ShouldNotUnnecessarilyRebuildBindingProject (System.Boolean framework) [0x000a0] in <74b8f7d8a53e40109916d305bb4d7403>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cul
ture) [0x0006a] in <0519fa732e8845b6a809ce9180f541db>:0
```

The test builds the project multiple times. Before the 3rd build, the project
file's timestamp is updated and expects that the binding package will be
rebuilt. But it is not, because the target `_CreateBindingResourcePackage`
doesn't depend on that project file. So, add that to the target inputs.

* [nuget] Use xibuild to run nuget

Fix errors seen during `nuget restore` for tests:

```
Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xammac_tests/xammac_tests.csproj(213,3): error MSB4024: The imported project file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" could not be loaded. Could not find file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets"
```
2019-06-19 07:07:26 +02:00
Rolf Bjarne Kvinge 614de0b077
[tests] Set environment variables so that the in-process generator finds the locally built platform assemblies. (#6178)
When running the in-process generator, we need to set the same environment
variables as we already do when running the out-of-process generator, so that
the generator looks for the platform assemblies in the local install directory
(and not the system one).
2019-05-30 14:19:26 -07:00
Rolf Bjarne Kvinge ff86152ecc [generator] Fix generation of ReturnRelease code for third-party bindings. (#6135)
Don't use internal platform API (the Selector.Release field), and make sure
the void_objc_msgSend function exists in the binding.
2019-05-30 07:12:38 +02:00
Rolf Bjarne Kvinge 50149daa1f
[generator] Fix generation of ReturnRelease code for third-party bindings. (#6135)
Don't use internal platform API (the Selector.Release field), and make sure
the void_objc_msgSend function exists in the binding.
2019-05-27 23:08:45 -07:00
Rolf Bjarne Kvinge e12243698d
[tests] Use msbuild, not xibuild, to build the generator tests. (#6136)
The generator tests is a standard C# library, and can use the system msbuild
just fine.

Fixes this build problem when building the tests using the command line:

    xamarin-macios/external/mono/external/ikvm/reflect/Emit/ILGenerator.cs(119,20): error CS0433: The type 'Stack<T>' exists in both 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
2019-05-27 22:35:10 -07:00
Ankit Jain 7dddfb657c [xibuild] Fix incorrect mscorlib.dll being used (#6068)
* [xibuild] Fix incorrect mscorlib.dll being used

The `GuiUnit_NET_4_5` project, when built with `xibuild` uses the wrong `mscorlib.dll`.

From https://github.com/xamarin/xamarin-macios/issues/5760#issuecomment-472457202 :

```
- mscorlib.dll is being used from mono/4.5 and the other system assemblies are from mono/4.5-api
- GuiNet* project is built with xibuild

What is happening here is:

	xibuild sets[1] `SetToolsetProperty ("TargetFrameworkRootPath", FrameworksDirectory + Path.DirectorySeparatorChar);`
	which points to `/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks`.
	This causes $(FrameworkPathOverride) to be set[2] to `/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks/.NETFramework/v4.5`,
	but that doesn't have a mscorlib.dll, so it gets reset[3] to /Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5/.

	If we don't set TargetFrameworkRoothPath, then we get `FrameworkPathOverride = /Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5-api`,
	causing `_ExplicitReference=/Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5-api/mscorlib.dll`(correct one) to be used.
```

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

1. https://github.com/xamarin/xamarin-macios/blob/master/tools/xibuild/Main.cs#L209
2. https://github.com/mono/msbuild/blob/xplat-master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L79
3. https://github.com/mono/msbuild/blob/xplat-master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L84

* Revert "Workaround https://github.com/xamarin/xamarin-macios/issues/5760 in generator csproj"

This reverts commit 9bd927bb7f.

The previous commit for xibuild removes the need for this.
2019-05-17 09:12:05 -07:00
Rolf Bjarne Kvinge ef0d7a1718
[generator] Show proper errors when failing to compile something. (#6003)
* [mtouch/mmp] Split out the RunCommand[Async] methods to a separate file so that the generator can reuse more easily.

* [generator] Show proper errors when failing to compile something.

* Fix grammar
2019-05-07 13:40:59 +02:00
Rolf Bjarne Kvinge e3bafafff0 [tests] Add tests for out/ref parameters. 2019-04-30 14:29:24 +00:00
Rolf Bjarne Kvinge b51aaf4b8b [tests] Add tests for out/ref parameters. 2019-04-26 11:20:15 +02:00
Alexander Köplinger 99ea097abf Merge remote-tracking branch 'upstream/master' into mono-2019-02 2019-04-24 23:28:00 +02:00
Rolf Bjarne Kvinge 09701f4c19
[tests] Fix bgen test to compile by adding missing using. (#5932) 2019-04-23 16:26:38 +01:00
Rolf Bjarne Kvinge adb57537b5
[bgen] Show an error if trying to bind an array of selectors. (#5923) 2019-04-23 06:29:03 +01:00
Alexander Köplinger 9bd927bb7f Workaround https://github.com/xamarin/xamarin-macios/issues/5760 in generator csproj 2019-04-16 17:59:23 +02:00
Rolf Bjarne Kvinge 09f3fce5f2 [tests][bgen] Capture stdout/stderr per thread.
Otherwise tests running in parallel interfere with the output of eachother.
2019-04-11 08:35:21 +02:00
Rolf Bjarne Kvinge 3d9826ae5f [tests][bgen] Specify an output assembly for tests, so that we don't use the current directory.
Using the current directory won't work for in-process bgen tests.
2019-04-11 08:34:36 +02:00
Rolf Bjarne Kvinge ff82af4576 [bgen] Make it possible to run the tests using an in-process generator.
This means referencing the generator project, and create an array of the
arguments (since Main takes an array of strings) instead of a quoted string.
2019-04-11 08:32:58 +02:00