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

132 Коммитов

Автор SHA1 Сообщение Дата
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
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
Jeffrey Stedfast 9909748eb4 [msbuild] Emit a build error when CFBundleIdentifier is null/empty (#2791)
* [msbuild] Removed unused DetectBundleIdentifier task

* [msbuild] Emit a build error when Info.plist CFBundleIdentifier is null/empty

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=59572
2017-10-06 10:26:33 +02:00
Jeffrey Stedfast 361f3abf53 [msbuild] Removed Task name/property logging that MSBuild does for us now (#2426) 2017-08-10 09:00:18 -04:00
Rolf Bjarne Kvinge 76d9e43f53 [msbuild] Strip frameworks better. (#2305)
This can save a significant amount of space when using code-sharing: the PIX
app saved ~11mb in release mode (when stripping).

`man strip` says:

```
For dynamic shared libraries, the maximum level of stripping is usually -x (to remove all non-global symbols).

-x Remove all local symbols (saving only global symbols).
```
2017-07-10 16:23:24 +02:00
Jeffrey Stedfast 2f4e81809c [msbuild] Re-added wildcard (*) expandsion for application-identifier… (#2182)
* [msbuild] Re-added wildcard (*) expandsion for application-identifier in Entitlements.plist

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

* Fixed unit tests
2017-06-08 14:01:22 -04:00
Jeffrey Stedfast 7facec2a70 [msbuild] Added EnableOnDemandResources option (#2133)
* [msbuild] Added EnableOnDemandResources option

Disabling this option causes the ACTool task to pass
--enable-on-demand-resources NO (instead of YES) to actool.

It will also cause the ResourceTags property on BundleResource
and InterfaceBuilder items to be ignored.

* Fixed unit tests
2017-05-26 14:52:07 -04:00
Ankit Jain ca7181c6b8 [msbuild] Fix samples build with msbuild (#2035)
CompileSceneKitAssetsTaskBase tries to set `DefiningProjectFullPath`
metadata on a new TaskItem, if it is available on the original one.
But with msbuild, this is a reserved metadata and cannot be set.

If we create the new item based on the original one, then we get the
metadata too. And we also get a `OriginalItemSpec`, which we don't need
and can remove.

This fixes a regression caused by msbuild/XS switching to use the
msbuild implementations of `Microsoft.Build.{Tasks,Utilities}.{v4.0,v12.0}`
assemblies (-> `.Core`) instead of the xbuild ones.

It manifested as:

`error MSB4018: System.ArgumentException: "DefiningProjectFullPath" is a reserved item metadata, and cannot be modified or deleted.`

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55480
      https://bugzilla.xamarin.com/show_bug.cgi?id=55389
2017-04-24 16:17:17 -04:00
Jeffrey Stedfast f6ebca8ca9 [msbuild] Avoid Dictionary clashes in IBToolTask's mapping dictionary (#1981)
* [msbuild] Avoid Dictionary clashes in IBToolTask's mapping dictionary

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

* Added unit tests

* Fixed tabs vs spaces indent
2017-04-18 09:01:29 -04:00
Jeffrey Stedfast 3b4c6e720e [msbuild] Add support for passing extra args to btouch (#1969)
* [msbuild] Add support for passing extra args to btouch

Partial fix for https://bugzilla.xamarin.com/show_bug.cgi?id=51753

* [msbuild] Update the Mac ObjCBinding targets as well
2017-04-10 08:14:42 +02:00
Jeffrey Stedfast 15a97c7f2d [msbuild] Fixed PathUtils.AbsoluteToRelative() logic (#1861)
* [msbuild] Fixed PathUtils.AbsoluteToRelative() logic

Don't require the 'absolute' path argument to be a FullPath.

The code already calls Path.GetFullPath() on the 'absolute'
path anyway.

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

* Fixed ResolveSymbolicLinks() to return the input path if realpath() fails
2017-03-12 14:51:28 -04:00
Jeffrey Stedfast 15fa18eda3 [msbuild] Added logging for all of the overridden MSBuild default tasks (#1829) 2017-03-07 17:40:26 -05:00
Jeffrey Stedfast bfa5a9da56 [msbuild] ALWAYS log ibtool/actool exitCode != 0 as an error (#1840)
Log this as an error even if the log file does not exist and/or
is parseable.

Previously, it was possible that if the log file didn't exist
or it was perfectly validly formatted, we would never log that
error code and so it's possible that we wouldn't log *any*
error at all (e.g. empty log file).
2017-03-07 17:38:25 -05:00
Rolf Bjarne Kvinge 77fca2393d [msbuild] Fix error when building Xamarin.Mac binding projects. (#1834)
Xamarin.Mac binding projects would show this error:

> /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.ObjcBinding.CSharp.targets: error : Unknown target framework identifier: Xamarin.Mac.

while at the same time not actually failing the build (so nothing broke,
making it harder to notice).

The error is printed in BTouchTaskBase, which was previously only used for
Xamarin.iOS. Now we're using it for both Xamarin.iOS and Xamarin.Mac (in which
case it's subclassed), so make sure to not validate the
TargetFrameworkIdentifier according to only valid TargetFrameworkIdentifiers
for Xamarin.iOS.

This is accomplished by adding a new virtual overload to validate (and get the
right /target-framework argument for the generator), and override that method
in Xamarin.Mac's BTouch subclass.
2017-03-07 19:57:54 +01:00
Jeffrey Stedfast 1b2d24ed2c [msbuild] Remove an unused enum that causes confusion (#1798) 2017-03-01 10:21:52 -05:00
Jeffrey Stedfast 254f336536 [msbuild] Index into the correct item array when printing an error message (#1792)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52860

When the ImageAssets contain an item that doesn't live within
a *.xcassets directory, index into ImageAssets[] rather than
items[] which hasn't been populated yet.

Also fixed the tagsList for-loop to use tagsList.Count instead
for correctness (even though tags.Count and tagsList.Count
should always be identical).
2017-02-28 13:34:32 -05:00
Jeffrey Stedfast f7d750309b [msbuild] Ignore .DS_Store files when cloning asset catalogs (#1776)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52851

The problem here is that the .DS_Store file was included in
the .csproj file but did not exist on disk, so when we went
to clone that file into the obj/ dir before running actool
on it, File.Copy() would fail because the file did not
actually exist.

Since these files are worthless anyway, we can safely ignore
them.

Also added logic to verify that files exist before copying
them in order to report a better error than an exception
stack trace.
2017-02-27 16:12:23 -05:00
Rolf Bjarne Kvinge 88e0eb5fc8 [generator] Use target framework to determine the platform. (#1690)
This cuts down another group of conditional compilation sections, paving the
way for an IKVM-based generator.

This makes it required to pass --target-framework for to generator executables
(previously only required for Xamarin.Mac/Unified to distinguish between the
different Xamarin.Mac/Unified variants), but it should be invisible to users
since we'll automatically pass the correct --target-framework argument from
the corresponding scripts (btouch/btv/bwatch/bmac) and the MSBuild targets.
This will only break somebody who is executing the managed executables
directly, but nobody should do that in the first place (it's not a supported
scenario).

Generated diff: https://gist.github.com/rolfbjarne/1674be6625632446dba774a305951981
2017-02-17 14:53:58 -05:00
Jeffrey Stedfast f5b725e2af [msbuild] Added ProcessEnums property for ObjC Binding projects (#1557)
The new ProcessEnums property specifies whether or not to
pass /process-enums to the btouch task for iOS/Mac binding
projects.

Part of the fix for https://bugzilla.xamarin.com/show_bug.cgi?id=51753
2017-01-26 11:24:14 -05:00
Jeffrey Stedfast 4c5647150c [msbuild] Added support for <Link>'d ImageAsset project files (#1543)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=28106
2017-01-25 13:00:29 -05:00
Vincent Dondain 0b37471271 [msbuild] Only use File.GetLastWriteTimeUtc (#1547)
Instead of just using File.GetLastWriteTime.
Fixes bug #51694: Use File.GetLastWriteTimeUtc not File.GetLastWriteTime
https://bugzilla.xamarin.com/show_bug.cgi?id=51694
2017-01-23 15:31:44 -05:00
Jeffrey Stedfast 252b0dc3df [msbuild] Parallelized codesigning of *.dylibs and frameworks (#1528)
* [msbuild] Parallelized codesigning of *.dylibs and frameworks

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

* Disable timestamps for MtouchDebug builds
2017-01-20 11:28:34 -05:00
Jeffrey Stedfast 88364aac78 [msbuild] batch codesign resources to improve performance (#1522)
First step for https://bugzilla.xamarin.com/show_bug.cgi?id=51298
2017-01-18 15:12:14 -05:00
Jeffrey Stedfast e26ee5ca6c [msbuild] Refactor the IBTool task to be cleaner and more efficient (#1457)
[msbuild] Refactor the IBTool task to be cleaner and more efficient

Besides making the IBTool task cleaner and easier to understand,
a side-effect of this refactor was also to optimize the collecting
of the compiled outputs because we now only need to scan the
obj/ibtool directory once to collect each of the outputs.
2017-01-12 14:49:30 -05:00
Sebastien Pouliot 08c54f7914 [msbuild] Fix how UnpackLibraryResources handles mscorlib.dll (and potentially other framework assemblies) (#1011)
Target _UnpackLibraryResources:
	Task "UnpackLibraryResources"
		Using task UnpackLibraryResources from Xamarin.MacDev.Tasks.UnpackLibraryResources, Xamarin.MacDev.Tasks, Version=1.0.6128.15885, Culture=neutral, PublicKeyToken=null
		UnpackLibraryResources Task
		  Prefix: monotouch
		  IntermediateOutputPath: obj/iPhone/Debug/
		  NoOverwrite:
		    obj/iPhone/Debug/ibtool-link/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib
		    obj/iPhone/Debug/ibtool-link/LaunchScreen.storyboardc/Info.plist
		    obj/iPhone/Debug/ibtool-link/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib
		    obj/iPhone/Debug/ibtool-link/Main.storyboardc/BYZ-38-t0r-view-8bC-Xf-vdC.nib
		    obj/iPhone/Debug/ibtool-link/Main.storyboardc/Info.plist
		    obj/iPhone/Debug/ibtool-link/Main.storyboardc/UIViewController-BYZ-38-t0r.nib
		  ReferencedLibraries:
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.dll
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Xml.dll
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Core.dll
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
		    /Users/poupou/Downloads/LinkingTest-2/RMSDKWrapper/bin/Debug//RMSDKWrapper.dll
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS//mscorlib.dll
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS//mscorlib.dll
		  Skipping framework assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.dll
		  Skipping framework assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Xml.dll
		  Skipping framework assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Core.dll
		  Skipping framework assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
		  Inspecting assembly: /Users/poupou/Downloads/LinkingTest-2/RMSDKWrapper/bin/Debug//RMSDKWrapper.dll
		  Inspecting assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS//mscorlib.dll
		  Inspecting assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS//mscorlib.dll
	Done executing task "UnpackLibraryResources"
	Done building target "_UnpackLibraryResources" in project "/Users/poupou/Downloads/LinkingTest-2/LinkingTest/LinkingTest.csproj".

The above log excerpt shows two issues:

1. mscorlib.dll is needlessly inspected as it's **not** considered a
   "framework" assembly.

   The current check was checking *how* it was resolved and not *where*
   it was resolved to. The later is the most important as it's possible
   for other assemblies to have direct paths references and we do not
   want to process them.

   This is fixed by comparing each assembly path with the (now) provided
   `TargetFrameworkDirectory`

2. mscorlib.dll is inspected twice

   That's because it's present two times in the task's input. That issue
   is upstream (not sure why) of the current task but it makes #1 twice
   as costly. The fix for #1 indirectly fix that too.

Future
------

It's worth investigating to move that logic into `mtouch`. The later must
already load all assemblies and is in charge of removing other embedded
data (e.g. native code from bindings) from the assemblies (so they are not
shipped both inside and outside the .dll in the final .app). This makes
this task seems extraneous work.

Considering that my current test case, `RMSDKWrapper.dll`, is 1.3GB in
size it's easy to see that the extra load (which has nothing to be
extracted wrt resources*) is quite visible in build time.

>  3268.201 ms  UnpackLibraryResources                                  1 calls

* it has for bindings but that's already handled by mtouch
2017-01-10 15:03:00 -05:00
Jeffrey Stedfast 551c0be103 [msbuild] Use Xcode-specific versions of some command-line tools (#1462)
The `strip` command was already doing this, but `ar` and `dsymutil`
were using /usr/bin versions (which might not exist, depending on
the Xcode installation).
2017-01-10 13:58:22 -05:00
Jeffrey Stedfast 9c8a5fa28c [msbuild] Don't use a timestamped directory for the IPA (#1382)
* [msbuild] Don't use a timestamped directory for the IPA

After discussion with Mikayla Hutchinson and Madhuri Gummalla,
this naming convention is annoying to customers so just put
the *.ipa in the bin directory. This also has the added
benefit that the *.ipa will be cleaned up with /t:Clean

* [msbuild] Fixed wildcard expansion for deleting the *.ipa file

* [msbuild] Add the zipped *.ipa file to the FileWrites item group

* [msbuild] s/TaskProperty/TaskParameter/
2017-01-09 16:11:50 -05:00
Jeffrey Stedfast 6014967891 [msbuild] Make sure to use the *actual* filename generated by ibtool (#1442)
* [msbuild] Make sure to use the *actual* filename generated by ibtool

The problem is that since the Mac file system is case-insensitive,
File.Exists() will match "file~ipad.nib" even if the actual name
is "file~iPad.nib", so the only way to get the *actual* file name
is to scan the directory and do manual matching.

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

* Check that the dir exists before allocating other local variables
2017-01-06 13:34:21 -05:00
Jeffrey Stedfast 37d71511a3 [msbuild] Don't rewrite embedded.mobileprovision or archived-expanded… (#1359)
* [msbuild] Don't rewrite embedded.mobileprovision or archived-expanded-entitlements.xcent

This patch prevents those 2 files from being rewritten in
cases where the contents would not change from what was
already there previously.

This is a partial fix for https://bugzilla.xamarin.com/show_bug.cgi?id=49097

* [msbuild] Re-enabled the RebuildExecutable_NoModifications unit test

With the fixes to EmbedProvisioningProfile and CompileEntitlements,
this unit test now passes.
2016-12-15 15:59:55 -05:00
Jeffrey Stedfast 13f17660d2 [msbuild] Optimized provisioning profile lookups (#1360)
Fixes the Mac EmbedProvisionProfile task to not load every
single provisioning profile from disk in order to find the
requested provisioning profile.

Drops the need for wrappers around the use of MobileProvisionIndex
since it turns out that MobileProvisionIndex.GetMobileProvision()
already does the File.Exists() on name + ".mobileprovision" to
avoid needing to scan the index of provisioning profiles.
2016-12-15 14:39:24 -05:00
Vincent Dondain 887a410fe2 [msbuild] Add error codes for PropertyListEditorTaskBase (#1325)
* [msbuild] Add error codes for PropertyListEditorTaskBase

* [msbuild] Add task names in all errors' descriptions
2016-12-12 10:30:42 +01:00
Vincent Dondain 901b94d6e1 Merge pull request #1237 from VincentDondain/msbuild-mt-errors
[msbuild] Add msbuild error code logic
2016-12-08 12:50:58 -05:00
Jeffrey Stedfast 1e41bc3750 [msbuild] Added a PropertyListEditor task which works like PlistBuddy (#1306)
* [msbuild] Added a PropertyListEditor task which works like PlistBuddy

This is a convenience Task for customers and isn't currently used
by the core MSBuild targets.

* [msbuild] The PropertyListEditor task does not need a SessionId property

* [msbuild] Added support for non-container root plist elements

* [msbuild] Catch & log exceptions loading plist document
2016-12-06 13:29:31 -05:00
Emanuel dfcea77a69 Changes GetVirtualProjectPath to make relative paths when building from VS
This change fixes the build of solutions that contain Shared Projects with BundleResources from VS. In that case the ItemSpec of the BundleResource is the full Windows path, so we ended up with an invalid path.

Fixes Bug #47570 - On building "FilterDemoApp", it gives "path's format is not supported" build error.

https://bugzilla.xamarin.com/show_bug.cgi?id=47570
2016-11-30 11:40:20 -03:00
Vincent Dondain 8ea1509dec [msbuild] Add msbuild error code logic
- `LoggingExtensions` has a new `MTError` extension method that helps generate
  an msbuild error with the proper MTxxx format.
- Added error codes for 44 msbuild errors.
- Updated `docs/website/mtouch-errors.md` and `tools/mtouch/error.cs` accordingly.
- MT7001 contains some extra documentation (troubleshooting steps).
2016-11-24 15:24:30 +01:00
Jeffrey Stedfast 19ae097f79 [msbuild] Log warnings and errors for the ibtool --link stage as well (#1188)
* [msbuild] Log warnings and errors for the ibtool --link stage as well

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

* [msbuild] Only need to log warnings and errors when ibtool returns error in --link phase

* [msbuild] Don't log empty errors from ibtool

* [msbuild] Moved LogWarningsAndErrors() logic into XcodeCompilerToolTask.Compile()

* [msbuild] Tweak minor glitches

- rc is not needed anymore since we don't *yet* do anything with the error code.
- copy&paste issue on the LogError.
2016-11-16 16:20:51 -05:00
Vincent Dondain c76fd77ac0 [msbuild] Don't replace * by bundle id in entitlements (#1147)
- Fixes bug #46298: Xamarin seems to replace asterisk with bundle id in Entitlements.plist file
  https://bugzilla.xamarin.com/show_bug.cgi?id=46298

The CompileEntitlementsTaskBase logic is still good wrt TeamIdentifierPrefix, AppIdentifierPrefix and CFBundleIdentifier
replacements but asterisks that represent wildcards shouldn't be replaced. Note that Apple doesn't do it in Xcode either.

* [msbuild/test] Add CompileEntitlementsTaskTests

Makes sure that for a given Entitlement.xcent and provisioning profile in input and output the right thing.

These tests also cover the changes made in e32efb0310
in response to bug #46298 (https://bugzilla.xamarin.com/show_bug.cgi?id=46298).
2016-11-11 20:18:14 -05:00
Rolf Bjarne Kvinge 3351e2a633 Add a 'repositorypath' to our NuGet.Config and update paths everywhere accordingly. (#1110)
This makes us only put packages in one directory (saves disk space and time),
and it also makes project files in multiple solutions work properly
(mtouch.csproj is in tests/tests.sln and tests/mtouch/mtouch.sln).
2016-11-04 09:13:33 +01:00
Jeffrey Stedfast 146e7b3962 [msbuild] Allow Provisioning Profile lookups by name and use only the most recent version
Use the 'unique' argument to MobileProvisionIndex's lookup methods
to only get back the most recent versions of each provisioning
profile so that we don't accidentally pick an older version.
2016-11-01 12:27:18 -04:00
Chris Hamons 612f52bd80 Fix binding project LinkWithAttributes generation to prevent unnecess… (#1029)
* Fix binding project LinkWithAttributes generation to prevent unnecessary rebuilds

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

* Remove duplicate ToString call
2016-10-31 10:37:10 +01:00
Sebastien Pouliot 8c93e7758d Merge branch 'xcode8.1' 2016-10-26 15:56:34 -04:00
Emanuel d8362f6ff6 Fixes Bug #44724 - Failed to read file attributes for "/Users/admin/Assets.xcassets" (#1039)
The ProjectDir could exist under certain circumstances (e.g. referenced assemblies are being copied to the Mac in the same folder path that those are located in Windows) so we cannot assume the existence or not of ProjectDir means the build comes from VS.

The only way to ensure we're building from VS is to check the SessionId parameter.

https://bugzilla.xamarin.com/show_bug.cgi?id=44724
2016-10-26 13:08:11 -04:00
Rolf Bjarne Kvinge 1e4b395368 Revert "Fix binding project LinkWithAttributes generation to prevent rebuilds" (#1018) 2016-10-24 07:13:51 +02:00
Chris Hamons a8daab7cdd Fix binding project LinkWithAttributes generation to prevent unnecessary rebuilds (#1017)
- https://bugzilla.xamarin.com/show_bug.cgi?id=45762
2016-10-21 18:24:15 -04:00
Jeffrey Stedfast 03e44859b3 [msbuild] Drop the fancy Mono.Unix logic and just call realpath() once (#967) 2016-10-10 10:24:41 +02:00
Jeffrey Stedfast 8da5e2b538 [msbuild] Require Xcode >= 7.2 in order to make use of ibtool --link (#851)
I'm not 100% sure when --link was added to ibtool, but since our
release notes say that we now require Xcode >= 7.2 anyway, might
as well make that version a requirement for ibtool --link

(Based on forum comments, we know it didn't exist in Xcode 7.0 Beta 3)
2016-09-20 12:34:03 +02:00
Jeffrey Stedfast 9ba3bf77a0 Cycle8 msbuild codesign simulator no cert (#835)
* [msbuild] Even iOS Simulator builds now require signing certificates (#809)

Now that dylibs and frameworks are required to be signed in order to
run on the Simulator, we cannot allow the DetectSigningIdentity task
to return success if it didn't find a codesign key.

* [msbuild] Allow codesigning Simulator builds w/o the need of a developer cert (#833)
2016-09-16 13:17:52 -04:00
Jeffrey Stedfast 0eda3276b7 [msbuild] Allow codesigning Simulator builds w/o the need of a developer cert (#833) 2016-09-14 15:43:25 -04:00
Sebastien Pouliot 38148c718a Merge branch 'xcode8' 2016-09-09 15:29:37 -04:00
Jeffrey Stedfast b8a90fd243 [msbuild] Even iOS Simulator builds now require signing certificates (#809)
Now that dylibs and frameworks are required to be signed in order to
run on the Simulator, we cannot allow the DetectSigningIdentity task
to return success if it didn't find a codesign key.
2016-09-09 19:14:05 +02:00
Vincent Dondain e4093d5908 [msbuild] ACTool update for iMessage Extension (#778) 2016-09-07 00:59:45 +02:00
Jeffrey Stedfast 791423f4f1 [msbuild] Add the Insights API Key to the iOS archive manifest (#656)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43489
2016-08-25 11:45:55 -04:00
Jeffrey Stedfast 248635f5a7 [msbuild] Add the Insights API Key to the iOS archive manifest (#656)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43489
2016-08-24 16:29:46 -04:00
Daniel Cazzulino a744c7ad51 [msbuild] Add forward compatibility with symlinks support (#649)
See https://github.com/Microsoft/msbuild/issues/928
2016-08-23 15:35:57 -04:00
Daniel Cazzulino d45f52f1c1 [msbuild] Add forward compatibility with symlinks support (#648)
See https://github.com/Microsoft/msbuild/issues/928
2016-08-23 15:35:16 -04:00
Jeffrey Stedfast 67bdff568b [msbuild] code cleanup (#607) 2016-08-15 15:07:34 -04:00
Jeffrey Stedfast f3199064d4 [msbuild] Properly locate .nib files produced for iOS 5.x (#241)
iOS 5.x uses .nib files and not directories.
2016-06-20 14:11:39 -04:00
Jeffrey Stedfast ff381fe6f5 [msbuild] Support ibtool output when it adds ~ipad or ~iphone modifiers (#200)
* [msbuild] Support ibtool output when it adds ~ipad or ~iphone modifiers

When targetting older iOS versions (such as iOS 7) for multiple
device targets (e.g. iphone, ipad, etc), ibtool will output
multiple directories using the basename of the original ib file
and add ~ipad or ~iphone blurbs to the filename.

This was causing the linking step to fail due to paths not being
found at the expected locations.

* [msbuild] Added unit tests for ibtool --link w/ --minimum-deployment-target 7.0

Since pre-iOS 8.0 does not support size classes in storyboards,
ibtool will output LaunchScreen~ipad.nib and LaunchScreen~iphone.nib.

This test will fail if the IBTool logic does not properly determine
the outputs to pass to a final ibtool --link command to link all of
the storyboards together.
2016-06-16 14:17:25 -04:00
Daniel Cazzulino 136b9a43b4 [msbuild] Unify and relocate shared MSBuild overriden tasks (#179)
* [msbuild] Remove unnecessary duplicate implementation of Move

Our implementation of the Move task was a partial copy of what
the MSBuild Move task does: https://github.com/Microsoft/msbuild/blob/master/src/XMakeTasks/Move.cs

Remove the unnecessary code, make it inherit the base implementation
like we do for the other MSBuild-overriden tasks, and place it in a
corresponding MsBuildTasks folder to denote this (again, like we do
in iOS.Tasks).

Removing this (unnecessary IMO) custom implementation of Move
ensures that when we switch to MSBuild, we can leverage improvements
and fixes on the task automatically.

* [msbuild] Move all the common MSBuild overriden tasks to MacDev

These tasks previously existed in iOS.Tasks, and Mac.Tasks. Since
they are reused across iOS and XM targets, move them to the common
MacDev project and update the targets accordingly.
2016-06-13 15:07:18 -04:00
joj 28bb84d62b Added missing SessionId to CreateInstallerPackage (#170)
* [build] Moved CreateInstallerPackage to Core

* [build] Converted CreateInstallerPackage into a base with SessionId
2016-06-10 11:32:41 -04:00
Jeffrey Stedfast 7d6bec05f1 [msbuild] Make Mac IBTool logic consistent with iOS logic (#127)
Fixes bug #41486
2016-06-03 13:55:44 -04:00
Jeffrey Stedfast 582101a996 Macios symbolicate (#74) 2016-05-31 11:57:47 -04:00
Chris Hamons ca028ea150 [Mac] Add support for os x extensions (#83) 2016-05-25 17:20:33 -04:00
Jeffrey Stedfast 0d184bb187 [msbuild] Bump task projects to use .NET 4.5 instead of 4.0 (#78)
* [msbuild] Bump task projects to use .NET 4.5 instead of 4.0

Needed so that we can reference .NET 4.5 projects/assemblies
2016-05-25 14:06:20 -04:00
Jeffrey Stedfast 88bf794559 [msbuild] Fixed logic for building WatchOS storyboards (#75)
Starting with Xcode 7, storyboards are output as
Interface.storyboardc/Interface.plist instead of Interface.plist

We can also safely link these storyboards as long as we pass
the storyboardc directory to ibtool.
2016-05-25 11:16:41 +02:00
Jeffrey Stedfast e1e358a402 Merge pull request #45 from jstedfast/ibtool-link
[msbuild] Link storyboards as part of the IBTool task if Xcode >= 7.0
2016-05-23 16:41:26 -04:00
Jeffrey Stedfast 87153e47c0 [msbuild] Don't treat unsupported iCloud entitlements as errors in the build (#46)
Fixes bug #40961
2016-05-13 11:19:49 +02:00
Jeffrey Stedfast 7ee37c1803 [msbuild] Link storyboards as part of the IBTool task if Xcode >= 7.0
Fixes issue #40583
2016-05-12 15:24:54 -04:00
Jeffrey Stedfast 351d429273 [msbuild] Fixed Optimize metadata parsing logic for BundleResources
Fixes bug #41019
2016-05-11 12:03:15 -04:00
Rolf Bjarne Kvinge 68df944ad6 Build MSBuild targets & assemblies. 2016-04-24 14:48:44 -04:00