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

359 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot 2d6ce7459d
Bump to use Xcode 10 beta 1 (#4179)
* Bump to use Xcode 10 beta 1

* Update Versions.plist

* Add a dependency on Xcode 9.4.

* [msbuild] Fix build with Xcode 10 beta 1. (#4182)

Many years ago (in Xcode 7 according to code comment)
Developer/Platforms/iPhoneOS.platform/Developer/usr disappeared, and we coped
by looking at Developer/usr instead (and also the subsequent code to locate
the bin directory was based on the location of the usr directory).

Developer/Platforms/iPhoneOS.platform/Developer/usr reappeared in Xcode 10
beta 1, but it seems useless (for one it doesn't contain a bin directory), so
in order to try to keep things sane don't look for this directory in Xcode 10
and instead go directly for Developer/usr (which is what we've been using as
the usr directory for years anyway).

Fixes this problem when building apps with Xcode 10 beta 1:

      /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(626,3): error : Could not locate SDK bin directory [/Users/rolf/Projects/TestApp/test-app.csproj]

* [runtime] Build 32-bit mac executables using Xcode 9.4.

* [mtouch] Work around broken tvOS headers in Xcode 10 beta 1.

* [mtouch] Work around build problem with Apple's simd headers in Objective-C++ mode.

* Use version-agnostic paths to sdk directories.

* [tests][xtro] Add todo files (from unclassified) and adjust ignore files to avoid errors

* [macos][security] Re-enable SSL[Get|Set]AlpnProtocols. Fixes #4001 (#4022)

* [macos][security] Re-enable SSL[Get}Set]AlpnProtocols. Fixes #4001

This was fixed in macOS 10.13.4

https://github.com/xamarin/xamarin-macios/issues/4001

* [tests][monotouch-tests] Disable a few test cases (one crasher, other failures). Causes to be verified later

* [xharness] Fix permission dialog suppression in Xcode 10.

* [xharness] Ignore 32-bit macOS tests by default.

* [tests] Execute mmp regression tests with Xcode 9.4 since many of them are 32-bit and needs porting to 64-bit.

* [mmptest] Ignore 32-bit XM tests if we don't have a 32-bit-capable Xcode.

* [registrar] Add workaround for broken headers in Xcode 10 beta 1 (radar 40824697).

* [mtouch] Restrict another workaround for an Xcode 10 beta 1 bug to a specific Xcode version to remove it asap.

* [tests] Fix some protocol changes (public or not) find by introspection tests

* [tests][intro] Fix DefaultCtorAllowed failures

* [Intents] Obsolete several Intents classes in watchOS.

Several existing Intents classes have been marked as unavailable in watchOS in
the headers in Xcode 10 beta 1, and corresponding tests are now failing.

So obsolete the managed wrapper types, and fix tests accordingly.

* Fix xtro wrt previous Ietents/intro changes

* [tests] Minor adjustments to mtouch tests to work with Xcode 10.

* [msbuild] Update tests to cope with additional files produced by the Core ML compiler.

* [msbuild] Xcode 10 doesn't support building watchOS 1 apps, so show a clear error message explaining it.

Also update tests accordingly.

* [coreimage] Stub new filters and exclude ?removed? ones from tests

* Update GameplayKit and SpriteKit NSSecureCoding _upgrade_ and fix other non-public cases (in tests)

* [tests] Ignore some GameKit selectors that don't respond anymore (but seems to be available, at least in header files)

* [tests] Fix intro 32bits testing for filters resutls

* [msbuild] Slightly change error message to be better English.
2018-06-08 18:45:24 -07:00
Sebastien Pouliot 9208e9a0a4 Add xcode9.4 support into 15.7
The PR is not final and cannot be merged until the final Xcode 9.4
release from Apple is available.

Since there's no macOS specific changes (at least up to beta 2) we can
directly merge into the _normal_ milestone branch and avoid having
separate branches to maintain for XI and XM (until 15.8).
2018-05-03 13:55:11 -04:00
Chris Hamons 3c5a4989a8 [d15-7][msbuild] Fix AOT options from IDE (#3916)
* Add failing test for tag issue

* [msbuild] Update msbuild to use correct XM AOT variables

- The IDE saves out AOTMode and HybridAOT but msbuild was older names
2018-04-17 21:15:12 -04:00
Jeffrey Stedfast 6f3b277df6 [xcode9.4][msbuild] Catch ArgumentException if IBToolTask fails to load plist o… (#3940)
Fixes the stack trace spew in https://devdiv.visualstudio.com/DevDiv/_workitems/edit/595179
2018-04-13 16:15:36 -04:00
Vincent Dondain aa27dba548 [msbuild] Skip reference assemblies passed to mtouch (#3791) (#3889)
- Fixes issue #3199: Could not AOT the assembly System.Runtime.CompilerServices.Unsafe.dll (MT3001)
  (https://github.com/xamarin/xamarin-macios/issues/3199)
- Test case: https://www.dropbox.com/s/kxt3isgzn74nq35/Issue3199.zip?dl=0

### Problem

Given a Nuget Package added via the "package reference" mechanism and the said package having netstandard 'lib' **and** 'ref' folders;
MTouch was getting reference assemblies and was trying to AOT them. This resulted in an error as those assemblies are only facades.

### Solution

'ResolveNuGetPackageAssets' computes the NuGet packages using their json asset file, adds the full assemblies to 'ReferenceCopyLocalPaths' and outputs the resolved references via '_ReferencesFromNuGetPackages'.

This is exactly what "Microsoft.NuGet.Build.Tasks"'s 'ResolveNuGetPackageAssets' target does.
2018-04-06 17:06:27 -04:00
Jeffrey Stedfast 8690c7f44a [msbuild] Correctly determine whenther Xamarin.Mac builds require a provisioning profile (#3710) (#3733)
Fixes issue #3674

The problem is that the Xamarin.Mac targets did not set the
RequireProvisioningProfile property on the DetectSigningIdentity
task which meant that it defaulted to 'false'.

When that property is 'false', the DetectSigningIdentity logic
would shortcut to not doing a provisioning profile lookup.

This was therefor causing the build to not use a provisioning
profile which caused the build to improperly codesign the app
bundle.
2018-03-20 16:12:27 -05:00
Jeffrey Stedfast 37c1337587 [msbuild] Correctly determine whenther Xamarin.Mac builds require a provisioning profile (#3726)
Fixes issue #3674

The problem is that the Xamarin.Mac targets did not set the
RequireProvisioningProfile property on the DetectSigningIdentity
task which meant that it defaulted to 'false'.

When that property is 'false', the DetectSigningIdentity logic
would shortcut to not doing a provisioning profile lookup.

This was therefor causing the build to not use a provisioning
profile which caused the build to improperly codesign the app
bundle.
2018-03-13 08:15:03 -05:00
Jeffrey Stedfast b0145de9c7 [msbuild] Always codesign libraries and frameworks (#3354)
Fixes issue #3289
2018-03-07 16:40:36 -05:00
Chris Hamons e4b62a84c1
Build with CSC instead of MCS (#3393) (#3578)
- Improve error messages from install-source when crashing
2018-02-26 09:20:54 -06:00
Rolf Bjarne Kvinge f905427739
[tests] Share supporting code between the mtouch and mmp tests. (#3374)
* [tests] Share supporting code between the mtouch and mmp tests.

Create a new class 'BundlerTool', which now contains most of the code in
MTouchTool that's also applicable to mmp (and the new MmpTool class).

This will make it easier to share tests between the mtouch and mmp tests.

Some tweaks are still probably required, but this should get us most of the
way.

* [tests] Fix generator tests after changes in shared test code.

* [tests] Add new file to the MSBuild/XM tests.
2018-02-02 07:09:04 +01:00
Jeffrey Stedfast a61c7dc2ca
[msbuild] Use the proper MM vs MT error code prefix (#3360)
* [msbuild] Use the proper MM vs MT error code prefix

* Removed unused variable (artifact of debugging)
2018-01-31 09:56:45 -05:00
Jeffrey Stedfast cb51d9364d
[msbuild] Removed old logging conven ience method (#3352) 2018-01-30 13:51:01 -05:00
Jeffrey Stedfast d86b0822a4 [msbuild] Always codesign libraries and frameworks (#3341)
Fixes issue #3289
2018-01-29 10:56:03 +01:00
Rolf Bjarne Kvinge 398f430a55
[msbuild] Fix Makefile warning by removing duplicate target. (#3277)
Fixes this warning:

> Makefile:317: target `/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/msbuild/iOS' given more than once in the same rule.

because the same directory was listed twice.
2018-01-22 22:30:27 +01:00
Vincent Dondain 26d46dace5
[msbuild] Add missing {1} in LogMessage (#3271) 2018-01-19 13:14:11 -05:00
Vincent Dondain e6ee7c5e2f
[msbuild] Add missing {1} in LogMessage (#3262) 2018-01-19 10:27:14 -05:00
Jeffrey Stedfast e8bb3d2a99
[msbuild] Fixed embedding of provisioning profiles for tvOS (#3261)
Instead of hard-coding the platform as iOS for the EmbedMobileProvision
task, use the SdkPlatform to determine the appropriate platform to use
in the MobileProvisionIndex query.

This is a follow-up fix with near identical changes to the
CompileEntitlements fix for tvOS.
2018-01-18 17:09:45 -05:00
Jeffrey Stedfast ce5765771f
[msbuild] Resolve a Provisioning Profile if needed for iOS Sim builds (#3245) 2018-01-18 16:46:07 -05:00
Jeffrey Stedfast 7b663d11f1
[msbuild] Resolve a Provisioning Profile if needed for iOS Sim builds (#3244) 2018-01-18 16:29:14 -05:00
Jeffrey Stedfast 6d73e7634b
[msbuild] Fixed embedding of provisioning profiles for tvOS (#3255)
Instead of hard-coding the platform as iOS for the EmbedMobileProvision
task, use the SdkPlatform to determine the appropriate platform to use
in the MobileProvisionIndex query.

This is a follow-up fix with near identical changes to the
CompileEntitlements fix for tvOS.
2018-01-18 15:17:57 -05:00
Jeffrey Stedfast 2a7579b8ab
[msbuild] Fixed provisioning profile lookups for tvOS (#3243) 2018-01-18 10:30:32 -05:00
Jeffrey Stedfast bb2a0faca4 [msbuild] Fixed provisioning profile lookups for tvOS (#3216) 2018-01-17 15:18:34 -05:00
Jeffrey Stedfast 0059e3e5b5 [msbuild] DetectSigningIdentity fix for Mac when RequireProvisioningProfile is false (#3218)
* [msbuild] DetectSigningIdentity fix for Mac when RequireProvisioningProfile is false

Fixes https://github.com/xamarin/maccore/issues/612

* Disable some tests since they don't make correct assumptions anymore

* Added comment to explain why tests are disabled
2018-01-12 17:13:08 -05:00
Jeffrey Stedfast c22d033e1a
[msbuild] DetectSigningIdentity fix for Mac when RequireProvisioningP… (#3212)
* [msbuild] DetectSigningIdentity fix for Mac when RequireProvisioningProfile is false

Fixes https://github.com/xamarin/maccore/issues/612

* Disable some tests since they don't make correct assumptions anymore

* Added comment to explain why tests are disabled
2018-01-12 14:21:52 -05:00
Rolf Bjarne Kvinge 4b667e4700
[build] Fix makefiles to be compatible with remake v4.2.1. (#3184)
For some strange reason the following sometimes work with make v3.8.1:

    X/:
    	mkdir X

    X/Y: X
    	mkdir X/Y

Note how the second target specifies `X` as a dependency, but the actual
target to be executed is `X/` (additional trailing slash).

It does not work with remake (v4.2.1), nor in a simple test case like the one
above with make (v3.8.1), but it works in our own makefiles (which are
admittedly slightly more complicated).

Since it's trivial to fix, and I don't understand how it works in make in the
first place, I'm just changing it to what makes sense (and works everywhere):
remove trailing slashes from all directories that are used as targets.
2018-01-09 17:09:04 +01:00
Jeffrey Stedfast 30ae7d3d32 [msbuild] Tweak the codesign logic for iOS Simulator builds (#3180)
Don't *always* codesign, especially for Xcode 8 which seems to break.

iOS Simulator builds should only be codesigned if they require
Entitlements (signified by RequireProvisionProfile).
2018-01-08 15:59:26 -05:00
Jeffrey Stedfast fc723647c7 [msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll (#3179) 2018-01-08 15:57:58 -05:00
Jeffrey Stedfast cfdf59dce4 [msbuild] Tweak the codesign logic for iOS Simulator builds (#3114)
Don't *always* codesign, especially for iOS8 which seems to break.

iOS Simulator builds should only be codesigned if they require
Entitlements (signified by RequireProvisionProfile).
2018-01-08 14:32:00 -05:00
Jeffrey Stedfast 316948e5d0 [msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll (#3168) 2018-01-08 14:29:52 -05:00
Emanuel c84f0dac3d [msbuild] Fixes MoveTaskBase inclusion
MoveTaskBase inherits from Microsoft.Build.Tasks.Move, and Mono has a different implementation of it, so when building from a Mac we need to include XBuildMoveTaskBase.cs instead. The previous condition does no apply any more, because we're now using MSBuild to build, but the Move task implementation didn't change so it doesn't matter if we're using Xbuild or MSBuild.

This issue is preventing us (XVS) from merging features to our master branch
2017-12-14 19:37:15 -03:00
Vincent Dondain 808c67017d
[msbuild] Add support for optionally explaining why inapplicable certificates are not applicable (#3085)
Help fix #58251: When looking for valid signing certificates, print out each invalid certificate and state why it's not valid
(https://bugzilla.xamarin.com/show_bug.cgi?id=58251)
2017-12-12 14:25:04 -05:00
Jeffrey Stedfast b52a38bd33
[msbuild] Catch json parser exceptions to provide better error reporting (#2992)
* [msbuild] Catch json parser exceptions to provide better error reporting

This is in response to https://bugzilla.xamarin.com/show_bug.cgi?id=60536

* Added unit test
2017-12-12 13:54:09 -05:00
Vincent Dondain 565d710f4f
[msbuild] Don't run Xamarin.Analysis on library projects (#3084)
Avoid bug #59697: iOS Library projects fail CompileEntitlements when Analysis is enabled
(https://bugzilla.xamarin.com/show_bug.cgi?id=59697)

Note: bug #59697 happens because XIA0002_TestCloudAgentReleaseRule depends on `_CompileToNative` which
depends on `CompileEntitlements` which then requires the `AppBundleDir` parameter that isn't provided
for library project.

If we ever decide to enable Xamarin.Analysis on library projects we'll have to run a subset of the rules that
doesn't include rules like XIA0002 using the same condition this fix is using.
2017-12-05 16:35:29 -05:00
Manuel de la Pena 6135a6c4d8
[MSBuild] Do not set CFBundleDevelopmentRegion if not present. (#2779)
* [MSBuild] Do not set CFBundleDevelopmentRegion if not present.

This is a complicated fix. This is a regression introduced by Apple.
CFLocaleCopyCurrent(), used in the iOS code, will return the value of
the application's CFBundleDevelopmentRegion Info.plist key if all of the
following conditions are true:

* CFBundleDevelopmentRegion is present in the Info.plist
* The CFBundleDevelopmentRegion language is in the list of preferred
languages on the iOS device, but isn't the first one
* There are no localized resources (i.e. no .lproj directory) in the app
for the first preferred locale

This differs from iOS 10 where the presence of the
CFBundleDevelopmentRegion key had no effect.

Note that if the CFBundleDevelopmentRegion key is not present at all,
CFLocaleCopyCurrent() always returns the first preferred locale as it
did in iOS 10.

We are adding the key by default in the plist of the applications which confuses users since they do not see the key in the .plist added by the template. This commit removes it to be more explicit and help users understand the behaviour.
2017-12-01 16:52:25 +01:00
Jeffrey Stedfast a3692f4314 [msbuild] Codesign iOS Simulator builds using the '-' key. Fixes #59379 (#3060)
When codesigning iOS Simulator builds, it is important to note
that the codesign command itself cannot include the entitlements,
but the mtouch command *MUST* embed the entitlements using
-Xlinker.

https://bugzilla.xamarin.com/show_bug.cgi?id=59379
2017-11-29 15:26:29 -05:00
Jeffrey Stedfast 5645e3349a Revert "[msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll (#3007)"
This reverts commit 2d4256ef15.
2017-11-29 09:22:22 -05:00
Jeffrey Stedfast 52912ee347 [msbuild] fixup 2017-11-28 11:25:17 -05:00
Jeffrey Stedfast d67cf5b59c [msbuild] Fixed CoreMLCompilerTaskBase 2017-11-28 11:22:17 -05:00
Jeffrey Stedfast 06227e9467 Fixed the build after a bad merge 2017-11-28 11:20:05 -05:00
Jeffrey Stedfast 7c7814e892
[msbuild] Added support for building CoreML models (#2714)
* [msbuild] Added support for building CoreML models

* [msbuild] Make sure to Dispose() processes after they're done

* Updated to use newer MLModel.Create() and MLFeatureValue.Create() methods

* Added SqueezeNet.txt to document SqueezeNet.mlmodel
2017-11-28 11:16:44 -05:00
Jeffrey Stedfast 2d4256ef15
[msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll (#3007)
* [msbuild] Pack all iOS MSBuild Task assemblies into a single assembly

* Fixed the build

* Renamed ProcessArgumentBuilder to CommandLineArgumentBuilder

This is needed to prevent symbol conflicts with Xamarin.MacDev's
ProcessArgumentBuilder (which is functionally different from
Xamarin.MacDev.Tasks.Core's class of the same name).

* Fixed ILRepack logic for filtering dll's to repack

* Fixed building of Xamarin.iOS.Tasks.Tests now that X.iOS.Tasks.dll contains all symbols

* Updated Makefile now that only 1 iOS Task assembly needs to be distributed

* ILRepack Xamarin.Mac.Tasks as well

* Fixed up *.targets to specify The One Assembly To Rule Them All

* [xharness] Build MSBuild tests with MSBuild.

* Touch the ilrepack stamp file *after* invoking ILRepack, not before.

* Same for Xamarin.Mac.Tasks
2017-11-27 14:44:09 -05:00
Rolf Bjarne Kvinge e8d16c925b
[mtouch/mmp/bgen] Add support for response files. (#2808)
* [mtouch/mmp/bgen] Add support for response files.

This is the first part of the fix for #56501.

https://bugzilla.xamarin.com/show_bug.cgi?id=56501

* [tests] Make sure no single argument starting with a '@' is passed to mtouch unless it's a response file.

--assembly-build-target takes arguments starting with '@', for instance:

    --assembly-build-target @all=framework

which does not work anymore, because that's interpreted as a response file
(mtouch tries to read the file '@all=framework', which obviously doesn't
exist).

The fix is simple, don't put a space between the two arguments:

    --assembly-build-target=@all=framework

* Add --root-assembly to mtouch/mmp and make the MSBuild tasks use this new option.

This makes it possible to pass root assemblies starting with `@` to mtouch/mmp
without getting mistaken for response files.

* [msbuild] Always use the command-line option that takes an equals or colon.

Always use the command-line option that takes an equals or colon instead of a
space.

Do either of these:

    --foo=something
    --foo:something

instead of this:

    --foo something

so that `something` can start with an at (`@`) sign without being mistaken for
a response file.

* [msbuild] Fix tests according to recent task changes.
2017-11-16 16:02:34 +01:00
Sebastien Pouliot 395feca0d9 Merge branch 'xcode9.1' into master-merge-xcode91-take2 2017-11-03 10:30:07 -04:00
Jeffrey Stedfast b8995c5597 [msbuild] Set the target architecture in the Info.plist UIRequiredDev… (#2409)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58544

* Added unit test

* Removed support for ARMv6

* Removed CompileAppManifest.Architecture property and usage
2017-11-02 15:01:00 -04:00
Rolf Bjarne Kvinge ce323717be
Revert "[msbuild] Fixed Condition for CalculateCodesignAppBundleInputs (#2843)" (#2944)
This reverts commit cb216083f1, because it breaks several monotouch-tests:

    [FAIL] KeyChainTest.Add_Certificate :   Add_Certificate
    [FAIL] KeyChainTest.AddQueryRemove_Identity :   Expected: True
    [FAIL] KeyChainTest.CheckId :   same guid
    [FAIL] KeyChainTest.SecItemAdd_Identity :   Expected: True
    [FAIL] RecordTest.Accessible_17579 :   Add
    [FAIL] RecordTest.AuthenticationType_17579 :   Add
    [FAIL] RecordTest.DeskCase_83099_InmutableDictionary :   Password could not be saved to keychain
    [FAIL] RecordTest.IdentityRecordTest :   Identity added
    [FAIL] RecordTest.Protocol_17579 :   Add
2017-11-01 16:19:02 +01:00
Jeffrey Stedfast cb216083f1
[msbuild] Fixed Condition for CalculateCodesignAppBundleInputs (#2843)
* [msbuild] Fixed Condition for CalculateCodesignAppBundleInputs

CodesignAppBundle was not being executed because the inputs were empty.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=59379

* Codesign AppExtensiosn as well (and might as well run CodesignVerify too)

* Revert CompileEntitlements change, only compile them if we require codesigning

* Don't embed mobile provision file unless the build requires codesigning

* More fixes to codesigning iPhoneSimulator builds

* Fixed CodesignAppBundle tests to not check dsym timestamps for iPhoneSimulator builds

* Ignore the user's signing key & provisioning profile for Simulator builds

Xcode9 does not use them. It always codesigns Simulator builds with "-"
and never involves the specified provisioning profile.

This finally fixes the AppGroups sample to work properly

For CodesignVerify, having a _ProvisioningProfile defined means that
we have definitely codesigned the app bundle, so it makes sense to
verify the code signature (it probably doesn't make sense to do if
the codesign key is just "-", for example).
2017-10-30 16:52:03 -04:00
Jeffrey Stedfast b55f758caf [msbuild] Updated DetectSigningIdentity to allow thumbprints for the CodeSignKey (#2914) 2017-10-26 15:30:38 -04:00
Jeffrey Stedfast 12bb6eca91 [msbuild] Switched to using System.Json instead of Newtonsoft.Json (#2834) 2017-10-10 16:04:14 -04:00
Jeffrey Stedfast 64804703fb [msbuild] Fixed string formatting error (#2861) 2017-10-10 10:59:11 +02:00
Rolf Bjarne Kvinge 1ccd95acaa Add support for optionally explaining why inapplicable certificates are not applicable. Partially fixes #58251. (#2865)
This also requires a Xamarin.MacDev bump:

xamarin/Xamarin.MacDev@f83f84d Add support for optionally explaining why inapplicable provisioning profiles are not applicable. Partially fixes #58251. (#16)
xamarin/Xamarin.MacDev@d60d25b Added new iPhone X icon sizes

https://bugzilla.xamarin.com/show_bug.cgi?id=58251
2017-10-10 10:56:25 +02:00