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

9551 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge ebb3da262b [tests] There's no need to reference the MSBuild assemblies from Xamarin.MacDev.Tests anymore, we're going out-of-process! 2020-10-29 14:52:31 +01:00
Rolf Bjarne Kvinge 0ba5faecb5 [tests] There's no need for Xamarin.MacDev.Tests to reference Xamarin.iOS.Tasks
But we still need a reference to Xamarin.MacDev, since we use some code from that assembly.
2020-10-29 14:52:31 +01:00
Rolf Bjarne Kvinge 6aa51156a2 [tests] Remove BundlePath from ProjectTest, it's not used 2020-10-29 14:52:31 +01:00
Rolf Bjarne Kvinge 4d9bbaf650 [tests] Add Platform/Configuration to TestBase.
This makes it easier to simplify some code later.
2020-10-29 14:52:30 +01:00
Rolf Bjarne Kvinge 915f96b885 [tests] Remove dead code 2020-10-29 14:51:53 +01:00
Rolf Bjarne Kvinge 1ea929ac48 [tests] Remove unused variable. 2020-10-29 14:51:53 +01:00
Rolf Bjarne Kvinge 16c60508c5 [tests] Remove outdated comment 2020-10-29 14:51:53 +01:00
Rolf Bjarne Kvinge 62af8c3fd9 [tests] Use binlog instead of text logs 2020-10-29 09:53:06 +01:00
Rolf Bjarne Kvinge d882a3e370 [tests] Drop AssemblyInitialization from Xamarin.MacDev.Tests, it's not needed 2020-10-29 09:53:06 +01:00
Rolf Bjarne Kvinge 8f2913b518
[dotnet] Add asset catalogs to the our items included by default. (#9841) 2020-10-29 09:18:20 +01:00
Rolf Bjarne Kvinge 42bd13cbdc
[dotnet-linker] Improve error reporting by consolidating it in the LinkerConfiguration class. (#9992)
* Continue using our own error handling logic, and print our problems to stderr.
* Also use the linker's messaging facilities to report a more generic error,
  in case stderr doesn't show up for some reason.
2020-10-29 09:04:25 +01:00
Rolf Bjarne Kvinge 64edc26cb4
[dotnet] Improve context-ful linker errors by including the underlying exception message in the output. (#9991)
Because just this is kind of useless:

    error MT2301: The linker step 'Setup' failed during processing.

now it will say:

    error MT2301: The linker step 'Setup' failed during processing: <hopefully something useful here>
2020-10-29 09:02:39 +01:00
Rolf Bjarne Kvinge f3614c86a6
[tools] Always show nested exceptions if they're our own exceptions. (#9990)
Sometimes we wrap exceptions to add more information to what's happening, but
that may end up worse if we don't print out the wrapped exceptions.

At the same time we don't want to flood the user with information if they
didn't ask for it, so only show nested exceptions if they're something we
raised ourselves.
2020-10-29 08:59:44 +01:00
Rolf Bjarne Kvinge 1197c67ebe
[tests] Rewrite ValidateAppBundleTaskTests to not create a task in-process. (#9983)
This is a step towards making Xamarin.MacDev.Tests run tests out-of-process.

It requires adding '_GenerateBundleName' as a dependency for the
'_ValidateAppBundle' target, because we're invoking the '_ValidateAppBundle'
directly, and we can't depend on any other targets executing
'_GenerateBundleName', because there are no other executed targets.
2020-10-29 08:59:11 +01:00
Rolf Bjarne Kvinge 26e720943f
[tests] Bump Xamarin.MacDev.Tests to net472 (#9986) 2020-10-28 17:48:04 +01:00
Rolf Bjarne Kvinge d02a2c2c3f
[tests] Simplify WatchKit 1 test (since we don't support WatchKit 1 anymore) (#9987) 2020-10-28 17:47:51 +01:00
Rolf Bjarne Kvinge 139c11a190
[tests] Use MyiOSFrameworkBinding as a binding test project instead of bindings-test (#9985)
MyiOSFrameworkBinding is in our normal collection of test projects (in
tests/common/TestProjects), which means it doesn't need a lot of special
casing to make it work.
2020-10-28 17:21:40 +01:00
Rolf Bjarne Kvinge 2cfbb67d31
[tests] Fix assert in DetectAppManifest_LibraryProject. (#9982)
"Is.Not.Null.Or.Empty" is equal to "(value != null) || (value.Length == 0)", which
is the same as "value != null", i.e. "Is.Not.Null", which was clearly not the intention
of this code.

The fact is that the _AppManifest value is not set for library projects, so the correct
assert is to verify that the value is null or empty.
2020-10-28 13:13:22 +01:00
Alex Soto 2f989845fb
[README] Bump downloads to our new Xamarin.iOS stable (#9981) 2020-10-28 07:35:47 -04:00
Rolf Bjarne Kvinge ef91c798dc
[dotnet] Package the workloads in a Windows installer (.msi) as well. (#9979) 2020-10-28 11:09:55 +01:00
Rolf Bjarne Kvinge 9cf78cf399
[tests] Clean up Xamarin.MacDev.Tasks.Tests. (#9975)
* Remove a lot of dead code.
* Use TestBase.CreateTask<T> to create tasks (and set required properties for all
  tasks) instead of instantiating tasks directly. This required subclassing TestBase
  in a few places, as well as making a few helper methods instance methods instead
  of static methods.
* Bump to net472.
* A few other misc simplifications.
2020-10-28 08:13:18 +01:00
Rolf Bjarne Kvinge c72b320561
[tests] Set MSBuildEnableWorkloadResolver=true when running the .NET tests. (#9977)
This works fine when executed from xharness, because
MSBuildEnableWorkloadResolver is set by xharness, but without this the dotnet
tests fail when executed from the IDE.
2020-10-28 08:12:19 +01:00
Sebastien Pouliot 7e854827d4
[msbuild] Have `XcodeCompilerToolTask` use `xcrun` to start Apple tools (#9965) (#9972)
1. Use `xcrun` to run `ibtool` (and `actool`) and avoid toolchain mismatches

2. Set `DEVELOPER_DIR` so everyone (well `xcrun`) use the same toolchain

3. Workaround for `macos-arm64` issue (FB8827920)

	* Start `ibtool` as an `Apple` [Silicon] process
	* This will ensure the `ibtoold` daemon is also running as `Apple`
	* If `ibtoold` is run as `Intel` then `ibtool` asserts and build fail

```
LaunchScreen.storyboard : error : 2020-10-26 14:24:52.757 ibtoold[37142:6681382] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-17506/InterfaceBuilderKit/Utilities/IBAbstractInterfaceBuilderPlatformToolManager.m:481
LaunchScreen.storyboard : error : Details:  Failed to attach to IBAgent-iOS with error: Error Domain=com.apple.InterfaceBuilder Code=-1 "Encountered an error communicating with IBAgent-iOS." UserInfo={NSLocalizedFailureReason=IBAgent-iOS (37146) failed to launch and exited with status 10, NSUnderlyingError=0x7fa4e58fc760 {Error Domain=com.apple.InterfaceBuilder Code=-1 "Failed to launch IBAgent-iOS via CoreSimulator spawn" UserInfo={NSLocalizedDescription=Failed to launch IBAgent-iOS via CoreSimulator spawn, NSUnderlyingError=0x7fa4e5e8a900 {Error Domain=com.apple.InterfaceBuilder Code=-1 "Failed to handshake with platform tool" UserInfo={NSLocalizedFailureReason=Failed to open connection over FIFOs with platform tool, NSLocalizedDescription=Failed to handshake with platform tool, NSUnderlyingError=0x7fa4e5e237c0 {Error Domain=com.apple.InterfaceBuilder Code=-1 "" UserInfo=0x7fa4e5e8bba0 (not displayed)}}}}}, NSLocalizedRecoverySuggestion=Please check Console.app for crash reports for "IBAgent-iOS" for further information., NSLocalizedDescription=Encountered an error communicating with IBAgent-iOS.}
LaunchScreen.storyboard : error : Object:   <IBCocoaTouchToolManager>
LaunchScreen.storyboard : error : Method:   +_THREADSAFE_launchNewToolWithLaunchContext:executionContext:toolProxyClass:proxyDelegate:failureContext:requestingMethod:error:forReason:
LaunchScreen.storyboard : error : Thread:   <NSThread: 0x7fa4e341af70>{number = 1, name = main}
LaunchScreen.storyboard : error : Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
LaunchScreen.storyboard : error : 2020-10-26 14:24:52.766 ibtoold[37142:6681382] [MT] IBPlatformTool: *** Failed to launch tool with description <IBCocoaTouchPlatformToolDescription: 0x7fa4e5f34160> System content for IBCocoaTouchFramework-fourteenAndLater <IBScaleFactorDeviceTypeDescription: 0x7fa4e5f2fb50> scaleFactor=2x, renderMode.identifier=(null): Encountered an error communicating with IBAgent-iOS. (Failure reason: IBAgent-iOS (37146) failed to launch and exited with status 10): Failed to launch IBAgent-iOS via CoreSimulator spawn: Failed to handshake with platform tool (Failure reason: Failed to open connection over FIFOs with platform tool): : Failed to open FIFOs for handshaking with platform tool (Failure reason: IBAgent-iOS exited before we could handshake)
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1425,3): error : ibtool exited with code 1
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1425,3): error :
LaunchScreen.storyboard : ibtool error : Encountered an error communicating with IBAgent-iOS.
```

Note: `main` has diverged quite a bit (net6 support) so this pull request
will need to be re-worked (it won't apply)

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

Foreport of #9965 since the source code diverged from `xcode12.2`
2020-10-27 21:11:08 -04:00
Rolf Bjarne Kvinge a141da12b5
Ship a LICENSE file with the workload. (#9978) 2020-10-27 22:46:59 +01:00
Manuel de la Pena 1e62c18191
[Makefile] Point to xcode12.1 xip file. (#9973) 2020-10-27 17:22:53 -04:00
Rolf Bjarne Kvinge ebef5e3e6b
[xharness] Automatically run the msbuild tests if something in the msbuild or tests/msbuild directories changed. (#9976) 2020-10-27 21:45:57 +01:00
Rolf Bjarne Kvinge 3db0a33b90
[dotnet] Implement AOT compilation for mobile platforms (#9962)
* Add an AOTCompile task that runs the AOT compiler for a given set of input assemblies.
  This task will eventually be deprecated by an equivalent task provided by Mono,
  but this works for now.

* Add an _AOTCompile target that takes care of running the AOT compiler and compile
  the result into object files.
2020-10-27 15:16:34 +01:00
Manuel de la Pena 923aef0838
[Actions] Fix the if condition. Return error with empty labels. (#9967) 2020-10-26 15:56:03 -04:00
Rolf Bjarne Kvinge 1770af11b1
[dotnet-linker] Catch any exceptions from our custom steps and show them using our error reporting logic. (#9954)
* [dotnet-linker] Catch any exceptions from our custom steps and show them using our error reporting logic.

* Letting the linker handle the exceptions will not result in a particularly
  good experience, because the linker will crash.

* We can also show better information, since we have more knowledge about many
  of the exceptions we raise ourselves.

* [dotnet] Make ConfigurationAwareSubStep inherit from ExceptionalSubStep.

This required a minor modification to ExceptionalSubStep to allow for custom reporting.

* [dotnet] Implement ConfigurationAwareStep's exception handling like it's done in ExceptionalSubStep.
2020-10-26 20:16:03 +01:00
Manuel de la Pena a5d2fe7280 [Actions] Ignore the monojenkins check for now 2020-10-26 14:57:51 -04:00
Manuel de la Pena 093938e926
[Actions] If we have no labels and we are not monojenkins, fail. (#9963) 2020-10-26 14:48:07 -04:00
Rolf Bjarne Kvinge 98c2abc72d
[tools] Localize error messages from the ExceptionSubStep linker step. (#9959)
I also changed the error message slightly to hopefully make it a bit more
comprehensible when translated (since the step name won't be translated, we'll
end up with a message that mixes English with the translated string).
2020-10-26 16:28:49 +01:00
Rolf Bjarne Kvinge b7511be48c
[tools/dotnet] Re-use the existing main generation code in our dotnet code. (#9953)
Move/refactor the code to generate the main function to make it re-usable from
our dotnet code (and then use it there as well).
2020-10-26 16:26:49 +01:00
Rolf Bjarne Kvinge 015e6407e2 Document and verify bit. 2020-10-26 11:57:44 +01:00
Rolf Bjarne Kvinge 2e77de3dcf
[tools] Renumber RemoveRejectedTypesStep's error code base to match other ExceptionalSubStep subclasses. (#9955)
Also document which numbers each subclass uses in Errors.resx. This makes it
much easier to figure out the next number to use.
2020-10-26 09:58:41 +01:00
Rolf Bjarne Kvinge f22e143f1c
[tests] Make the baseline sample test pass the correct environment variables. (#9952)
This makes it so that we use the configured Xcode, and not the default (/Applications/Xcode.app), which may be a symlink, which doesn't work with Xcode 12:

    Tool /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool execution started with arguments: --errors --warnings --notices --output-format xml1 --minimum-deployment-target 8.0 --target-device iphone --target-device ipad --auto-activate-custom-fonts --sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.sdk --compilation-directory /Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/obj/iPhone/Debug/ibtool /Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/LaunchScreen.storyboard
             (TaskId:13)
    Tool /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool execution finished (exit code = 134).
             (TaskId:13)
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.854 ibtoold[5120:92020] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-17515.1/DVTFoundation/PlugInArchitecture/DataModel/DVTPlugIn.m:232 [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : Details:  Requested but did not find required plug-in with identifier com.apple.rc.RCIDESupportCore [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : Object:   <DVTPlugIn: 0x7fe30d129560> [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : Method:   -awakeWithPropertyList: [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : Thread:   <NSThread: 0x7fe30780acc0>{number = 1, name = main} [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide. [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.863 ibtoold[5120:92020] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition for extension Xcode.IBCocoaTouchBuildSupport.PlatformDefinition.MacCatalyst of plug-in com.apple.dt.IDE.IBCocoaBuildSupport [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.863 ibtoold[5120:92020] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition for extension Xcode.IBCocoaBuildSupport.PlatformDefinition.Cocoa of plug-in com.apple.dt.IDE.IBCocoaBuildSupport [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.880 ibtoold[5120:92020] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition for extension Xcode.IBCocoaTouchBuildSupport.PlatformDefinition.CocoaTouch of plug-in com.apple.dt.IDE.IBCocoaTouchBuildSupport [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.880 ibtoold[5120:92020] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition for extension Xcode.IBAppleTVBuildSupport.PlatformDefinition.AppleTV of plug-in com.apple.dt.IDE.IBAppleTVBuildSupport [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.883 ibtoold[5120:92020] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition for extension Xcode.IDEInterfaceBuilder.PlatformDefinition.WatchOS of plug-in com.apple.dt.IDE.IDEInterfaceBuilderWatchKitBuildSupport [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
    LaunchScreen.storyboard : error : 2020-10-22 17:47:39.979 ibtoold[5120:92020] [MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-17506/InterfaceBuilderKit/Utilities/IBScopedSingletonRegistry.m:45 [/Users/runner/work/1/s/xamarin-macios/tests/sampletester/BaselineTest/BaselineTest.csproj]
2020-10-23 16:21:01 +02:00
Rolf Bjarne Kvinge b36632e7ce [tools] Pass -DDEBUG to the native compiler when compiling generated code in debug mode.
The generated main code requires this to build successfully.
2020-10-23 11:46:09 +02:00
Rolf Bjarne Kvinge 6b344e767c [tools] Store the AssemblyName in Application.RootAssemblies.
This is how it's currently done in Xamarin.iOS/Xamarin.Mac, and this makes the existing
main generation code work.
2020-10-23 11:46:09 +02:00
Rolf Bjarne Kvinge b164d9bbad [tools] Re-use Target.GenerateMain from dotnet-linker. 2020-10-23 11:46:09 +02:00
Rolf Bjarne Kvinge 1d5a6cfe79 [tools] Add support for registration methods to the mac main generation by moving iOS' implementation to shared code. 2020-10-23 11:46:09 +02:00
Rolf Bjarne Kvinge d039a8ecd3 [tools] Create a Target.GenerateMain function that wraps the iOS/macOS variants and avoids duplicating some code. 2020-10-23 11:46:09 +02:00
Rolf Bjarne Kvinge 85c473fab2 [tools] Make the Generate*Main API/signatures more similar. 2020-10-23 11:46:09 +02:00
Rolf Bjarne Kvinge 6240e848f3 [mtouch] Move mtouch's GenerateMain to shared Target code.
This means moving a lot of supporting code to shared code as well.
2020-10-23 11:46:09 +02:00
Rolf Bjarne Kvinge f513501443 [mmp] Move mmp's GenerateMain to shared Target code.
This means moving some supporting code to shared code as well.
2020-10-23 11:46:09 +02:00
Rolf Bjarne Kvinge dce4c37fc6
[dotnet] Only fix the id of mono libraries which are actually dylibs. (#9944) 2020-10-23 09:12:49 +02:00
Rolf Bjarne Kvinge 673a378cbb
[msbuild] Add a TargetArchitectures argument to the LinkNativeCode task. (#9945)
The native linker defaults to the execution architecture, which works fine for
64-bit iOS Simulator (because we target x86_64 and run on x86_64), but it
doesn't work for any other architecture, so make sure to pass the architecture
to the native linker.

Also make sure we only get one architecture, because the native linker doesn't support
building fat libraries (we'll have to add support for manually lipoing the result).
2020-10-23 09:12:34 +02:00
Rolf Bjarne Kvinge 79cbc72bf0
[msbuild] Always create debug symbols when building native code. (#9946)
There's no reason not to, since we strip the executables later when needed.
2020-10-23 09:11:27 +02:00
Rolf Bjarne Kvinge f886aa7250
[msbuild] Change XamarinTask to fail the build if a tool fails to execute. (#9948)
* [msbuild] Change XamarinTask to fail the build if a tool fails to execute.

Also don't show 'xcrun' as the tool, but instead the executable 'xcrun'
executed.

* [msbuild] Make error reporting optional.

This way the caller can choose to either report a better error, or not report
an error at all.
2020-10-23 08:06:32 +02:00
Rolf Bjarne Kvinge 02ce88fa7f
[xharness] Create device variations for the .NET tests. (#9947)
They're all disabled by default for now, since device builds for .NET hasn't
been implemented yet.
2020-10-22 16:32:14 +02:00
Rolf Bjarne Kvinge 673e20e4b4
[xharness] Make the MSBuildTask capable of building .NET projects. (#9941)
Merge DotNetBuildTask into MSBuildTask to simplify creation of build tasks -
these tasks are very similar, and we instantiate MSBuildTasks in over a dozen
places, and this way we don't have to update every instantiation to check if
an MSBuildTask or a DotNetBuildTask should be created.

The end result is that code that does 'new MSBuildTask (...)' will just work
without updates for .NET projects.
2020-10-22 08:45:14 +02:00