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

9529 Коммитов

Автор SHA1 Сообщение Дата
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
Wojciech Kulik d91932dcd0
Fixed issue with code signing when using multiple AdditionalAppExtensions (#9846) 2020-10-21 09:27:45 -05:00
Rolf Bjarne Kvinge b67b85817f
[dotnet] Don't try to update the location of the dynamic libraries when we didn't fix them. (#9936)
We're already not running part of the _UpdateDynamicLibraryId task when in
offline mode, so exclude the rest as well.

Fixes these build errors in offline mode:

    C:\Program Files\dotnet\sdk\5.0.100-rc.2.20480.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(237,5): error MSB3030: Could not copy the file "obj\Debug\net5.0-ios\ios-x64\nativelibraries/libSystem.Net.Security.Native.dylib" because it was not found. [C:\code\net6-samples\HelloiOS\HelloiOS.csproj]
    C:\Program Files\dotnet\sdk\5.0.100-rc.2.20480.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(237,5): error MSB3030: Could not copy the file "obj\Debug\net5.0-ios\ios-x64\nativelibraries/libSystem.IO.Compression.Native.dylib" because it was not found. [C:\code\net6-samples\HelloiOS\HelloiOS.csproj]
    C:\Program Files\dotnet\sdk\5.0.100-rc.2.20480.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(237,5): error MSB3030: Could not copy the file "obj\Debug\net5.0-ios\ios-x64\nativelibraries/libSystem.Security.Cryptography.Native.Apple.dylib" because it was not found. [C:\code\net6-samples\HelloiOS\HelloiOS.csproj]
    C:\Program Files\dotnet\sdk\5.0.100-rc.2.20480.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(237,5): error MSB3030: Could not copy the file "obj\Debug\net5.0-ios\ios-x64\nativelibraries/libmonosgen-2.0.dylib" because it was not found. [C:\code\net6-samples\HelloiOS\HelloiOS.csproj]
    C:\Program Files\dotnet\sdk\5.0.100-rc.2.20480.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(237,5): error MSB3030: Could not copy the file "obj\Debug\net5.0-ios\ios-x64\nativelibraries/libSystem.Native.dylib" because it was not found. [C:\code\net6-samples\HelloiOS\HelloiOS.csproj]
2020-10-21 14:10:57 +02:00
Manuel de la Pena 5595ab78e7
Merge pull request #9933 from mandel-macaque/main-xcode12.1
[Main] Bring Xcode12.1 support.
2020-10-21 07:25:47 -04:00
Rolf Bjarne Kvinge 565003d3a3
[xharness] Give the MSBuild tests 30 more minutes to finish. Fixes #xamarin/maccore@2623. (#9927)
Fixes https://github.com/xamarin/maccore/issues/2326.
2020-10-21 08:56:33 +02:00
Manuel de la Pena 00e25199ae [Main] Bring Xcode12.1 support. 2020-10-20 17:55:31 -04:00
Whitney Schmidt de032018aa
add check for xcode12 (#9922) 2020-10-20 14:55:58 -04:00
Rolf Bjarne Kvinge c0c91ed89f
[dotnet] Don't run the linker nor install_name_tool when running in offline mode on Windows. (#9910)
* [dotnet] Don't run the linker nor install_name_tool when running in offline mode on Windows.

When running in offline mode on Windows, we only want to compile the C# code
(to make sure it compiles). We do this by adding an '$(IsMacEnabled)' == 'true'
checks to code that we don't want to run in offline mode.

The linker fails like this, and the easiest fix is to just disable it:

    > dotnet build .\HelloiOS\HelloiOS.csproj -p:IsMacEnabled=false
    Microsoft (R) Build Engine version 16.8.0-preview-20475-05+aed5e7ed0 for .NET
    Copyright (C) Microsoft Corporation. All rights reserved.
      Determining projects to restore...
      Restored C:\src\net5-samples\HelloiOS\HelloiOS.csproj (in 6.28 sec).
      You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
      HelloiOS -> C:\src\net5-samples\HelloiOS\bin\Debug\net5.0-ios\ios-x64\HelloiOS.dll
    ILLink : error IL1012: IL Linker has encountered an unexpected error. Please report the issue at https://github.com/mono/linker/issues [C:\src\net5-samples\HelloiOS\HelloiOS.csproj]
      Fatal error in IL Linker
      Unhandled exception. System.DllNotFoundException: Unable to load DLL '/usr/lib/libSystem.dylib' or one of its dependencies: The specified module could not be found. (0x8007007E)
         at Xamarin.Bundler.Target.realpath(String path, IntPtr zero)
         at Xamarin.Bundler.Target.GetRealPath(String path)
         at Cache.set_Location(String value)
         at Xamarin.Linker.LinkerConfiguration..ctor(String linker_file)
         at Xamarin.Linker.LinkerConfiguration.GetInstance(LinkContext context)
         at Xamarin.Linker.ConfigurationAwareStep.get_Configuration()
         at Xamarin.SetupStep.Process()
         at Mono.Linker.Steps.BaseStep.Process(LinkContext context)
         at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
         at Mono.Linker.Pipeline.Process(LinkContext context)
         at Mono.Linker.Driver.Run(ILogger customLogger)
         at Mono.Linker.Driver.Main(String[] args)

And disables install_name_tool too:

    > dotnet build .\HelloiOS\HelloiOS.csproj -p:IsMacEnabled=false -p:PublishTrimmed=false
    Xamarin.Shared.Sdk.targets(391,3): error MSB3073: The command "xcrun install_name_tool -id @executable_path/libSystem.IO.Compression.Native.dylib obj\Debug\net5.0-ios\ios-x64\nativelibraries/libSystem.IO.Compression.Native.dylib" exited with code 9009.

* Set PublishTrimmed after importing our existing Xamarin.iOS/Xamarin.Mac targets.

Because setting PublishTrimmed depends on knowing the value of IsMacEnabled,
which is set in our existing Xamarin.iOS/Xamarin.Mac targets.

Also remove the comment about having to set PublishTrimmed before including
Microsoft.NET.Sdk, because that's not accurate anymore (see
2939a6fdbc).
2020-10-20 16:25:49 +02:00
monojenkins e0ce496804
[xcode12.1] [Tests][Network] Do not really check the value, just make sure that we are called. (#9921) 2020-10-20 09:37:08 -04:00
Rolf Bjarne Kvinge 0269d25f79
[xharness] Announce to the world that we're creating UTF8 documents. (#9926)
This makes emojiis in the html report render properly 😁
2020-10-20 14:35:05 +02:00
monojenkins db2d95b155
[xcode12.1] [tests] Fix sample tests to take into account when a platform has been disabled. (#9915)
* [tests] Fix sample tests to take into account when a platform has been disabled.

* [devops] The INCLUDE_MAC/INCLUDE_IOS variables might not exist.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-10-20 08:28:23 +02:00
Manuel de la Pena 699c1f98fb
[Tests][Network] Do not really check the value, just make sure that we are called. (#9901) 2020-10-19 16:38:32 -04:00
TJ Lambert 369c3f8668
[msbuild] Updating LocalizationStringTest (#9889)
Adding a test to check a specific error code to see if the strings in other locales are translated. This test will be added to the Localization wiki in Maccore accessible to the xamarin-macios team: https://github.com/xamarin/maccore/wiki/Localization
2020-10-19 09:18:30 -05:00
Rolf Bjarne Kvinge f8b66658c5
[build] Implement support for optionally cache downloads in ~/Library/Caches/xamarin-macios. (#9894)
Set the MACIOS_CACHE_DOWNLOADS environment variable in ~/.zshrc, and enjoy
faster builds! Until your hard disk fills up...
2020-10-19 10:50:27 +02:00
Rolf Bjarne Kvinge 295938bcec
[dotnet] Add support for workloads (#9897)
* Add a `Microsoft.NET.Workload.<platform>` directory which contains
  `WorkloadManifest.json` and `WorkloadManifest.targets` required for the
  workload resolver.
   * For testing, this directory is installed into our local dotnet directory
     (`dotnet/sdk-manifests/5.0.100/Microsoft.NET.Workload.<platform>`).
* Convert `Microsoft.<platform>.Sdk` to an SDK workload pack.
* Replace `Sdk.props` with `AutoImport.props`, and include the default
  inclusion itemgroups definitions from here.
* Split default inclusion logic in two:
   * The itemgroups that import the default items has been moved into a props
     file and included from `AutoImport.props`. They're also conditioned
     based on the TargetPlatformIdentifier.
   * The rest of the logic (to enable default inclusion) is left in the
     .targets file.
* Merge several .props files into .targets files to follow the convention that
  .props files should be loaded before the main csproj, and .targets files
  after (these .props files were loaded after, so to avoid confusion the
  simplest solution was to merge their contents into the applicable .targets
  file and delete the .props files).
* Bundle the workload (WorkloadManifest.json/WorklooadManifest.targets) and
  the sdk + ref packs into an installable macOS pkg (and upload these
  packages).
* Updates tests to import `Microsoft.NET.Sdk` instead of
  `Microsoft.<platform>.Sdk` (this also required a Touch.Unit bump).
* Install the sdk + ref packs into the local dotnet directory (using symlinks
  to our on-disk nuget representation). This is required for local testing.
* Add some documentation.
* Finally fix a couple of bugs that these changes uncovered.

Ref: https://github.com/xamarin/xamarin-android/pull/5195
2020-10-19 10:41:53 +02:00
Rolf Bjarne Kvinge 0336815528 Fix typos in comments. 2020-10-19 10:38:11 +02:00
Rolf Bjarne Kvinge 1ce9fd62a4
[msbuild] Make the default value for IsMacEnabled property dependent upon the OS. (#9892)
* [msbuild] Make the default value for IsMacEnabled property dependent upon the OS.

Also make it overridable by only setting it if it's not already set.

* Use $([MSBuild]::IsOSPlatform('windows')) instead of $(OS)

The $(OS) value isn't standardized, so there's no sane check we can do against
it.
2020-10-19 08:23:17 +02:00
Rolf Bjarne Kvinge 2415902e83
[tests] Put linked source code into an external/ folder in the msbuild test projects. (#9896)
This makes it easier to navigate the projects in the IDE.
2020-10-16 16:29:59 +02:00
Rolf Bjarne Kvinge 3bfc112bb5 [jenkins] Publish our new packages. 2020-10-16 14:27:42 +02:00
Rolf Bjarne Kvinge 693f7a8728 [tests] Fix project reference. 2020-10-16 14:27:57 +02:00
Rolf Bjarne Kvinge c6c3aa28fb [dotnet] There's no need to ship template files. 2020-10-16 14:27:57 +02:00
Rolf Bjarne Kvinge e9c61f1053 [dotnet] Make default items file templated to make it platform-specific.
The template takes each platform as input, and adds a TargetPlatformIdentifier condition
to the item groups.

This also means removing Xamarin.Shared.Sdk.DefaultItems.props, and put all the generated
logic into Microsoft.<platform>.Sdk.DefaultItems.props.

We can't use an identical default items file for all four platforms, because the
file is loaded once for each platform, and if the file is identical it means it'll
get repeated four times (and everything included by default will be included four
times, ending up with build errors).
2020-10-16 14:27:57 +02:00
Rolf Bjarne Kvinge b4141ebf60 [dotnet] Move the default inclusion to Xamarin.Shared.Sdk.DefaultItems.props. 2020-10-16 14:27:57 +02:00