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

917 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 8876444586
[msbuild] Share the _*CompileSceneKitAssets targets between Xamarin.iOS and Xamarin.Mac. (#9735)
The Xamarin.iOS version is more updated, so that's the version now for both
Xamarin.iOS and Xamarin.Mac:

* The iOS version contains Inputs/Outputs (important for incremental builds).
* It doesn't use FileWrites (see e97d69b25c why
  this was removed for iOS)

Additionally define the _SceneKitCache variable for macOS as well, previously
it was only defined for iOS (I'm adding more variables than just
_SceneKitCache to macOS, most of the others will be used in in macOS in
upcoming pull requests, and this way turned out to be simplest).

And also add a new Xamarin.Mac test that exercises the CompileSceneKitAssets targets.
2020-10-01 08:37:52 +02:00
Rolf Bjarne Kvinge 94064cf3f8
[msbuild] Merge the CodesignNativeLibraries task into the Codesign task. (#9731)
Merge the CodesignNativeLibraries task into the Codesign task, since they're almost
identical (so this turns out to be a significant code reduction).

* Add a StampPath property to Codesign task, which, if set, specifies if and where
  a stamp file should be created for each signed file/directory. This replaces the
  IntermediateOutputPath property from the CodesignNativeLibraries task.
* Copy logic to detect if a file/directory needs to be resigned from the CodesignNativeLibraries
  task to the Codesign task, using any stamp files.
* Use the more descriptive error messages E0004/E0005 from the CodesignNativeLibraries
  task.
* The CodesignNativeLibraries task recursed into directories to find *.dylibs and
  *.metallib files to sign; replace this with MSBuild item group globbing.
2020-09-30 18:37:21 +02:00
Rolf Bjarne Kvinge d861a2d348
[msbuild] Pass -F <dir> -framework <framework> for user frameworks. (#9721)
This fixes a build failure in the MyiOSAppWithBinding test.
2020-09-29 15:39:44 +02:00
Rolf Bjarne Kvinge ee1a91cd5b
[msbuild] Fix setting the IsXcode8 variable. (#9723)
This got accidentially dropped here: 95d71c8ee1 (diff-f677cd73ddfb82ecd3c565024fe0029cL68)
2020-09-29 15:39:22 +02:00
Rolf Bjarne Kvinge fa58a24161
[msbuild] Port the test projects to .NET, and add a test case that compares the built .app (#9706)
Port the iOS/tvOS/watchOS msbuild test projects to .NET, and add a unit test
that builds both the old-style and new-style test projects and compares the
output in the resulting .app directories.

There are many expected differences in the apps, those will be ignored during
the comparison.

There are also numerous features that are not implemented yet in .NET, with
the corresponding adjustments in the comparison logic (they show up as TODO in
the code), these TODOs will be removed as features are implemented in the .NET
build.

There are a couple of test projects that can't be compared yet, because they
just don't build yet. Those are also TODOs.
2020-09-29 08:44:08 +02:00
Rolf Bjarne Kvinge ddde72ad2a
[msbuild] Use the ParseBundlerArguments task to parse mmp's --custom_bundle_name argument. (#9709) 2020-09-29 08:42:28 +02:00
Rolf Bjarne Kvinge 15efbe4a69
[msbuild] Share the _*CompileInterfaceDefinitions targets between Xamarin.iOS and Xamarin.Mac. (#9708)
The Xamarin.iOS version seemed more updated, so that's the version now for
both Xamarin.iOS and Xamarin.Mac.

A few differences in the Xamarin.iOS versions are:

* The _CoreCompileInterfaceDefinitions target contains Inputs/Outputs
  (important for incremental builds).
* EnableOnDemandResources is set to $(EnableOnDemandResources), not hardcoded
  to 'false' (there is no real difference right now, because
  $(EnableOnDemandResources) defaults to 'false' in Xamarin.Mac).
* It doesn't use FileWrites (see e97d69b25c why
  this was removed for iOS)
2020-09-28 09:17:50 +02:00
Manuel de la Pena 764734d20a
[Main][Xcode12] Add support for Xcode 12 2020-09-25 12:58:29 -04:00
Manuel de la Pena 591c28d882 [MSbuild] Remove duplicated target. 2020-09-24 11:36:25 -04:00
Manuel de la Pena b6b825e3d1 Fix wrong merge in tests. 2020-09-24 11:30:52 -04:00
Rolf Bjarne Kvinge 6c8564ceb8
[msbuild] Don't include Execution.cs in the test project. (#9689)
Fixes numerous compiler warnings like this:

    msbuild/xamarin-macios/tools/common/Execution.cs(35,57): warning CS0436: The type 'Execution' in 'msbuild/xamarin-macios/msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs' conflicts with the imported type 'Execution' in 'Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs'. [msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj]
    msbuild/xamarin-macios/tools/common/Execution.cs(60,15): warning CS0436: The type 'Execution' in 'msbuild/xamarin-macios/msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs' conflicts with the imported type 'Execution' in 'Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs'. [msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj]
    msbuild/xamarin-macios/tools/common/Execution.cs(170,22): warning CS0436: The type 'Execution' in 'msbuild/xamarin-macios/msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs' conflicts with the imported type 'Execution' in 'Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs'. [msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj]
    msbuild/xamarin-macios/tools/common/Execution.cs(185,22): warning CS0436: The type 'Execution' in 'msbuild/xamarin-macios/msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs' conflicts with the imported type 'Execution' in 'Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs'. [msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj]
    msbuild/xamarin-macios/tools/common/Execution.cs(157,22): warning CS0436: The type 'Execution' in 'msbuild/xamarin-macios/msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs' conflicts with the imported type 'Execution' in 'Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs'. [msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj]
    msbuild/xamarin-macios/tools/common/Execution.cs(192,22): warning CS0436: The type 'Execution' in 'msbuild/xamarin-macios/msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs' conflicts with the imported type 'Execution' in 'Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs'. [msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj]
    msbuild/xamarin-macios/tests/common/ExecutionHelper.cs(491,13): warning CS0436: The type 'Execution' in 'msbuild/xamarin-macios/msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs' conflicts with the imported type 'Execution' in 'Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs'. [msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj]
    msbuild/xamarin-macios/tests/common/ExecutionHelper.cs(505,13): warning CS0436: The type 'Execution' in 'msbuild/xamarin-macios/msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs' conflicts with the imported type 'Execution' in 'Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs'. [msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj]
    msbuild/xamarin-macios/tools/common/Execution.cs(62,39): warning CS0436: The type 'Execution' in 'msbuild/xamarin-macios/msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs' conflicts with the imported type 'Execution' in 'Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs'. [msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj]
    msbuild/xamarin-macios/tests/common/ExecutionHelper.cs(527,13): warning CS0436: The type 'Execution' in 'msbuild/xamarin-macios/msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs' conflicts with the imported type 'Execution' in 'Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs'. [msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj]
    msbuild/xamarin-macios/tools/common/Execution.cs(172,15): warning CS0436: The type 'Execution' in 'msbuild/xamarin-macios/msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs' conflicts with the imported type 'Execution' in 'Xamarin.iOS.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'msbuild/tests/Xamarin.iOS.Tasks.Tests/../../../tools/common/Execution.cs'. [msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj]
2020-09-24 08:46:02 +02:00
Manuel de la Pena dcb0c93ab0 [Xcode12] Bring xcode 12 changes into main. 2020-09-23 16:05:22 -04:00
Manuel de la Pena 3e4b4fd19e [Msbuild] Fix wrong merge that borke extensions. 2020-09-22 16:23:17 -04:00
Rolf Bjarne Kvinge a413b57af3 [msbuild] Skip the .NET/Mac build if INCLUDE_MAC is not enabled. 2020-09-21 16:53:40 +02:00
Rolf Bjarne Kvinge 569b484ba7
[msbuild/dotnet] Execute bgen using dotnet from the MSBuild tasks when in .NET mode. (#9662) 2020-09-21 08:25:27 +02:00
Manuel de la Pena eb9b690fe0 Merge xcode12 into d16-8. 2020-09-18 17:51:52 -04:00
Alex Soto bfc98f8059
[xcode12] Initial bump for Xcode 12 GM (#9644)
* [xcode12] Initial bump for Xcode 12 GM

* [tests][intro] We cannot load CoreNFC framework on iOS simulator anymore

* [tests][xtro] New Metal API are not abstract (before XAMCORE_4_0)

* [tests][intro] Fix crash when CSLocalizedString 'description' selector is called

* [tests][xtro] Add support for excluding platforms

Based on `Make.config` variables `INCLUDE_[IOS|TVOS|WATCH|MAC]`

This required moving some entries (common -> macOS) to keep the
sanitizer happy.

* [xtro] Ignore Intents watchOS differences since they will likely match iOS in the future

* Update to use Xcode 12 GMb instead of the old GM

* [tests][xtro] Remove OSLog for iOS and tvOS (changed in GM)

* [tests][msbuild] Disable FrameworkListTest based on the active/disabled platforms

* [tests][msbuild] Track new directory/file inside CoreML projects

* [mlaunch] Bump maccore and disable mlaunch if mac build is disabled

New commits in xamarin/maccore:

* xamarin/maccore@ba332d4d07 Disable mlaunch if Mac is not built (#2314)

Diff: 87a96d21c9..ba332d4d07

Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
2020-09-16 11:41:44 +02:00
Rolf Bjarne Kvinge 2c3634dbcc
[msbuild] Parse the --xml extra bundler argument in ParseBundlerArgumentsTask. (#9639)
Also add some tests.
2020-09-16 09:42:21 +02:00
Rolf Bjarne Kvinge d1db57fa74
[msbuild] Parse the --registrar extra bundler argument in ParseBundlerArgumentsTask. (#9606)
Also add some tests.
2020-09-09 15:42:33 +02:00
TJ Lambert 3f7f0425c2
nunit2 format for supported in MSBuild Tests Workaround (#9545) 2020-09-08 09:51:13 -05:00
Rolf Bjarne Kvinge f0f47b6a46
[dotnet] Make the linker always process debug symbols, and remove debugging support if we're building a release build. (#9594)
Unfortunately due to when things happen in the .NET build logic, we need to
define the DebuggerSupport property (which determines whether the app should
include debugging support or not) before importing the .NET build files. Since
we want to use the _BundlerDebug property (a.k.a. MtouchDebug/MmpDebug) to
determine if the app should include debugging support, we must figure out the
value of the _BundlerDebug property before we can define the DebuggerSupport
property. This turned out complicated, because we're currently defining
_BundlerDebug in our old-style MSBuild logic, which is imported after we
import the .NET build logic.

The end result is that we can either shuffle around a lot of MSBuild code, or
copy a few lines to set the _BundlerDebug property. Neither option makes me
very happy, but copying a few lines of code seemed the better option, so
that's what I did.

Fixes these linkall test failures in Release mode:

    LinkAll.Attributes.AttributeTest
        [FAIL] DebugAssemblyAttributes :   DebuggableAttribute
            Expected: False
            But was:  True
                at LinkAll.Attributes.AttributeTest.DebugAssemblyAttributes()

        [FAIL] DebugConstructorAttributes :   No debug attribute in release mode
            Expected: 0
            But was:  2
                at LinkAll.Attributes.AttributeTest.DebugConstructorAttributes()

        [FAIL] DebugPropertyAttributes :   DebuggerBrowsable
            Expected: False
            But was:  True
                at LinkAll.Attributes.AttributeTest.DebugPropertyAttributes()

        [FAIL] DebugTypeAttributes :   no debug attribute in release mode
            Expected: 0
            But was:  5
                at LinkAll.Attributes.AttributeTest.DebugTypeAttributes()

        [FAIL] DebuggerTypeProxy_24203 :   proxy
            Expected: null
            But was:  <System.Collections.Generic.IDictionaryDebugView`2[K,V]>
                at LinkAll.Attributes.AttributeTest.DebuggerTypeProxy_24203()
2020-09-08 14:55:34 +02:00
Rolf Bjarne Kvinge 0a1a68ab9f
[msbuild] Parse the --optimize extra bundler arguments in ParseBundlerArgumentsTask. (#9572)
Also add some tests.
2020-09-02 15:05:31 +02:00
Rolf Bjarne Kvinge e5e9ff995c
[msbuild] Stop supporting watchOS 1 apps. (#9542)
We can delete much more code, but that can be done later, to avoid the
potential for merge conflicts when merging the xcode12 branch back into main.
2020-08-28 17:11:59 +02:00
Rolf Bjarne Kvinge 3148d28b3e
[msbuild] Unify the code to define our platform-specific conditional compilation symbols. (#9524) 2020-08-27 17:47:31 +02:00
Rolf Bjarne Kvinge 62cd5311bc
[msbuild] Emit binding resources to the EmbeddedResource item group instead of ManifestResourceWithNoCulture. Fixes #3876. (#9525)
Fixes this warning:

    warning MSB9004: ManifestResourceWithNoCulture item type is deprecated. Emit EmbeddedResource items instead, with metadata WithCulture='false', Type='Resx', and optional LogicalName.

There is a slight difference with regards to the warning message: the Type
metadata is set to 'Non-Resx' instead of 'Resx' (because these resources
aren't resx files).

Fixes https://github.com/xamarin/xamarin-macios/issues/3876.
2020-08-27 17:47:21 +02:00
Rolf Bjarne Kvinge 3a0580750d
[msbuild] Share the _CollectGeneratedSources target between Xamarin.iOS and Xamarin.Mac. (#9516) 2020-08-27 08:08:03 +02:00
Rolf Bjarne Kvinge f613eacd9b
[msbuild] Parse --marshal-managed-exceptions and --marshal-objectivec-exceptions in ParseBundlerArgumentsTask. (#9493)
Also add some tests.
2020-08-26 19:03:45 +02:00
Rolf Bjarne Kvinge 020f8e2fab
[msbuild] Re-use existing logic to compress frameworks for the ObjCBindingNativeFramework items. (#9504) 2020-08-26 19:03:18 +02:00
monojenkins 3fe21bed66
[msbuild] Fix AdditionalAppExtensions entitlement logic (#9494)
- Fixes https://github.com/xamarin/xamarin-macios/issues/9458
- Defining the variable over multiple lines changes output to include incorrect newline
- Auto tests did not catch, as they don't sign on bots due to infrastructure issues.
- Was refactored _after_ manual tests and not retested

Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
2020-08-25 14:40:00 -05:00
Rolf Bjarne Kvinge d49f9d4236
[dotnet/msbuild] Add support for compiling and embedding entitlements to .NET apps. (#9489)
First move the logic to compute the linker arguments for embedding
entitlements into the executable to shared code, so that it can be used from
platform-agnostic .NET code as well.

There is one difference: the code no longer checks if we're building for the
simulator, because the 'CompiledEntitlements' variable won't be set unless
we're in the simulator, so it's no longer needed (it's also not applicable for
Xamarin.Mac).

Also call the _CompileEntitlements target from the .NET build logic, and embed
the result into the executable.

This fixes the following 10 monotouch-tests:

    MonoTouchFixtures.Security.CertificateTest
        [FAIL] GenerateKeyPairTest :   GenerateKeyPair
            Expected: Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.CertificateTest.GenerateKeyPairTest() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/CertificateTest.cs:line 597

    MonoTouchFixtures.Security.KeyChainTest
        [FAIL] AddQueryRemove_Identity :   code
            Expected: DuplicateItem or Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.KeyChainTest.AddQueryRemove_Identity() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/KeyChainTest.cs:line 49

        [FAIL] Add_Certificate :   Add_Certificate
            Expected: Success or DuplicateItem
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.KeyChainTest.Add_Certificate() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/KeyChainTest.cs:line 38

        [FAIL] CheckId :   same guid
            Expected: 00000000-0000-0000-0000-000000000000
            But was:  9c3f0fd6-5c94-46a3-8193-a9fb45209a48
                at MonoTouchFixtures.Security.KeyChainTest.CheckId() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/KeyChainTest.cs:line 171

        [FAIL] SecItemAdd_Identity :   Expected: DuplicateItem or Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.KeyChainTest.SecItemAdd_Identity() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/KeyChainTest.cs:line 91

    MonoTouchFixtures.Security.RecordTest
        [FAIL] Accessible_17579 :   Add
            Expected: Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.RecordTest.Accessible(SecAccessible access) in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 56
                at MonoTouchFixtures.Security.RecordTest.Accessible_17579() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 93

        [FAIL] AuthenticationType_17579 :   Add
            Expected: Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.RecordTest.AuthenticationType(SecAuthenticationType type) in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 174
                at MonoTouchFixtures.Security.RecordTest.AuthenticationType_17579() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 186

        [FAIL] DeskCase_83099_InmutableDictionary :   Password could not be saved to keychain
            Expected: True
            But was:  False
                at MonoTouchFixtures.Security.RecordTest.DeskCase_83099_InmutableDictionary() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 205

        [FAIL] IdentityRecordTest :   Identity added
            Expected: True
            But was:  False
                at MonoTouchFixtures.Security.RecordTest.IdentityRecordTest() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 294

        [FAIL] Protocol_17579 :   Add
            Expected: Success
            But was:  MissingEntitlement
                at MonoTouchFixtures.Security.RecordTest.Protocol(SecProtocol protocol) in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 115
                at MonoTouchFixtures.Security.RecordTest.Protocol_17579() in /Users/rolf/work/maccore/squashed-onedotnet/xamarin-macios/tests/monotouch-test/Security/RecordTest.cs:line 127
2020-08-25 19:25:32 +02:00
Rolf Bjarne Kvinge 26ad21c1ad
[msbuild] Rework how we compute the input when compressing frameworks for binding projects. (#9486)
* Use ItemGroup inside a target, since using CreateItem is deprecated.
* Use target batching to make sure the _CompressNativeFrameworkResources
  target is called once per framework.
* Also add a comment for my future self describing the whole process, because
  I'll forget this by next week.

The end result is that we will now only re-compress a framework if any file in
that particular framework changed (as opposed to re-compressing all frameworks
in a binding project when any of them changed).
2020-08-25 19:25:13 +02:00
Chris Hamons 96e3df207d
[msbuild] Fix AdditionalAppExtensions entitlement logic (#9477)
- Fixes https://github.com/xamarin/xamarin-macios/issues/9458
- Defining the variable over multiple lines changes output to include incorrect newline
- Auto tests did not catch, as they don't sign on bots due to infrastructure issues.
- Was refactored _after_ manual tests and not retested
2020-08-25 09:26:07 -05:00
Rolf Bjarne Kvinge 18ca278e88
[msbuild] Share the Pack/UnpackLibraryResources targets between Xamarin.iOS and Xamarin.Mac. (#9471)
There were 2 differences that had to be reconciled:

* The Xamarin.Mac version took 'IntermediateOutputPath' as the intermediate
  output path, while the Xamarin.iOS version used
  'DeviceSpecificIntermediateOutputPath'.
  'DeviceSpecificIntermediateOutputPath' is defined to be
  'IntermediateOutputPath' for Xamarin.Mac, so make the shared version use
  'DeviceSpecificIntermediateOutputPath', since that works in both cases.

* The Xamarin.Mac version was writing the output of PackLibraryResources to
  the FileWrites item group. This was removed on purpose from the Xamarin.iOS
  version in e97d69b25c, so it seemed best to
  leave it out in the shared version as well.

Also re-use the _EmbeddedResourcePrefix variable to determine the resource prefix.
2020-08-25 10:42:33 +02:00
Rolf Bjarne Kvinge 622656acc3
[msbuild] Share the _CompressNativeFrameworkResources/_CompressFrameworks target between Xamarin.iOS and Xamarin.Mac. (#9461) 2020-08-25 10:41:50 +02:00
Rolf Bjarne Kvinge c21ae4412a
[dotnet] It's time to start signing apps. (#9469)
Also make sure that _CompileToNative never runs in .NET mode (some of the
signing targets has _CompileToNative as a dependency, but _CompileToNative
must never be run when in .NET mode).
2020-08-24 17:54:07 +02:00
Rolf Bjarne Kvinge d3ea2c3a81
[msbuild] Share the _CollectNativeFrameworkResources target between Xamarin.iOS and Xamarin.Mac. (#9450) 2020-08-24 08:21:46 +02:00
Rolf Bjarne Kvinge 49511491c9
[msbuild] Set ResolveAssemblyConflicts once. (#9441)
No need to set it in every file, when we have one file that rules them all.
2020-08-21 18:38:57 +02:00
Rolf Bjarne Kvinge 587ec0dd63
[msbuild] Share the _PrepareNativeReferences target between Xamarin.iOS and Xamarin.Mac. (#9442) 2020-08-21 18:24:39 +02:00
Rolf Bjarne Kvinge f3048eece5
[msbuild] Share three stub targets for Windows between Xamarin.iOS and Xamarin.Mac. (#9443)
These only apply to Xamarin.iOS right now, since they're Windows-specific (and
we don't support Xamarin.Mac binding projects on Windows), but if we ever do
end up supporting binding projects for Xamarin.Mac on Windows, we'll need
these targets there, so just make them shared code.
2020-08-21 18:10:32 +02:00
Rolf Bjarne Kvinge 86003f37c9
[msbuild] Share the IsMacEnabled and MtouchTargetsEnabled definitions between Xamarin.iOS and Xamarin.Mac. (#9439) 2020-08-21 15:01:30 +02:00
Rolf Bjarne Kvinge 7d9666c96e
[msbuild] Add a Xamarin.Shared.ObjCBinding.targets file for shared binding code between Xamarin.iOS and Xamarin.Mac. (#9437)
Add a Xamarin.Shared.ObjCBinding.targets file for shared binding code between
Xamarin.iOS and Xamarin.Mac and start sharing some of the binding code.
2020-08-21 14:55:00 +02:00
Rolf Bjarne Kvinge 4374c5f06e
[msbuild] Remove unnecessary logic to not re-import props files. (#9418)
Props files should only be imported in one place, and never by the projects
themselves, so re-importing props files shouldn't be a problem.
2020-08-21 10:13:40 +02:00
Rolf Bjarne Kvinge 9e6ecc8e1a
[msbuild] Share the AllowedReferenceRelatedFileExtensions property override. (#9417) 2020-08-21 10:13:26 +02:00
Rolf Bjarne Kvinge 4d56f288e6
[msbuild] Remove the _AssignBundleResourceNames target, it's not used anymore. (#9414)
It was used in Classic code, and that was removed some time ago (c4b5fa5f44).
2020-08-21 10:13:12 +02:00
Rolf Bjarne Kvinge 9a4f5cf388
[dotnet] Turn the linker off by default for simulator builds. (#9403)
This becomes a bit complicated because we have to wait to determine the default value
for the linker until we know if we're building for the simulator or not (which happens
in the _DetectSdkLocations target).
2020-08-20 14:26:43 +02:00
Rolf Bjarne Kvinge 61b3cec57a [msbuild] Add support for passing -force_load to the native linker in the LinkNativeCode task. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 641a3fb4fc [msbuild] Add support for passing LinkerFlags to the LinkNativeCode task 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 43d234de52 [tests] Add a macOS version of the bindings-test project for .NET
This required disabling some Xamarin.Mac-specific binding code in .NET mode.
2020-08-10 16:12:42 +02:00
Rolf Bjarne Kvinge 4e1b571ab6 [msbuild] Pass the path to the binding attribute assembly to bgen. 2020-08-10 16:12:41 +02:00
Rolf Bjarne Kvinge df69755fb0 [msbuild] Create the output directory for generated binding sources. 2020-08-10 16:12:41 +02:00
Rolf Bjarne Kvinge d5b91781dd [msbuild] Don't pass a reference to mscorlib.dll to bgen.
In .NET there's no mscorlib.dll next to the platform assembly. bgen will find it
anyway when needed if it's not passed explicitly, so just don't pass it.
2020-08-10 16:12:41 +02:00
Rolf Bjarne Kvinge d96827cd89
[msbuild] Share the _CompileEntitlements target. (#9323)
Use two separate output variables (EntitlementsInExecutable/EntitlementsInSignature)
instead of using the same output variable for two different purposes. This makes
the code more self-explanatory.

Also move the simulator check to the C# code, that way it's easier to re-use elsewhere.

* [msbuild] Share the _CompileEntitlements task.

* [msbuild] Create the same class hierarchy for Xamarin.Mac and Xamarin.iOS for the CompileEntitlements task.

    CompileEntitlementsTaskBase
    └─── iOS/CompileEntitlementsTaskCore
    │    └─── iOS/CompileEntitlements
    └─── Mac/CompileEntitlementsTaskCore
         └─── Mac/CompileEntitlements

This also means we can remove a known failure in the list of MSBuild tasks that don't
conform to our 'no code in final task implementation' requirements.
2020-08-10 13:55:54 +02:00
monojenkins 9732d10b3b
Make sure to Uri escape paths (#9311)
If the path to the project or compiled app has spaces, then the URI
that is generated for the on-demand resources in the
AssetPackManifestTemplate.plist file is invalid

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

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2020-08-07 14:50:03 -04:00
Rolf Bjarne Kvinge 06fec85900
[msbuild] Move Xamarin.iOS' implementation of the PrepareResourceRules task to Xamarin.MacDev.Tasks. (#9318) 2020-08-07 14:54:38 +02:00
Rolf Bjarne Kvinge 4f8afa575d
[msbuild] Create a few '_*DependsOn' variables that specifies depend targets. (#9305)
The .NET logic will inject an additional dependencies in these variables.
2020-08-07 14:53:49 +02:00
Rolf Bjarne Kvinge 9be9a9a4b6
[msbuild] Compute variables for where the platform assembly is, and the platform assembly name. (#9304)
This will be more useful later, because these variables will be used in more places
in the .NET code.
2020-08-07 14:53:30 +02:00
Rolf Bjarne Kvinge fd5d82da6b
[msbuild] Pass the full path to the output file to the native linker. (#9295)
This makes it easier to copy-paste commands to debug them.
2020-08-07 14:53:15 +02:00
Rolf Bjarne Kvinge be095c5a26
[msbuild] Make sure to restore the binding project before trying to build it. (#9288)
Fixes numerous build failures like this:

    The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
    The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
    The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
    The type or namespace name 'TestFixtureAttribute' could not be found (are you missing a using directive or an assembly reference?)
    The type or namespace name 'TestFixtureAttribute' could not be found (are you missing a using directive or an assembly reference?)
2020-08-06 16:02:12 +02:00
Rolf Bjarne Kvinge 58e10cbf39
[msbuild] Fix arguments to error logging for GetMinimumOSVersionTask. (#9248)
The filename arguments to the error logging must be strings, otherwise the
wrong logging overload is picked, and the resulting error message makes no
sense.
2020-07-31 15:21:13 +02:00
Rolf Bjarne Kvinge d9295b12ef
[msbuild] Default 'BundlerDebug' to 'true' if no other option is set and we're building for a 'Debug' configuration. (#9247)
It's somewhat of a breaking change, since previously Xamarin.Mac would default
to 'false' if no value was set. It should be exceedingly rare though, since
it's set in all the template projects.

It makes the behavior a bit more intuitive for .NET projects, since then the
values might not be set because of the simplified project files.
2020-07-31 15:21:02 +02:00
monojenkins 6f5adef8ef
Make sure to Uri escape paths (#9212)
If the path to the project or compiled app has spaces, then the URI
that is generated for the on-demand resources in the
AssetPackManifestTemplate.plist file is invalid

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

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
2020-07-29 08:07:50 +02:00
Matthew Leibowitz 6416d06407
Make sure to Uri escape paths (#9198)
If the path to the project or compiled app has spaces, then the URI
that is generated for the on-demand resources in the
AssetPackManifestTemplate.plist file is invalid

Fixes https://github.com/xamarin/xamarin-macios/issues/8452
2020-07-29 08:07:37 +02:00
Rolf Bjarne Kvinge f6aaa6622e
[xharness] Only have a single project per directory (#9149)
We're starting to use NuGet (packages) more and more, and NuGet stores
information about any package references in the bin/obj directories. This
means that if a directory has multiple project files, NuGet will get quite
confused because it will use the wrong package information half the time.

There are steps that can be taken to make NuGet write its package information
in different directories, but this becomes quite cumbersome to keep
up-to-date, and it's confusing when it breaks. It's much easier to just have a
blanket rule that there shouldn't be more than one project per directory.

However, it did require quite a few changes to xharness to fix assumptions
about where files are located.
2020-07-28 17:31:56 +02:00
Rolf Bjarne Kvinge 84a6b63ffe
[msbuild] Fix automatic stripping of release builds by using the correct variable. (#9202) 2020-07-28 09:12:37 +02:00
Chris Hamons b101d7e8b9
Add support for arbitrary extensions to be bundled in XI/XM apps (#9048) (#9107)
- This commit adds a hook, "AdditionalAppExtensions", to the msbuild to allow
extensions written in other languages, such as Swift, to be embedded and signed in an
Xamarin App bundle easily.
- Example:
<AdditionalAppExtensions Include="$(MSBuildProjectDirectory)/../../native">
	<Name>NativeTodayExtension</Name>
	<BuildOutput Condition="'$(Platform)' == 'iPhone'">build/Debug-iphoneos</BuildOutput>
	<BuildOutput Condition="'$(Platform)' == 'iPhoneSimulator'">build/Debug-iphonesimulator</BuildOutput>
</AdditionalAppExtensions>
2020-07-27 09:27:19 -05:00
Rolf Bjarne Kvinge b5a1251592 Merge remote-tracking branch 'origin/main' into xharness-a-directory-per-project 2020-07-27 11:20:16 +02:00
monojenkins 25b8cbe22b
[msbuild] Makes the xcarchive folder name culture independent (#9175)
Fixes https://developercommunity.visualstudio.com/content/problem/934833/xamarinforms-cant-create-archive-for-ios.html

Depending on the default language of the running OS this could cause translating AM/PM to symbols that are not supported on folder names on Windows.

For instance, the value of `timestamp` without this change for an user that sets Chinese as it's main language would be `8-18-15 1.31 下午`, where `下午` represent PM.

Co-authored-by: emaf <ema@xamarin.com>
2020-07-24 09:15:47 +02:00
Emanuel Fernandez Dell'Oca 62ab588d04
[msbuild] Makes the xcarchive folder name culture independent (#9174)
Fixes https://developercommunity.visualstudio.com/content/problem/934833/xamarinforms-cant-create-archive-for-ios.html

Depending on the default language of the running OS this could cause translating AM/PM to symbols that are not supported on folder names on Windows.

For instance, the value of `timestamp` without this change for an user that sets Chinese as it's main language would be `8-18-15 1.31 下午`, where `下午` represent PM.
2020-07-24 09:15:17 +02:00
Rolf Bjarne Kvinge 8b9bfe2877
[dotnet] Add Verbosity to the linker configuration. (#9169) 2020-07-23 18:07:05 +02:00
Rolf Bjarne Kvinge 4a2236f7e0 Merge remote-tracking branch 'origin/main' into xharness-a-directory-per-project 2020-07-23 15:37:06 +02:00
Rolf Bjarne Kvinge 8ecc47d088
[msbuild] Share the logic to implicitly include netstandard.dll in the build. (#9146)
In addition to the obvious benefit of reducing code duplication, this also
means that implicit inclusion of netstandard.dll works for binding projects as
well.

The existing implementations were slightly different between Xamarin.iOS and
Xamarin.Mac, so I tried to figure out the best merging strategy based on git
history and looking at the original implementation of this code in MSBuild. I
tried to keep close to the original implementation whenever I couldn't find a
good reason to do otherwise.
2020-07-22 14:57:35 +02:00
Rolf Bjarne Kvinge bdada6e21b Merge remote-tracking branch 'origin/main' into xharness-a-directory-per-project 2020-07-22 10:36:23 +02:00
Rolf Bjarne Kvinge 92a9aacbd3 [msbuild][tests] Adjust the BindingProject test according to the relocation of bindings-test.csproj.
Also remove the BindingProject.FrameworkTest, it's 100% identical to
BindingProject.BuildTest, and thus redundant.
2020-07-22 09:07:22 +02:00
monojenkins ffa84c9a1f
[msbuild] Avoids running GetMinimumOSVersion if no Mac is connected (#9144)
`GetMinimumOSVersion` should not be run if there's no Mac available because it depends on `_DetectSdkLocations` to calculate the value of `_SdkVersion`, and this will only happen if there's a Mac connected. This change fixes offline builds (plain IL builds) and Hot Restart builds on Windows.

Co-authored-by: emaf <ema@xamarin.com>
2020-07-22 08:27:14 +02:00
emaf 72b8de060b [msbuild] Avoids running GetMinimumOSVersion if no Mac is connected
`GetMinimumOSVersion` should not be run if there's no Mac available because it depends on `_DetectSdkLocations` to calculate the value of `_SdkVersion`, and this will only happen if there's a Mac connected. This change fixes offline builds (plain IL builds) and Hot Restart builds on Windows.
2020-07-21 17:03:06 -03:00
monojenkins 6bbcfd4c78
[main][msbuild] Changes GetMinimumOSVersionTaskBase to use ITaskItem for inputs (#9135)
* [msbuild] Changes GetMinimumOSVersionTaskBase to use ITaskItem for inputs

From Visual Studio we need the input files to be  instead of plain strings to identify the files that need to be copied to the Mac

* Adds null check for AppManifest in GetMinimumOSVersionTaskBase

Co-authored-by: emaf <ema@xamarin.com>
2020-07-21 08:31:28 +02:00
Emanuel Fernandez Dell'Oca 914cdaa26a
[d16-8][msbuild] Changes GetMinimumOSVersionTaskBase to use ITaskItem for inputs (#9134)
* [msbuild] Changes GetMinimumOSVersionTaskBase to use ITaskItem for inputs

From Visual Studio we need the input files to be  instead of plain strings to identify the files that need to be copied to the Mac

* Adds null check for AppManifest in GetMinimumOSVersionTaskBase
2020-07-21 08:29:59 +02:00
Chris Hamons 5657a63539
Add support for arbitrary extensions to be bundled in XI/XM apps (#9048)
- This commit adds a hook, "AdditionalAppExtensions", to the msbuild to allow
extensions written in other languages, such as Swift, to be embedded and signed in an
Xamarin App bundle easily.
- Example:
<AdditionalAppExtensions Include="$(MSBuildProjectDirectory)/../../native">
	<Name>NativeTodayExtension</Name>
	<BuildOutput Condition="'$(Platform)' == 'iPhone'">build/Debug-iphoneos</BuildOutput>
	<BuildOutput Condition="'$(Platform)' == 'iPhoneSimulator'">build/Debug-iphonesimulator</BuildOutput>
</AdditionalAppExtensions>
2020-07-16 10:13:15 -05:00
monojenkins 22ff73b52c
[msbuild] Allow overriding CompileAppManifestTaskBase Execute method (#9090)
If the Execute method of a task is sealed the Windows side tasks won't be able to "inject" the code that executes the tasks remotely.

Co-authored-by: emaf <ema@xamarin.com>
2020-07-15 16:50:48 +02:00
Rolf Bjarne Kvinge 0bf816ab47
Add AutoFill CredentialProvider NSExtensionPoint support (#9079)
* Fix unrecognized extension build warning for credential providers

* Bump Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@af50d97 Add AutoFill CredentialProvider NSExtensionPoint support (#75) (#77)

Diff: 7e9075cab0..af50d97218

* Add IDE deployment target for credential provider

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

Co-authored-by: kiddailey <kiddailey@users.noreply.github.com>
2020-07-15 09:00:16 +02:00
Rolf Bjarne Kvinge fb0615d065
Add AutoFill CredentialProvider NSExtensionPoint support (#9078)
* Fix unrecognized extension build warning for credential providers

* Bump Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@8208733 Add AutoFill CredentialProvider NSExtensionPoint support (#75) (#76)

Diff: a1bc6f39b3..8208733cd6

* Add IDE deployment target for credential provider

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>

Co-authored-by: kiddailey <kiddailey@users.noreply.github.com>
2020-07-15 08:59:59 +02:00
Emanuel Fernandez Dell'Oca f6391e7522
[msbuild] Allow overriding CompileAppManifestTaskBase Execute method (#9088)
If the Execute method of a task is sealed the Windows side tasks won't be able to "inject" the code that executes the tasks remotely.
2020-07-15 07:56:05 +02:00
Matthew Leibowitz b70d25d011
Include assembly refs in _CompileToNative Inputs (#9071)
* Include assembly refs in _CompileToNative Inputs

Fixes #9014

* Unify with iOS

Sort of match this: 64c63279b3/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets (L573-L595)

* Update Xamarin.Mac.Common.targets
2020-07-14 14:54:26 +02:00
Rolf Bjarne Kvinge b46aae7fd6
[msbuild] Make the ParseExtraMtouchArgs task platform-agnostic, and share it between Xamarin.iOS and Xamarin.Mac. (#9061)
* Change the parsing code slightly, to make it easier to parse other arguments
  (coming soon).
* Add the parsing task to Xamarin.Mac projects, and use it there as well. The
  parsed result isn't used yet, but it will be soon.
* Unify a few related MSBuild properties (MtouchNoSymbolStrip and
  MtouchNoDSymUtil).
2020-07-13 14:56:34 +02:00
kiddailey 97d09a7b24
Add AutoFill CredentialProvider NSExtensionPoint support (#9030)
* Fix unrecognized extension build warning for credential providers

* Bump Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@5e08f5f Add AutoFill CredentialProvider NSExtensionPoint support (#75)

Diff: a1bc6f39b3..5e08f5f2fd

* Add IDE deployment target for credential provider

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-07-13 14:50:23 +02:00
Rolf Bjarne Kvinge e193ed7316
[msbuild] Unify all the UsingTask statements. (#8998)
Some of these have been duplicated across various targets files, and when
adding a new task it's annoying to forget to add it somewhere.

So just have them all in the same place, so that they're loaded in every file.

There are still duplicates between the iOS and Mac tasks, but those will be
unified in a later PR.
2020-07-07 15:52:06 +02:00
Rolf Bjarne Kvinge ac36305a2d
[msbuild] Unify the _GenerateBindings target and a few properties related to binding projects. (#8997) 2020-07-07 15:46:23 +02:00
Rolf Bjarne Kvinge 4e2d612dae
[msbuild] Unify XamarinMacFrameworkRoot and MonoTouchSdkRoot into _XamarinSdkRoot. (#8995) 2020-07-07 15:45:42 +02:00
Rolf Bjarne Kvinge 6f6b8e281b Merge remote-tracking branch 'origin/main' into dotnet-xharness-introspection 2020-07-03 11:12:50 +02:00
Rolf Bjarne Kvinge 8d7cd46652
[msbuild] Share a few binding variables: BaseLibDllPath, BTouchToolPath and BTouchToolExe. (#8988)
Also switch to invoking bgen instead of the btouch-native/btv/bwatch wrapper
scripts, since the wrapper scripts just call bgen with an additional
--target-framework argument, which our BTouch task already does anyway, which
means it's not necessary to call the wrapper scripts anymore.

This also required:

* Moving the code to detect which Xamarin.Mac profile we're building for into
  Xamarin.Shared.props, since the binding variable logic need to know which
  Xamarin.Mac profile we're building for.

* Setting IsBindingProject property earlier in the build process, to make sure
  it's set before importing Xamarin.Shared.props.
2020-07-03 11:01:01 +02:00
Rolf Bjarne Kvinge 4eff2c3700
[msbuild] Unify the logic to copy bundle resources to the app. (#8987)
* For Xamarin.Mac, this means using the _ComputeBundleResourceOutputPaths and
  _CopyResourcesToBundle targets from Xamarin.iOS instead of the
  _CopyContentToBundle target (which is now unused and thus removed).

* Adapt the Xamarin.iOS logic (now shared) to handle the fact that the
  resources shouldn't always go into the root appbundle directory (since they
  go into Contents/Resources/ for macOS apps), by using the
  '_AppResourcesPath' variable to specify just this.

Once upon a time the Xamarin.iOS logic was identical to the Xamarin.Mac logic,
but then we implemented support for asset packs
(a98693f07e)
and the code diverged. This means that unifying the logic again is a step
towards making asset packs work for Xamarin.Mac apps.
2020-07-03 11:00:36 +02:00
Rolf Bjarne Kvinge 4ed68336d7
[msbuild] Share the MSBuild logic for CollectBundleResources and a few related properties. (#8983)
* [msbuild] Share the MSBuild logic for CollectBundleResources and a few related properties.

* [msbuild] Fix/unify more resource collection code.

* Remove the _CollectBundleResources target for Xamarin.iOS binding projects,
  we now have a single one for all project types.
* Add an IsBindingProject property to distinguish binding projects from other
  projects.
* Use the IsBindingProject to only depend on the other _Compile<ResourceType>
  targets when we're not building a binding project (which seems to be the
  reason why the _CollectBundleResources target was duplicated between normal
  projects and binding projects for both Xamarin.iOS and Xamarin.Mac: the
  binding project version didn't have any dependencies).
2020-07-01 20:13:05 +02:00
Rolf Bjarne Kvinge 7e4813b8c6 [dotnet] Use the same MSBuild items to specify both weakly and normally linked frameworks.
This is a slight performance improvements when loading the list of frameworks
the managed linker produces, because the MSBuild logic can only load one item
group per file, and if we use two differently named item groups, we'd have to
store weakly and normally linked frameworks in different files.

This way we can store both types of frameworks in a single file.
2020-06-30 19:01:07 +02:00
Sebastien Pouliot f427b5e91d
[xcode12] Bump for beta 1 (#8935)
Known issues https://github.com/xamarin/xamarin-macios/issues/8943
2020-06-26 14:02:44 -04:00
monojenkins b18b4dcdca
[msbuild] Dispose the AssemblyBuilder in the UnpackLibraryResource when done with it. (#8949)
This will ensure the file isn't kept open until the GC runs, and then
sometimes it can prevent other tasks or targets from opening it if the GC
hasn't run.

Fixes this problem:

    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 1 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 2 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 3 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 4 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 5 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 6 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 7 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 8 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 9 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 10 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): error MSB3027: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Exceeded retry count of 10. Failed.
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): error MSB3021: Unable to copy file "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll

Fixes https://github.com/xamarin/maccore/issues/2137.
Fixes https://github.com/xamarin/xamarin-macios/issues/8940.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-06-25 20:58:11 -04:00
Rolf Bjarne Kvinge e775850489
[msbuild] Dispose the AssemblyBuilder in the UnpackLibraryResource when done with it. (#8941)
This will ensure the file isn't kept open until the GC runs, and then
sometimes it can prevent other tasks or targets from opening it if the GC
hasn't run.

Fixes this problem:

    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 1 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 2 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 3 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 4 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 5 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 6 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 7 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 8 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 9 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): warning MSB3026: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Beginning retry 10 in 1000ms. Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): error MSB3027: Could not copy "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Exceeded retry count of 10. Failed.
    /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(4203,5): error MSB3021: Unable to copy file "obj/Debug/Fantas.dll" to "../../../lib/Debug/MonoGame/xamarinios/Fantas.dll". Sharing violation on path [...]/lib/Debug/MonoGame/xamarinios/Fantas.dll

Fixes https://github.com/xamarin/maccore/issues/2137.
Fixes https://github.com/xamarin/xamarin-macios/issues/8940.
2020-06-25 15:23:10 +02:00
Rolf Bjarne Kvinge 085a74286b [dotnet] Add an @executable_path rpath for the main executable. 2020-06-19 18:07:00 +02:00
Rolf Bjarne Kvinge 8a65236c4d [dotnet] Link the executable with libxamarin. 2020-06-19 18:06:59 +02:00
Rolf Bjarne Kvinge c53e96f48d [dotnet] Figure out where the xamarin include directory is, and pass it as an include directory when compiling the main code. 2020-06-19 18:06:59 +02:00
Rolf Bjarne Kvinge 53c285c097
Merge pull request #8887 from rolfbjarne/dotnet-linker-generate-main
[dotnet] Generate a main function, and use it to compile the main executable.
2020-06-19 17:45:05 +02:00
Rolf Bjarne Kvinge b39bd0e420
[msbuild] Make sure all the Base/Core tasks are abstract. (#8888)
Also add a cecil test ensure our leaf MSBuild tasks don't have code.
2020-06-19 17:40:18 +02:00
Rolf Bjarne Kvinge a6d9678260 [dotnet] Add a LinkNativeCode task and link the output from the CompileNativeCode task into a main executable. 2020-06-18 15:57:02 +02:00
Rolf Bjarne Kvinge 8594af3b2c [dotnet] Add a CompileNativeCode task and compile the generated main code into object files. 2020-06-18 15:57:01 +02:00
Rolf Bjarne Kvinge 6bc03419fa
[msbuild] Unify the CompileAppManifest target. (#8875)
Also rework the class hierarchy a little bit, so that Xamarin.iOS and
Xamarin.Mac are identical:

    CompileAppManifestTaskBase
    └─── iOS/CompileAppManifestTaskCore
    │    └─── iOS/CompileAppManifest
    └─── Mac/CompileAppManifestTaskCore
        │    └─── Mac/CompileAppManifest
2020-06-18 15:46:45 +02:00
Rolf Bjarne Kvinge d8cd95d4e1
[msbuild] Split out min version argument calculation from MetalTask. (#8876) 2020-06-18 15:17:33 +02:00
Rolf Bjarne Kvinge c3bcfac582
Unify code for executing processes. (#8848)
* Create a simple Xamarin.Utils.Execution class that can handle all our
  process execution needs:
    * Captures or streams stdout/stderr (in UTF8).
    * Supports async
    * Supports a timeout
    * Does not depend on any other source file we have, only uses BCL API.
* Have the execution helper classes from mtouch/mmp
  (Xamarin.BundlerDriver.RunCommand) and the tests
  (Xamarin.Tests.ExecutionHelper) use this new class.
* Some simplifications were made:
    * All API that took a string array for the environment now takes a
      Dictionary<string, string>.
    * The Driver.RunCommand methods were split out to a separate file. This
      file also contains a Verbosity field, which is conditioned on not being
      in mtouch nor mmp, which makes including this file from other projects
      simpler (such as bgen - in particular bgen was modified to use this
      Verbosity field instead of its own).
2020-06-18 12:34:07 +02:00
Rolf Bjarne Kvinge 6ced972a68
[msbuild] Add a GetMinimumOSVersion target that reads the app manifest and outputs the MinimumOSVersion. (#8858)
This makes it possible for several other tasks to take the MinimumOSVersion as
direct input, instead of the app manifest's path. Previously the app manifest
(Info.plist) was loaded and parsed in each task, slightly differently in each
place, and in addition there are differences between macOS and other
platforms, which made it even worse. This code refactoring also made it
possible to remove an error code which wasn't necessary anymore.

This task also computes the default MinimumOSVersion if none is specified in
the app manifest.

There is one breaking change: a library project could previously specify an
inexistent Info.plist, and it would build fine. This will now result in a
"Error loading 'Info.plist': File not found" error. This is trivial to fix:
just remove the Info.plist from the project file (or an alternative solution
could be to condition the inclusion of the Info.plist in the project file on
the existence of the Info.plist).

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@a1bc6f3 [Xamarin.MacDev] Split IAppleSdkVersion.TryParse in two methods. (#73)

Diff: 45c5a680e2..a1bc6f39b3
2020-06-16 17:40:04 +02:00
Rolf Bjarne Kvinge fbdd1b8e3f
[msbuild] Share the DeviceSpecificIntermediateOutputPath property. (#8854)
* [msbuild] Share the DeviceSpecificIntermediateOutputPath property.

We don't technically need this value for Xamarin.Mac, but many of the targets
that can be shared need to use this for Xamarin.iOS, so set this value for
Xamarin.Mac as well. It will always be the default IntermediateOutputPath for
Xamarin.Mac, while for Xamarin.iOS it might be changed in
_ComputeTargetArchitectures.

* [msbuild] Remove usage in Xamarin.Mac of a variable that was always empty in the past.
2020-06-16 17:39:47 +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 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
monojenkins a34eba7e61
[d16-7] [src] Remove the remaining Classic code. (#8820)
* [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] Update project files to remove XAMCORE_2_0 and __UNIFIED__.

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

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

* [d16-7] [registrar] Remove Classic Code.

* Bump Touch.Unit.

New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@358b283 Remove code to be compatible with MonoTouch (Classic Xamarin.iOS). (#59)

Diff: 9db795d50d..358b283b64

* [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)

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-06-11 19:25:18 +02: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 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 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 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
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 7369b5edfb
[msbuild] Unify _RequireCodeSigning and EnableCodeSigning into _RequireCodeSigning. (#8743) 2020-06-04 15:17:32 +02:00
Rolf Bjarne Kvinge f7e95a0fd5
[msbuild] Share _ComputeTargetArchitectures and use the output variables for both Xamarin.iOS and Xamarin.Mac. (#8751) 2020-06-04 15:00:28 +02:00
Rolf Bjarne Kvinge 7c1e51b5eb
[msbuild] Unify the _DetectAppManifest target. (#8745)
There's one difference for Xamarin.Mac library projects: they'll now have the
ability to use an Info.plist to specify a minimum OS version that will be used
when compiling storyboards and other compilable files.

This is the way it's worked for Xamarin.iOS projects for a long time.
2020-06-04 09:14:58 +02:00
Rolf Bjarne Kvinge dbe9d43c7c
[msbuild] Unify MtouchSdkVersion and MacOSXSdkVersion into _SdkVersion. (#8734) 2020-06-03 19:24:36 +02:00
Rolf Bjarne Kvinge 3f44925f23
[msbuild] Share the _ComputeTargetFrameworkMoniker target. (#8739) 2020-06-03 19:24:09 +02:00
Jonathan Peppers 4e37ecf65c
[msbuild] missing localization comments - part 3 (#8721)
Fixes: https://github.com/xamarin/xamarin-macios/issues/8468

Added missing `<comment/>` fields for:

* BI1033
* BI1077
* MM2007
* MT0073
* MT0074
* MT0112_c
* MT0113_i
* MT4146
* MT4162

I had to split up the `MT4162` error message, introducing:

* `Errors.MT4162_BaseType` - a base type of
* `Errors.MT4162_Parameter` - a parameter in
* `Errors.MT4162_ReturnType` - a return type in
* `Errors.MT4162_PropertyType` - the property type of

This also removed an argument passed into `string.Format`.
2020-06-02 13:57:11 -05:00
Rolf Bjarne Kvinge 375118331a
[msbuild] Unify XamMacResourcePrefix and IPhoneResourcePrefix into _ResourcePrefix. (#8726) 2020-06-02 16:41:44 +02:00
Rolf Bjarne Kvinge bf34d86323
[msbuild] Add a Xamarin.Shared.props. (#8711)
It's empty for now, but soon enough it will start getting shared
Xamarin.iOS/Xamarin.Mac code.
2020-06-02 14:26:25 +02:00
Rolf Bjarne Kvinge 2fdd7451b9
[dotnet] Inject logic into the Build target to put resolved assemblies and dylibs into the .app. (#8715)
Inject logic into the Build target to start creating the app bundle:

* Make sure the pre-existing list of targets (CreateAppBundleDependsOn) to
  create an app bundle is not evaluated.
* Create a new CreateAppBundleDependsOn variable that contains the new targets
  we want to run to create the app bundle for net5.
* Call the built-in publishing targets to copy files to the publish directory
  (ComputeFilesToPublish / CopyFilesToPublishDirectory).
* Add a target that rewrites the publish directory for assemblies and dylibs
  to put them in the app bundle instead.
2020-06-01 17:52:19 +02:00
Rolf Bjarne Kvinge c9d6d4ca13
[msbuild] Share some of the code signing targets between Xamarin.Mac and Xamarin.iOS. (#8710) 2020-06-01 10:23:17 +02:00
Rolf Bjarne Kvinge aec9c93bee
[dotnet] Add tests for our various platforms. (#8708)
* [tests] Add a unit test project to test our net5 support.

* [tests] Fix clearing environment variables when launching processes.

* [tests] Add net5 macOS test app.

* [tests] Add net5 tvOS test app.

* [tests] Add net5 watchOS test app.

* [msbuild] Exclude CreateAppBundleDependsOn from net5 builds as well.

* [msbuild] We're not required to know the signing identity to figure out the app extension bundle name.
2020-05-29 17:58:34 +02:00
Rolf Bjarne Kvinge bebbeb18a3
[msbuild] Improve xharness and makefiles make it easier to run both iOS and Mac MSBuild tests. (#8709)
It even looks like running the Xamarin.Mac MSBuild tests from the command line
has never worked... so fix that as well.
2020-05-29 17:50:46 +02:00
Rolf Bjarne Kvinge 2ffe11cb9e
[msbuild] Share the _CreateAppBundle task between Xamarin.Mac and Xamarin.iOS. (#8694)
There is a difference for Xamarin.Mac: the task will not be executed anymore
if IsAppDistribution is set to true. Given that IsAppDistribution is not used
in Xamarin.Mac projects, this is likely a rather uncommon case, and the
potential for breaking behavior is outweighed by the advantage of having the
same behavior for Xamarin.iOS and Xamarin.Mac.
2020-05-28 08:34:11 +02:00
Rolf Bjarne Kvinge 9fcda89ead [msbuild] Fix typo in the watchOS logic. 2020-05-27 10:23:52 +02:00
Rolf Bjarne Kvinge 4f2d580426 [msbuild] Don't touch AssemblySearchPaths when building with net5.
We're supposed to resolve assemblies the standard/system way.
2020-05-26 14:49:31 +02:00
Rolf Bjarne Kvinge 91aa4e733a [msbuild] Don't include System.Drawing.Common.dll when building using net5.
There's no System.Drawing.Common.dll in net5.
2020-05-26 14:49:31 +02:00
Rolf Bjarne Kvinge 6e48c5a83a [msbuild] Don't import Microsoft.CSharp.targets if we're building using net5.
It's already imported.
2020-05-26 14:49:31 +02:00
Rolf Bjarne Kvinge cf1f8af55a [msbuild] Don't inject our existing build logic into the *DependsOn variables when building using net5. 2020-05-26 14:49:31 +02:00
Rolf Bjarne Kvinge 6920817232 [dotnet/msbuild] Add existing targets files to the net5 NuGets. 2020-05-26 14:49:31 +02:00
Rolf Bjarne Kvinge 7c61734bd8
[msbuild] Fix pdb generation, ship the pdb and improve build logic. (#8672)
* The ILRepack package uses a 4-year old version of Mono.Cecil, which does not
  support portable pdbs. Work is in progress to use a newer version of
  Mono.Cecil (https://github.com/gluck/il-repack/pull/236), but this is taking
  some time (the PR is over a year old). In the meantime, switch to the
  ILRepack.MSBuild.Task package, which ships a forked and updated ILRepack.exe
  executable. This means the assembly merging process will produce a working
  pdb for the merged assembly, which in turn means we'll get stack traces with
  source code location.
* Update the makefile to ship the pdbs we produce. Also don't copy files into
  a temporary build/ directory, since it's not needed. This avoids an
  intermediate file copy.
2020-05-26 14:49:21 +02:00
Jonathan Peppers 2c43f9c62a
[msbuild] missing localization comments - part 2 (#8631)
Fixes: https://github.com/xamarin/xamarin-macios/issues/8494

Added a missing `<comment/>` field for `E0085`.
2020-05-21 08:11:46 -05:00
Rolf Bjarne Kvinge d5c17c8425
[msbuild] Simplify Makefile logic a little bit. (#8642)
* [msbuild] Remove unusued variable in Makefile.

* [msbuild] Simplify localization a little bit in the Makefile.
2020-05-21 15:09:10 +02:00
Rolf Bjarne Kvinge 1b570ebb20
[msbuild] Update to NUnit 3.12 and NUnit.ConsoleRunner 3.11.1. (#8613) 2020-05-20 09:26:05 +02:00
Rolf Bjarne Kvinge 392200d930
[mtouch/mmp] Share numerous command-line arguments. (#8599)
* [mtouch/mmp] Share Application.IsDualBuild, Is32Build and Is64Build.

* [mtouch/mmp] Share --tls-provider and --http-message-handler.

* [mtouch/mmp] Share --force.

* [mtouch/mmp] Share --cache.

* [mtouch/mmp] Share --nolink, --linksdkonly, --linkplatform and --linkskip.

* [mtouch/mmp] Share --i18n.

* [mtouch/mmp] Share --xml.

* [mtouch/mmp] Share --registrar and --runregistrar.

* [mtouch/mmp] Share --warn-on-type-ref.

* [mtouch/mmp] Share --sdk.

* [mtouch/mmp] Share --debug.

* [mtouch/mmp] Share --reference, and deprecate -r|--ref and -a|--assembly.

* [mtouch/mmp] Share --targetver, and deprecate mmp's --minos.

* [msbuild] Adjust tests after switching to use --reference instead of -r.

* Update according to review.

* [mmp] Remove --registrar:il.

The IL generator was what MonoMac had before the dynamic/static registrar code
got shared between MonoTouch and MonoMac. The IL registrar been gone for
years, and as far as I know nobody ever used --registrar:il, even though it
was provided as a compatibility option in the beginning (we still had the IL
registrar around for a while after adding the static+dynamic registrars, until
it was completely replaced by the dynamic registrar).

So just remove this option, if anyone ever used it they can replace it with
--registrar:dynamic.

* [mtouch/mmp] Keep bundler-specific code in its corresponding file.
2020-05-19 15:30:38 +02:00
Jonathan Peppers 89d621e373
[msbuild] add missing localization comments (#8602)
Fixes: https://github.com/xamarin/xamarin-macios/issues/8211
Context: https://github.com/xamarin/xamarin-android/blob/master/Documentation/workflow/Localization.md

A list of MSBuild error codes came back from the translators. These
had no `<comment/>` fields filled out at all. I added these, so it
should be much clearer what the messages actually mean.

* E0044
* E0094
* E0098
* E0124
* E0128
* E0130
* E0131
* E0133
* E0140
* E0156
* E7022_A
* E7057
* M0119
* W0020
* W0022

Error codes that did not appear to be used anymore:

* E0096

I also added a short `README.md` so others can more easily pick this
up.
2020-05-15 15:01:58 -05:00
Rolf Bjarne Kvinge 3549ccf3dd
[msbuild] Inherit from Xamarin[Tool]Task instead of [Tool]Task in a most tasks. (#8582)
This makes it possible to remove a lot of duplicated code.
2020-05-13 15:44:59 +02:00
Rolf Bjarne Kvinge abfb9f2179
[msbuild] Make the DeleteBase task inherit from the Delete task. (#8577)
Once upon a time the Delete task was sealed [1], so we couldn't subclass it as
we wanted. That time is long in the past, so we can now do what we wanted back
then.

[1]: 5c49171303
2020-05-12 17:47:17 +02:00
Jonathan Peppers 666059f289
[msbuild] add System.Drawing.Common ref for bindings (#8528)
Fixes: https://github.com/xamarin/xamarin-macios/issues/8265

Usage of `System.Drawing` types in iOS binding projects are failing with:

    error CS1069: The type name 'Color' could not be found in the namespace 'System.Drawing'.
    This type has been forwarded to assembly 'System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
    Consider adding a reference to that assembly.

In 3a7bdc0, an `_AddExtraReferences` MSBuild target was added for iOS
and Mac projects, but mistakenly missing from binding projects.

I moved the `_AddExtraReferences` target to `Xamarin.Shared.targets`,
so it will be used for all project types.

I also updated a test, I could merely use `System.Drawing.Color` in
`StructsAndEnums.cs` to reproduce the failure.
2020-05-07 15:27:06 -05:00
Rolf Bjarne Kvinge 019c92338b
[msbuild] Fix format arguments in error string. (#8497) 2020-05-04 18:32:10 +02:00
Rolf Bjarne Kvinge 24201084d9
[msbuild] Improve symlinks for Xamarin.Mac. (#8484)
Instead of having multiple symlinks in the /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac directory
pointing to files in /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/msbuild, have the
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac directory point to the
/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/msbuild directory. This way we
don't have to update the symlinks whenever there are new files somewhere.
2020-05-04 10:51:29 +02:00
Rolf Bjarne Kvinge 95d71c8ee1
[msbuild] Unify most of the DetectSdkLocations task between Xamarin.Mac and Xamarin.iOS. (#8462)
New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@45c5a68 [Xamarin.MacDev] Add interfaces to bridge Xamarin.iOS- and Xamarin.Mac-specific classes. (#72)

Diff: a0a11aff27..45c5a680e2
2020-04-28 14:55:35 +02:00
Rolf Bjarne Kvinge cb234697f5
[msbuild] Remove the net461 version of the msbuild task assemblies. (#8419)
The netstandard2.0 version has been the default for a few weeks now, and no
problems have been found, so just delete the net461 version.

This speeds up testing a bit, since we won't be testing the net461 version
anymore.
2020-04-20 09:59:22 +02:00
Rolf Bjarne Kvinge 28eddda439
Extract the ApplePlatform and LinkMode enums into their own files. (#8411) 2020-04-17 09:45:18 +02:00
monojenkins 5673bb0dba
[msbuild] Build bindings with the latest (stable) version of C# (#8401)
We now require C# 8 for nullability support. However we allow custom code
to be included inside binding projects and we should not support anything
(stable) that the C# compiler (installed separately) allow, so `latest`
it is.
2020-04-15 20:31:18 -04:00
Sebastien Pouliot 9f28bce6b8
[msbuild] Build bindings with the latest (stable) version of C# (#8387)
We now require C# 8 for nullability support. However we allow custom code
to be included inside binding projects and we should not support anything
(stable) that the C# compiler (installed separately) allow, so `latest`
it is.
2020-04-15 15:41:32 -04:00
Emanuel Fernandez Dell'Oca bdcd7d35a4
[d16-7] Fixes msbuild.zip (#8368)
* [msbuild] Conditionally include MSBuild assets

Updates the Microsoft.Build* references to use PackageReference to match Xamarin.iOS.Tasks.Core.csproj, and conditionally includes the MSBuild assets so these can be copied to the output directory if needed. If `IncludeMSBuildAssets` is not set, the behavior will remain the same, the MSBuild assemblies won't be copied to the output dir.

* Fix whitespace.

* Bump maccore

New commits in xamarin/maccore:

* xamarin/maccore@92a06f7303 [d16-7] Fixes msbuild.zip (#2200)

Diff: a14f74b40a..92a06f7303

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-04-14 08:19:08 +02:00
Sebastien Pouliot 15938de198
[generator] Add C#8 nullability into generated code (#7570) (#8333)
Goals
* Reflect Apple nullability annotations in our bindings using C#8
* No warnings when building bindings

Non-Goals
* Update (add or fix) `[NullAllowed]` to match Apple headers (next phase)
* Make the generator or internal code fully nullable aware (`nowarn` is used)

Notes
* Apple's own annotations are not 100% accurate :(
* Where known issue exists we have _fixed_ our attributes to match reality :)
* We also do additional null-checks internally that might seems not required (better safe than sorry).
2020-04-10 12:38:14 -04:00
Sebastien Pouliot a5ac0ea102
[generator] Add C#8 nullability into generated code (#7570)
Goals
* Reflect Apple nullability annotations in our bindings using C#8
* No warnings when building bindings

Non-Goals
* Update (add or fix) `[NullAllowed]` to match Apple headers (next phase)
* Make the generator or internal code fully nullable aware (`nowarn` is used)

Notes
* Apple's own annotations are not 100% accurate :(
* Where known issue exists we have _fixed_ our attributes to match reality :)
* We also do additional null-checks internally that might seems not required (better safe than sorry).
2020-04-09 09:29:28 -04:00
Rolf Bjarne Kvinge c5ade80b2e Fix whitespace. 2020-04-07 14:01:52 -03:00
emaf df8afe584b [msbuild] Conditionally include MSBuild assets
Updates the Microsoft.Build* references to use PackageReference to match Xamarin.iOS.Tasks.Core.csproj, and conditionally includes the MSBuild assets so these can be copied to the output directory if needed. If `IncludeMSBuildAssets` is not set, the behavior will remain the same, the MSBuild assemblies won't be copied to the output dir.
2020-04-07 14:01:52 -03:00
Rolf Bjarne Kvinge 2ae55ac1f4
[msbuild] Compute the ComputedFrameworkMoniker later in the build. Fixes #8277. (#8279)
It might only be necessary for Xamarin.iOS builds, but modify both XI and XM
so that the logic is identical.

Fixes https://github.com/xamarin/xamarin-macios/issues/8277.
2020-04-06 12:47:01 +02:00
Rolf Bjarne Kvinge 5aff10b3c0
[msbuild] No need to pass --gsharedvt to mtouch anymore, mtouch ignores --gsharedvt since it must always be enabled. (#8270) 2020-04-02 17:22:17 +02:00
Alex Soto 3ff3e07ebe Merge remote-tracking branch 'xamarin/d16-5-xcode11.4' 2020-03-26 19:59:14 -04:00
Waleed Chaudhry 09d0061317
[msbuild] Remove comment tags to fix translations out of sync issue (#8157) 2020-03-20 17:33:40 -04:00
Manuel de la Pena 820d7de89a
[Msbuild] Do not error if the localizations are out of sync. (#8139)
The translations code is quite fragile at the moment. When building a
package it is throwing errors but does not do the same when building
xamarin-macios. This has happened several times with the mono-2020-02
integration branch:

* https://jenkins.internalx.com/job/macios/job/PR-7795/24/display/redirect
* https://jenkins.internalx.com/job/macios/job/PR-7795/25/display/redirect

This change makes sure that we do not raise an error, unblocks mono
2020-02 and an issue will be added to make sure that we re-enable the
feature once the code is more stable.
2020-03-18 15:14:52 -04:00
Rolf Bjarne Kvinge b26ec6bf34
[msbuild] The Mmp/Mtouch tasks are passed the expected TargetFrameworkMoniker, so no need to have any custom logic here. (#8118)
We can even move it all to the shared base class, and remove an unused variable (UseXamMacFullFramework).
2020-03-16 15:01:57 +01:00
Waleed Chaudhry bcbfe4d5e4
[Localization] MSBuild 2020-03-13 17:46:28 -04:00
Rolf Bjarne Kvinge fe5fd8d11d
[msbuild] Simplify the BTouch task implementation. (#8096)
* Don't validate the TargetFrameworkIdentifier, instead pass it along to bgen
  (which will validate it). This means less validation updates when something
  changes.
* For Xamarin.Mac's GenerateCommandLineCommands' implementation:
    * We'll always have a bgen.exe, so the code for what to do if bgen isn't
      there can be removed.
    * There's no need to compute the 'isMobile' value, because now it's not used
      anymore. So we can remove the first if block in the method completely.
    * There's no need to add the -stdlib flag, because the base implementation
      in BTouchTaskBase already adds it.
    * Now there's nothing left in the method but calling base, so the entire
      override can be removed.
    * This also removes the need for the FrameworkRoot parameter to the task,
      so remove that too.
* For Xamarin.Mac's GetTargetFrameworkArgument's implementation:
    * Move the TargetFramework logic to detect the different Xamarin.Mac
      variations to the targets file, so that it can be reused by other tasks
      and targets.
    * This means we don't need an overridable function to get the target
      framework argument, so just remove inline the entire virtual method.
2020-03-13 18:04:50 +01:00
Rolf Bjarne Kvinge 7c15428fc2
[msbuild] Create common base class for MmpTaskBase and MtouchTaskBase. (#8080)
Create a common base class for MmpTaskBase and MtouchTaskBase, and move logic
that is common between mtouch and mmp there. Some input variables were renamed
for the MmpTaskBase task, when the resulting code would be identical in
MtouchTaskBase, and thus sharable.

There is still a bit more code that could be shared, but that require a bit
more effort and can always be done later.
2020-03-11 19:02:43 +01:00
Rolf Bjarne Kvinge c68700ad4f
Bump Xamarin.MacDev. (#8059)
* Bump Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@a0a11af Adjust SDK validation to allow tools/bin and not allow usr/bin. (#71)
* xamarin/Xamarin.MacDev@e21e1aa Accept 'tools/buildinfo' as an alternative path to 'buildinfo' due to an nuget bug. (#70)
* xamarin/Xamarin.MacDev@ce24236 Don't look in /Developer/MonoTouch anymore, there's nothing there. (#69)

Diff: 210c664e56..a0a11aff27

* [msbuild] Teach tests that mock MonoTouchSdk to mock better.

MonoTouchSdk ends up a bit confused when giving it an Sdk directory that isn't
a real Sdk directory, and then assuming that properties that return Sdk paths
won't throw exceptions.

Fix this by giving MonoTouchSdk a better fake Sdk directory (which
MonoTouchSdk detects as a real Sdk directory), and thus those previously
mentioned properties will return true fake values instead of throwing
exceptions.
2020-03-09 09:12:11 +01:00
Alex Soto f5b3a6f1c4
Merge remote-tracking branch 'xamarin/xcode11.4' into d16-5-xcode11.4 2020-03-08 13:16:04 -04:00
Rolf Bjarne Kvinge 26ad52257e
[msbuild] Pass the entire TargetFrameworkMoniker to tasks instead of just TargetFrameworkIdentifier/TargetFrameworkVersion. (#8048)
When .NET 5 comes, the TargetFrameworkMoniker will change, and we need the
entire moniker to distinguish between various platforms.

So change our msbuild code to consume the entire TargetFrameworkMoniker, so
that we have all the information we need when we need it.

Also redirect everything through an intermediate
_ComputedTargetFrameworkMoniker property, so that the target framework can be
overridden without affecting any other code. This becomes necessary during the
initial implementation phase, because we don't have a .NET version to test
with yet that can give us the new target frameworks. Eventually it should be
possible to remove this intermediate variable
2020-03-06 18:28:58 +01:00
Rolf Bjarne Kvinge 3fcaa41419
[msbuild] Re-use tools/common/TargetFramework.cs. (#8044)
This allows us to replace Xamarin.MacDev.Tasks.PlatformFramework with
Xamarin.Utils.ApplePlatform.

It also allow for more complex target framework handling/parsing in the
future, using the TargetFramework class.
2020-03-05 15:21:35 +01:00
Sebastien Pouliot 0129618de8
[mtouch] Add `force-rejected-types-removal` optimization (#8009) (#8042)
This optimization can be enabled when it's not possible to use the
managed linker (e.g. **Don't link**) or when the managed linker cannot
remove references to deprecated types that would cause an application
to be rejected by Apple.

References to the existing types will be renamed, e.g. `UIWebView` to
`DeprecatedWebView`, in every assemblies.

The type definition is also renamed (for validity) and all custom
attributes on the types and their members will be removed.
Code inside the members will be replaced with a
`throw new NotSupportedException ();`.

The msbuild test app `MyReleaseBuild` has been updated to test that the
optimization is working as expected (device builds are slow so reusing
this test has little impact in test time).

Basically the test ensure that `UIWebView` is used and cannot be removed
by the compiler (optimization) or the managed linker (since it's
referenced). Since the optimization is enabled then we can `grep` then
final `.app` directory to ensure there's no mention of `UIWebView` inside
any of the files that would be submitted.

The application can be run, by itself, and will turn green if OK, red if
`DeprecatedWebView` can't be found (skeleton replacement for `UIWebView`)
or orange if a `NotSupportedException` is thrown.

Finally introspection tests have been updated to skip over the deprecated
(and renamed) types. It should not be an issue right now, since this
optimization is not enabled by default, but it made testing easier.
2020-03-04 21:21:41 -05:00
Alex Soto 709a90599e Merge remote-tracking branch 'xamarin/xcode11.4' into d16-5-xcode11.4-merge 2020-03-03 10:57:24 -05:00
Sebastien Pouliot 54f2dae935
[mtouch] Add `force-rejected-types-removal` optimization (#8009)
This optimization can be enabled when it's not possible to use the
managed linker (e.g. **Don't link**) or when the managed linker cannot
remove references to deprecated types that would cause an application
to be rejected by Apple.

References to the existing types will be renamed, e.g. `UIWebView` to
`DeprecatedWebView`, in every assemblies.

The type definition is also renamed (for validity) and all custom
attributes on the types and their members will be removed.
Code inside the members will be replaced with a
`throw new NotSupportedException ();`.

The msbuild test app `MyReleaseBuild` has been updated to test that the
optimization is working as expected (device builds are slow so reusing
this test has little impact in test time).

Basically the test ensure that `UIWebView` is used and cannot be removed
by the compiler (optimization) or the managed linker (since it's
referenced). Since the optimization is enabled then we can `grep` then
final `.app` directory to ensure there's no mention of `UIWebView` inside
any of the files that would be submitted.

The application can be run, by itself, and will turn green if OK, red if
`DeprecatedWebView` can't be found (skeleton replacement for `UIWebView`)
or orange if a `NotSupportedException` is thrown.

Finally introspection tests have been updated to skip over the deprecated
(and renamed) types. It should not be an issue right now, since this
optimization is not enabled by default, but it made testing easier.
2020-03-02 09:20:29 -05:00
Rolf Bjarne Kvinge ad15106af4
[msbuild] Add support for Metal in the simulator. Fixes #7392. (#7983) (#7991)
* [msbuild] Provide the correct value for the operating system for tvOS and watchOS to a few tasks. Fixes #6200. (#7226)

The problem with #6200 was that we'd pass -mios-version-min=x.y to the metal
tool even for tvOS apps. This fixes it so that now pass -mtvos-version-min.

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

* [msbuild] Add support for Metal in the simulator. Fixes #7392. (#7983)
2020-02-28 19:59:03 +01:00
Sebastien Pouliot a40f6e8804
[msbuild][tests] Re-enable test case (issue fixed a while ago) (#8001) 2020-02-27 17:23:55 -05:00
Rolf Bjarne Kvinge df51d134c0
[msbuild] Add support for Metal in the simulator. Fixes #7392. (#7983) 2020-02-26 18:26:21 +01:00
Waleed Chaudhry bc878256f4
[msbuild] Update test engine to implement IBuildEngine4 (#7905) 2020-02-18 10:56:29 -05:00
Alex Soto ec973295b5
Replace removed dsymutil `-t` switch with `-num-threads` (#7898) 2020-02-14 15:44:19 -05:00
Alex Soto d716663061
Replace removed dsymutil `-t` switch with `-num-threads` (#7900) 2020-02-14 15:36:47 -05:00
Rolf Bjarne Kvinge de61d3d705
[msbuild] Deduplicate the code for generating the app bundle name/path between our various platforms. (#7841)
Also move the app bundle name/path generation code together for all platforms
to avoid it drifting apart in the future.
2020-02-14 14:26:48 +01:00
Rolf Bjarne Kvinge d98a8f1792
[msbuild] Tweak the tests. (#7877)
This is a series of commits that tweaks the msbuild tests a little bit.

* [msbuild] Match configuration between MyWatchKit2Extension and MyWatchKit2IntentsExtension.

Fixes this warning:

>  MTOUCH : warning MT0113: Native code sharing has been disabled for the extension 'MyWatchKit2IntentsExtension' because the --assembly-build-target options are different between the container app () and the extension (--assembly-build-target:@all=dynamiclibrary). [MyWatchKit2Extension/MyWatchKit2Extension.csproj]

* [msbuild] Add the extra argument for the AppWithExtraArgumentThatOverrides test project to all configurations.

That way the test can be built in all configurations (and still test what it's
supposed to test).

* [msbuild] Clean up project files a bit.

* Removed default 'CodesignKey' values from simulator configurations.
* Removed 'MtouchFastDev' values from simulator configurations.
* Removed 'IOSDebuggerPort' values, not needed for these projects.

* [msbuild] Update test projects to use 64-bit architectures.

Also enable bitcode (+llvm) for release device builds for tvOS and watchOS.

* [msbuild] Simplify test project configuration a bit.

* [msbuild] Unify output path.

Using 'TV' and 'TVSimulator' in the OutputPath works fine, but it makes some
of the tests a bit more complex because they need to special-case this test to
find the path to the resulting .app.

* [msbuild] Fix the MyiOSFrameworkBinding test project to have the same assembly name as the project itself.

This simplifies upcoming testing code a bit.
2020-02-14 14:12:25 +01:00
Alex Soto cee4b5e5a1
[xcode11.4] Add xcode 11.4 b1 initial support (#7805)
* [xcode11.4] Add xcode 11.4 b1 initial support

* [xtro] re-enable PDFKit

* Disable watchOS and fix xtro

Unfortunately watchOS simulator hangs when we try to deploy to it
and it keeps our tests timing out. Disabling for now until we
can investigate more.

Disables PDFKit on xtro in macOS

* [jenkins] Switch to use the catalina bot group (#7819)

* Bump maccore to get fix for launching the simulator for watch apps.

New commits in xamarin/maccore:

* xamarin/maccore@546270c8f9 [Xamarin.Hosting] Fix the name of the notification we get when the simulator has launched. (#2145)

Diff: 55957e908d..546270c8f9

* [tests] Diable watch due to time out, enable 10,15,4 in intro, fix min version

* Bump macios-binaries to get updated binary mlaunch as well.

New commits in xamarin/macios-binaries:

* xamarin/macios-binaries@f8c6e63 Bump mlaunch to xamarin/maccore@546270c8f9

Diff: eb6980e8b6..f8c6e63228

* [msbuild] Reflect ibtool changes in our tests

Looks like Apple reverted some changes introduces in Xcode 11
in ibtool, for more context see xamarin/xamarin-macios#6970

* [mtouch] Workaround strange behavior of realpath.

Co-authored-by: Sebastien Pouliot <sebastien.pouliot@gmail.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-02-11 20:25:43 -05:00
Rolf Bjarne Kvinge adaf221471
[msbuild] Fix warning about CFBundleVersion in the MyWatchApp2 test project. (#7843)
Fixes:

> /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1726,3): warning : The Watch App 'MyWatchApp2' has a CFBundleVersion (1.33) that does not match the main app bundle's CFBundleVersion (1.0) [MyWatch2Container/MyWatch2Container.csproj]
> /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1726,3): warning : The Watch Extension 'MyWatchKit2Extension' has a CFBundleVersion (1.0) that does not match the main app bundle's CFBundleVersion (1.33) [MyWatch2Container/MyWatch2Container.csproj]
2020-02-11 15:27:29 +01:00
Rolf Bjarne Kvinge b0242cfe48
[msbuild] Fix MT4174 warning for the MyWatchKit2IntentsExtension test project. (#7842)
Fixes:

> MyWatchKit2IntentsExtension/IntentHandler.cs(36): warning MT4174: Unable to locate the block to delegate conversion method for the method MyWatchKit2IntentsExtension.IntentHandler.ResolveRecipients's parameter #2. [MyWatchKit2Extension/MyWatchKit2Extension.csproj]

The method signature probably changed from a beta release to the corresponding
stable release, and this method was never updated.
2020-02-11 15:27:08 +01:00
Rolf Bjarne Kvinge 29b9e75db9
Remove code that refers to /Developer/MonoTouch. (#7840)
It's about time.
2020-02-11 15:26:15 +01:00
Rolf Bjarne Kvinge 4c496a87ed
[msbuild] Make sure DeviceSpecificOutputPath is a relative path. (#7832)
It might be absolute at least sometimes when building with dotnet, and making
sure it's always a relative path simplifies the code.
2020-02-10 22:31:18 +01:00
Jonathan Peppers bba8fe731f
[msbuild] remove {GAC} from $(AssemblySearchPaths) (#7815)
Fixes: https://developercommunity.visualstudio.com/content/problem/788505/xamarin-found-conflicts-between-different-versions.html
Fixes: http://work.azdo.io/1008385
Context: 73b93c2dc9/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets (L337-L341)

On Windows only, Xamarin.Forms projects hit the build warning:

    Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3277: Found conflicts between different versions of "System.Numerics" that could not be resolved.
    These reference conflicts are listed in the build log when log verbosity is set to detailed.

The difference appears to be the `{GAC}` search path is used on
Windows, but not Mac.

In fact, the output of `<ResolveAssemblyReference/>` on Mac reports:

    Unused locations
        {CandidateAssemblyFiles}
        {HintPathFromItem}
        {Registry:Software/Microsoft/Xamarin.iOS,v1.0,AssemblyFoldersEx}
        {AssemblyFolders}
        {GAC}
        bin/iPhoneSimulator/Debug/
    Used locations
        {TargetFrameworkDirectory}
        {RawFileName}

Compared to Windows:

    Used locations
        {TargetFrameworkDirectory}
        {GAC}
        {RawFileName}

For now, we should just remove `{GAC}` from the list as the safest fix.

Xamarin.Mac is already doing this:

f85556c1e5/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.props (L121-L125)

Down the road, we could specify only the paths needed for performance
reasons. We have done this recently in Xamarin.Android:

5945e9a779/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets (L382-L386)

* Added a test assertion for this as well.
2020-02-07 08:54:29 -06:00
Rolf Bjarne Kvinge 5cac2eafd3
[msbuild] Don't add newlines to command line arguments to mmp. (#7806)
Don't separate command-line arguments to mmp with newlines, in dotnet those
newlines are passed to mmp instead of being treated as whitespace, and that
confuses mmp.

Also remove additional and unneeded whitespace in the command line arguments,
the CommandLineArgumentBuilder class already adds whitespace when needed.
2020-02-06 15:34:21 +01:00
Rolf Bjarne Kvinge 9960ee43de
[msbuild] Fix several issues in the MyWatchApp2 test project. (#7804)
* [msbuild] Fix the MyWatchApp2 test project to include resources already present.

Fixes several warnings:

> MyWatchApp2/obj/iPhoneSimulator/Debug/actool/cloned-assets/Resources/Images.xcassets : actool warning : The file "Icon-27.5x27.5@2x.png" for the image set "AppIcons" does not exist. [MyWatchApp2/MyWatchApp2.csproj]
> MyWatchApp2/obj/iPhoneSimulator/Debug/actool/cloned-assets/Resources/Images.xcassets : actool warning : The file "Icon-86x86@2x.png" for the image set "AppIcons" does not exist. [MyWatchApp2/MyWatchApp2.csproj]
> MyWatchApp2/obj/iPhoneSimulator/Debug/actool/cloned-assets/Resources/Images.xcassets : actool warning : The file "Icon-40x40@2x.png" for the image set "AppIcons" does not exist. [MyWatchApp2/MyWatchApp2.csproj]
> MyWatchApp2/obj/iPhoneSimulator/Debug/actool/cloned-assets/Resources/Images.xcassets : actool warning : The file "Icon-44x44@2x.png" for the image set "AppIcons" does not exist. [MyWatchApp2/MyWatchApp2.csproj]
> MyWatchApp2/obj/iPhoneSimulator/Debug/actool/cloned-assets/Resources/Images.xcassets : actool warning : The file "Icon-24x24@2x.png" for the image set "AppIcons" does not exist. [MyWatchApp2/MyWatchApp2.csproj]
> MyWatchApp2/obj/iPhoneSimulator/Debug/actool/cloned-assets/Resources/Images.xcassets : actool warning : The file "Icon-98x98@2x.png" for the image set "AppIcons" does not exist. [MyWatchApp2/MyWatchApp2.csproj]
> MyWatchApp2/obj/iPhoneSimulator/Debug/actool/cloned-assets/Resources/Images.xcassets : actool warning : The file "Icon-29x29@2x.png" for the image set "AppIcons" does not exist. [MyWatchApp2/MyWatchApp2.csproj]
> MyWatchApp2/obj/iPhoneSimulator/Debug/actool/cloned-assets/Resources/Images.xcassets : actool warning : The file "Icon-29x29@3x.png" for the image set "AppIcons" does not exist. [MyWatchApp2/MyWatchApp2.csproj]

* [msbuild] Add a 1024x1024 icon to the MyWatchApp2 test project.

Fixes this warning:

> MyWatchApp2/obj/iPhoneSimulator/Debug/actool/cloned-assets/Resources/Images.xcassets : actool warning : A 1024x1024 app store icon is required for watchOS apps [MyWatchApp2/MyWatchApp2.csproj]

* [msbuild] Remove the longLook icon entry for MyWatchApp2.

It doesn't seem to be a valid entry, there's no such entry when creating a
watchOS app in Xcode. Additionally it fixes this warning:

> MyWatchApp2/obj/iPhoneSimulator/Debug/actool/cloned-assets/Resources/Images.xcassets : actool warning : The app icon set "AppIcons" has an unassigned child. [MyWatchApp2/MyWatchApp2.csproj]
2020-02-06 07:26:20 +01:00
Rolf Bjarne Kvinge 346e29397d
[msbuild] Remove unused files. (#7801) 2020-02-05 23:55:11 +01:00
Rolf Bjarne Kvinge 0557f16e6a
[msbuild] Make code a bit more future-proof. (#7790)
According to review of #7706.
2020-02-05 07:29:29 +01:00
Rolf Bjarne Kvinge 7bdb167ffe
[msbuild] Remove outdated AppStore and Ad-Hoc configurations from test projects. (#7777) 2020-02-03 13:56:49 +01:00
Rolf Bjarne Kvinge b5b74ff1c4
[msbuild] Remove unused csproj variable. (#7778) 2020-02-03 13:56:36 +01:00
Waleed Chaudhry 00985a55e2
[Localization] mtouch/mmp C# (#7710) 2020-01-31 15:02:52 -05:00