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

1386 Коммитов

Автор SHA1 Сообщение Дата
Emanuel 35e1985350 [bug] Use Identity instead of FullPath on _CompressObjCBindingNativeFrameworkResources target (#2498)
Using the FullPath property breaks the build from Windows, since the metadata will contain a Windows path.

Partial fix for Bug #51759 - Getting build error for iOS sample 'Simpleapp-with-framework'

https://bugzilla.xamarin.com/show_bug.cgi?id=51759
2017-08-16 16:26:32 -04:00
Chris Hamons 58a38860d7 [macos] System mono should resolve non-XM libraries from system (#2480) (#2494)
- https://bugzilla.xamarin.com/show_bug.cgi?id=58703
- Was broken on msbuild but undetected due to https://bugzilla.xamarin.com/show_bug.cgi?id=53164
- Unified45Build_CompileToNativeOutput was broken in a recent commit bf53e6204d0950acd5f8efcce8732bd8d8
- This was not caught as the mmp tests are not run by default
- The test was bad/wrong, and checking msbuild not mmp ouput anyway, so fixing.
2017-08-15 11:58:28 -05:00
Chris Hamons e5d012c5b8 [macos] System mono should resolve non-XM libraries from system (#2480)
- https://bugzilla.xamarin.com/show_bug.cgi?id=58703
- Was broken on msbuild but undetected due to https://bugzilla.xamarin.com/show_bug.cgi?id=53164
- Unified45Build_CompileToNativeOutput was broken in a recent commit bf53e6204d0950acd5f8efcce8732bd8d8
- This was not caught as the mmp tests are not run by default
- The test was bad/wrong, and checking msbuild not mmp ouput anyway, so fixing.
2017-08-14 13:17:10 -05:00
joj b7c74fba16 Merge pull request #2430 from joj/master
Avoid duplicating define constants if they exist
2017-08-10 16:40:14 -03:00
joj 71f0c1ca56 Workaround Conditions in xbuild
This is part of PR 2430: avoid duplicating degine constants if they exist. This commit splits the condition and definition of the properties in two, because xbuild doesn't support the regex part in a condition. msbuild does, but we need to support both.
2017-08-10 14:20:12 -03: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 8b37b09ac6 [msbuild][mac] Fix #58479: Assign project configurations for IDE case (#2396) (#2413)
https://bugzilla.xamarin.com/show_bug.cgi?id=58479

_AssignAppExtensionConfiguration assigns project configuration from
`$(CurrentSolutionConfigurationContents)`, using the
`AssignProjectConfiguration` task, which is set if
`$(BuildingSolutionFile)` or `$(BuildingVisualStudio)` is true. We check
only for the former. It would be simpler to just check for ..

	`$(CurrentSolutionConfigurationContents) != ''`

.. like the iOS targets. This mapping from this task is used when
invoking `GetBundleTargetPath` on the extension project:

	Properties="%(_AppExtensionReferenceWithConfigurationExistent.SetConfiguration); %(_AppExtensionReferenceWithConfigurationExistent.SetPlatform)"

Details:

This failed for a project that had a reference to an app extension
project, with VSMac/msbuild. The app extension project was being built
with `Configuration==Debug` and `Platform==x86` for which the project
does not define any properties (like `$(OutputPath)`).

When the main project is built, we invoke `GetBundleTargetPath` on
the extension project, which in this case, has a different
config+platform mapping than the one for the referencing project. But
since the earlier `AssignProjectConfiguration` was skipped due to the
incorrect condition, `GetBundleTargetPath` is invoked with no
config+platform, thus falling back to extension project's defaults.

Note: The referencing project was being built with Debug|x86 and the
referenced project was expected to be built with Debug|AnyCPU .

This project:

- VSMac/xbuild - Works
	- This happens to work because the default from the extension
	  project is Debug|AnyCPU, so even though
	  `AssignProjectConfiguration` didn't set those properties, it
	  builds just fine.

- command line xbuild/msbuild - works!
	- `AssignProjectConfiguration` works because this time the
	  condition `$(BuildingSolutionFile) == 'true'` is True.

- VSMac/msbuild - fails
	- In this case, the default case does not work because in VSMac,
	  we use `SetGlobalProperty` to set config+platform properties
	  when starting the build for the referencing project.

	- And when the referencing project builds the referenced project
	  (via `GetBundleTargetPath`), it is built with config+platform
	  global properties set, and thus defaults from the referenced
	  don't get picked up!

	  	<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>

	- With the `AssignProjectConfiguration` fix, we set the
	  properties via the `MSBuild` task, so it works.
	  But this needs to be fixed in VSMac anyway.
2017-08-03 16:04:44 -05:00
joj ba4e3fba26 Made replacement more resilient
The previous change had the fault of considering __UNIFIED__ANYTHING__ the same as __UNIFIED__ and if a user set that property, then he would lose the other (pointed out by jstedfast in the PR).
This commit fixes that.
2017-08-03 16:29:27 -03:00
joj ce334f5e42 Avoid duplicating define constants if they exist
In VS the property page for Build will show whatever is in DefineConstants, and then save it. Without this, that means that any time the Build page is saved, it duplicates the constants.
This fixes bug#32765: Bug 32765 - Conditional compilation symbols are duplicated everytime I reload the project or restart visual studio (https://bugzilla.xamarin.com/show_bug.cgi?id=32765)
2017-08-03 15:24:17 -03:00
Ankit Jain f4c64ad8c2 [msbuild][mac] Fix #58479: Assign project configurations for IDE case (#2396)
https://bugzilla.xamarin.com/show_bug.cgi?id=58479

_AssignAppExtensionConfiguration assigns project configuration from
`$(CurrentSolutionConfigurationContents)`, using the
`AssignProjectConfiguration` task, which is set if
`$(BuildingSolutionFile)` or `$(BuildingVisualStudio)` is true. We check
only for the former. It would be simpler to just check for ..

	`$(CurrentSolutionConfigurationContents) != ''`

.. like the iOS targets. This mapping from this task is used when
invoking `GetBundleTargetPath` on the extension project:

	Properties="%(_AppExtensionReferenceWithConfigurationExistent.SetConfiguration); %(_AppExtensionReferenceWithConfigurationExistent.SetPlatform)"

Details:

This failed for a project that had a reference to an app extension
project, with VSMac/msbuild. The app extension project was being built
with `Configuration==Debug` and `Platform==x86` for which the project
does not define any properties (like `$(OutputPath)`).

When the main project is built, we invoke `GetBundleTargetPath` on
the extension project, which in this case, has a different
config+platform mapping than the one for the referencing project. But
since the earlier `AssignProjectConfiguration` was skipped due to the
incorrect condition, `GetBundleTargetPath` is invoked with no
config+platform, thus falling back to extension project's defaults.

Note: The referencing project was being built with Debug|x86 and the
referenced project was expected to be built with Debug|AnyCPU .

This project:

- VSMac/xbuild - Works
	- This happens to work because the default from the extension
	  project is Debug|AnyCPU, so even though
	  `AssignProjectConfiguration` didn't set those properties, it
	  builds just fine.

- command line xbuild/msbuild - works!
	- `AssignProjectConfiguration` works because this time the
	  condition `$(BuildingSolutionFile) == 'true'` is True.

- VSMac/msbuild - fails
	- In this case, the default case does not work because in VSMac,
	  we use `SetGlobalProperty` to set config+platform properties
	  when starting the build for the referencing project.

	- And when the referencing project builds the referenced project
	  (via `GetBundleTargetPath`), it is built with config+platform
	  global properties set, and thus defaults from the referenced
	  don't get picked up!

	  	<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>

	- With the `AssignProjectConfiguration` fix, we set the
	  properties via the `MSBuild` task, so it works.
	  But this needs to be fixed in VSMac anyway.
2017-08-03 08:59:42 +02:00
Rolf Bjarne Kvinge 75155be059 [msbuild] Strip frameworks better. (#2305) (#2400)
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-08-02 16:06:49 +02:00
Sebastien Pouliot 35765ecc0f Merge d15-3 (#2322)
* [msbuild] Re-added wildcard (*) expandsion for application-identifier in Entitlements.plist (#2186)

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

* Bump mono (#2213)

* Framework tests were still binding non-linked Simple class which errors now (#2216) (#2218)

- Improve Makefile to rebuild when projects build with errors

* Bump mono to get cecil fix for bug #56808. (#2222)

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

* [msbuild] Use @(ReferencePath) instead of @(ResolvedFiles) (#2188) (#2214)

This allows things to work on both xbuild and msbuild.

In xbuild, both lists are exactly the same and on msbuild,
only @(ReferencePath) exists.

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

* NSActivityOptions.IdleDisplaySleepDisabled had wrong value (#2232) (#2239)

This was due to an integer overflow.  The original value was based on Int32
1 << 40 == 256

The correct value should be based on a UInt64.
1UL << 40 == 1099511627776

* [tests] Fix bug 57699 - [iOS]InternalsTest failure (Linkall) tests on device (#2243)

Strip native debugging symbols should not be checked for debug builds

* Bump mono to get fix for bug #57780.

https://bugzilla.xamarin.com/show_bug.cgi?id=57780
2017-07-13 08:16:25 -04:00
Rolf Bjarne Kvinge 981af59058 [mtouch] Don't allow building for 32-bit when deployment target is >= 11. Fixes #57966. (#2303)
* [mtouch] Don't allow building for 32-bit when deployment target is >= 11. Fixes #57966.

Also bump maccore to get an mlaunch error for launching a 32-bit app in a 64-bit-only simulator.

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

* [tests][msbuild] Make sure all Info.plists have deployment targets.

Otherwise we get different behavior (32-bit allowed or not) depending on which
Xcode is used to build.

* [mtouch] Default to 64-bit arch if not specified and targeting iOS 11+.

* [tests] Tweak tests to either specify a deployment target < 11 or not build a 32-bit arch.
2017-07-11 08:54:50 +02: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 6351aef095 [msbuild] Don't define __IOS__ for tvOS binding projects (#2274)
* [msbuild] Don't define __IOS__ for tvOS binding projects

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

* minor fixups

* Conditional compilation.
2017-06-30 12:35:48 -04:00
Jeffrey Stedfast 5d6d244d04 [msbuild] Properly generate dSYMs for WatchKit2 appex's (#2215)
* [msbuild] Properly generate dSYMs for WatchKit2 appex's

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

* dSYMs only get generated for iPhone

* Reverted accidental change to mono
2017-06-15 14:03:37 -04:00
Jeffrey Stedfast f010926615 [msbuild] Use @(ReferencePath) instead of @(ResolvedFiles) (#2188)
This allows things to work on both xbuild and msbuild.

In xbuild, both lists are exactly the same and on msbuild,
only @(ReferencePath) exists.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55147
2017-06-12 13:29:45 -05:00
Rolf Bjarne Kvinge 9356b53410 [msbuild] Fix MSBuild tests to build using Xcode 9. (#2201)
Set the min deployment target to 7.0 for a test to make sure ibtool doesn't
complain, and fix the list of expected bundle resources by adding Assets.car
to the list.

Fixes the following failures:

1. Xamarin.iOS.Tasks.TargetTests.BuildExecutable :   #RunTarget-ErrorCount

    	ibtool exited with code 1
    	Compiling IB documents for earlier than iOS 7 is no longer supported.
      Expected: 0
      But was:  2

2. Xamarin.iOS.Tasks.TargetTests.BundleResources :   #RunTarget-ErrorCount

    	ibtool exited with code 1
    	Compiling IB documents for earlier than iOS 7 is no longer supported.
      Expected: 0
      But was:  2

3. Xamarin.iOS.Tasks.TargetTests.CleanExecutable :   #RunTarget-ErrorCount

    	ibtool exited with code 1
    	Compiling IB documents for earlier than iOS 7 is no longer supported.
      Expected: 0
      But was:  2

4. Xamarin.iOS.Tasks.TargetTests.CopyContentToBundle :   #RunTarget-ErrorCount

    	ibtool exited with code 1
    	Compiling IB documents for earlier than iOS 7 is no longer supported.
      Expected: 0
      But was:  2

5. Xamarin.iOS.Tasks.TargetTests.Disappearing_Bundle_Resource :   #2

      Expected: True
      But was:  False

6. Xamarin.iOS.Tasks.TargetTests.Disappearing_Content :   #2

      Expected: True
      But was:  False

7. Xamarin.iOS.Tasks.TargetTests.OptimizePngs_DefaultValue :   #RunTarget-ErrorCount

    	ibtool exited with code 1
    	Compiling IB documents for earlier than iOS 7 is no longer supported.
      Expected: 0
      But was:  2

8. Xamarin.iOS.Tasks.TargetTests.OptimizePngs_False :   #RunTarget-ErrorCount

    	ibtool exited with code 1
    	Compiling IB documents for earlier than iOS 7 is no longer supported.
      Expected: 0
      But was:  2

9. Xamarin.iOS.Tasks.TargetTests.OptimizePngs_True :   #RunTarget-ErrorCount

    	ibtool exited with code 1
    	Compiling IB documents for earlier than iOS 7 is no longer supported.
      Expected: 0
      But was:  2

10. Xamarin.iOS.Tasks.TargetTests.RebuildExecutable_NoModifications :   #RunTarget-ErrorCount

    	ibtool exited with code 1
    	Compiling IB documents for earlier than iOS 7 is no longer supported.
      Expected: 0
      But was:  2

11. Xamarin.iOS.Tasks.TargetTests.RebuildExecutable_TouchLibraryDll :   #RunTarget-ErrorCount

    	ibtool exited with code 1
    	Compiling IB documents for earlier than iOS 7 is no longer supported.
      Expected: 0
      But was:  2

12. Xamarin.iOS.Tasks.TargetTests.UnpackLibraryResources_ExecutableProject :   #RunTarget-ErrorCount

    	ibtool exited with code 1
    	Compiling IB documents for earlier than iOS 7 is no longer supported.
      Expected: 0
      But was:  2
2017-06-10 04:04:26 -07: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 34cca2e276 [msbuild] Strip debug symbols even if MtouchDebug is true (#2160)
* [msbuild] Strip debug symbols even if MtouchDebug is true

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

* Strip frameworks as well
2017-06-02 11:00:11 -04:00
Jeffrey Stedfast 36d5bc3271 [msbuild] Remove the dSYMs dir when re-cloning the *.appex so it triggers a new strip (#2152)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=56483
2017-06-01 17:25:53 +02:00
Chris Hamons 0be72f3c13 [macos] Fix target framework detection issues in mmp (#2096)
- Also detect mismatches between referenced XM.dll and target framework selected
2017-05-30 09:23:28 -05: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
Rolf Bjarne Kvinge 264cce0343 [tests][msbuild] Fix compiler warning. (#2118)
Fixes:

TestHelpers/TestBase.cs(279,53): warning CS0642: Possible mistaken empty statement
2017-05-23 19:56:57 +02:00
Alex Soto e8aa3db9cb [msbuild] Remove BTouchReferencePath in order to fix bug 56317 (#2105)
https://bugzilla.xamarin.com/show_bug.cgi?id=56317

BTouchReferencePath scans for satellite assemblies and brings
dlls that are not referenced from within the binding project and
this causes compiler error CS1704 when dlls that contain
localized resources and said dlls are named equally.

* [msbuild][tests] Add testcase for bug 23674 to avoid regresions

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

* [msbuild][tests] Add testcase for bug 56317

https://bugzilla.xamarin.com/show_bug.cgi?id=56317
2017-05-19 15:34:05 -04:00
Sebastien Pouliot 845f365c91 [mmp] Add support for linking only the platform (Xamarin.Mac.dll) assembly on the full profile (#1990)
Replace https://github.com/xamarin/xamarin-macios/pull/1973 expect that
the test parts are still needed.

* Add XM SDK + LinkSkip test

* [macos] Add platform linking support to msbuild

* [macos] Add full SDK test

* [macios] Diable classic from using linkplatform

- Extended test infrastructure change to allow classic projects that include bundling
- Setting linkplatform in MonoBundlingExtraArgs since we don't even read project setting LinkMode - Platform for classic
2017-05-16 18:05:26 -04:00
Chris Hamons 30cf1fd626 [macos] Fix Multiple Native References (#2073)
- https://bugzilla.xamarin.com/show_bug.cgi?id=56098
- "%(NativeReference) was invoking mmp task multiple times incorrectly, move to what XI is doing
2017-05-16 09:59:55 -05:00
Vincent Dondain 471d4b8a94 [msbuild] Pass -float32 to aot-options if UseFloat32 = false (#2061)
The runtime team is going to change the default for the float 32 option.
Therefore, to avoid breaking users who are currently **not** using this option,
we need to force the use of `-float32`.

* Add new test to cover UseFloat32 = false
2017-05-03 16:34:46 -04:00
Jeffrey Stedfast 1429fe6955 [msbuild] Remove stale CodeSignatures when cloning appex's into parent app bundle (#2057)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55676
2017-05-01 14:11:21 -04:00
Rolf Bjarne Kvinge 1eb6c335a6 [mtouch] Disable incremental builds for the simulator. Fixes #55712. (#2054)
It does not make sense to support incremental builds for the simulator (since
no AOT compilation is done), it just makes the test matrix more complicated.

So simplify things by removing support for incremental builds.

We also ignore any (other) --assembly-build-target arguments, because building
to frameworks doesn't make sense either in the simulator.

https://bugzilla.xamarin.com/show_bug.cgi?id=55712
2017-04-28 13:34:37 -04:00
Rolf Bjarne Kvinge e9ce55aac2 [msbuild] Define __MACOS__ for Xamarin.Mac. Fixes #36258. (#2048)
https://bugzilla.xamarin.com/show_bug.cgi?id=36258
2017-04-27 14:40:00 -04:00
Jeffrey Stedfast 46692cdd13 [msbuild] Don't override the OnDemandResourcesUrl if previously set (#1970)
This change allows users to specify a custom URL for hosting their
OnDemand Resources.
2017-04-24 16:31:36 -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
Vincent Dondain 9c5f7f8f71 [msbuild] Fix DetectSdkLocationsTaskBase platform check (#2029)
For windows, ideSdkPath was defined twice.
Also the base tasks are being built only on the Mac, VSW get those from the bundle.zip, so the Windows check should be done at runtime.
2017-04-19 16:41:34 -04:00
Jeffrey Stedfast d32cae66b7 [msbuild] Fixed msbuild logic to properly codesign watchos2 intents extensions (#2024)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=55316
2017-04-19 08:19:29 -04:00
Vincent Dondain 47129dae70 [msbuild] Improve DetectSdkLocationsTaskBase error log (#2012)
First: only run `EnsureSdkPath` if `EnsureAppleSdkRoot` passed.
    Both are based on similar install checks, `SdkIsInstalled` (used for `SdkIsInstalled`) is empty
    if `IsInstalled` (used by `EnsureAppleSdkRoot`) is false.
    This avoid having 2 error messages when only 1 at a time is needed.

Second: improved `EnsureAppleSdkRoot` error message mentioning the wrong Xcode developer path (which triggered the error)
    as well as the exact way to fix it.
2017-04-18 16:51:43 -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 0fe6c076d5 [msbuild] Don't force mcs for building Xamarin.Mac apps (#1994) 2017-04-12 16:01:35 -04:00
Jeffrey Stedfast 52aba009f1 [msbuild] Enable device-specific builds for appex's (#1974) 2017-04-11 08:17:54 +02:00
Rolf Bjarne Kvinge fe5c62410d [msbuild] Fix running bgen for Xamarin.Mac. (#1977)
bgen must be executed with the system mono, not bmac-mobile-mono, and without
the MONO_PATH variable set.
2017-04-10 16:34:49 +02: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
Sebastien Pouliot 7d930369af Revert "[msbuild] Don't override the OnDemandResourcesUrl if previously set (#1963)"
This reverts commit 46e8bd00ef.
2017-04-06 14:43:16 -05:00
Jeffrey Stedfast 46e8bd00ef [msbuild] Don't override the OnDemandResourcesUrl if previously set (#1963)
This change allows users to specify a custom URL for hosting their
OnDemand Resources.
2017-04-06 12:57:32 -04:00
Rolf Bjarne Kvinge b568b2541e [builds] Improve mono/llvm dependencies. (#1948)
* [builds] Improve mono/llvm dependencies.

* Create a list of all the files in the mono and llvm repositories, and save
  these lists as a Make variable (in a generated Makefile - .deps.*.mk). We
  don't list _all_ the files in each repository, because there are quite a few
  (55k for mono), and Make measurably takes a while to check all of them, so
  try to limit it to a sane subset, without risking missing changes to files
  that actually matters.

* Always create stamp files when we're done with mono builds.

* Modify the mono/llvm builds to depend on all the files in their
  repositories.

* Explicitly list the corresponding .stamp-build-* files as dependencies for
  various files that are produced by the mono builds, so that make knows how
  to build these files.

* Rewrite the *-facade-check targets to depend on the corresponding
  *_BCL_TARGETS, so that we can avoid running a submake to the same Makefile
  to execute the facade checks.

  It now takes a little while (less than a second on my machine, which is
  fine) for make to list all dependencies and get their timestamps, but if
  executing multiple submakes this adds up to a multi-second timewaste.

  So avoid the timewaste by not doing submakes, but instead use dependencies
  to enforce the required target execution ordering.

* Don't depend on nicely named intermediate targets, since won't prevent
  rebuilds:

      build-cross64: setup-cross64

  Since the `setup-cross64` file doesn't exist, `build-cross64` will always
  execute. Instead depend on the stamp file:

      build-cross64: .stamp-configure-cross64

  And now `build-cross64` will only rebuild if needed.

* Don't try to list all intermediate files as .SECONDARY dependencies, instead
  list none at all, which works as if all files were listed as dependencies.

* Some targets had to move later in the file, since variables used in dependencies:

       foo: $(VARIABLE)

  must be defined before that point in the file, as opposed to variables used in recipes:

       foo:
           $(MAKE) $(VARIABLE)

  can be defined anywhere in the Makefile.

* Simplify the targets that sign assemblies significantly.

There are a few end results:

* It's now possible to do `make install`, without doing `make all` first. This
  might seem weird, but that also ensures the more common `make all install`
  works properly.

* Remakes (without any mono/llvm changes) in build/ are much faster, because
  we now won't recurse into every mono build:

      $ time make all -C builds/ -j8
      [...]
      real  0m1.873s

  This even means that we might be able to make it a habit to remake in the
  root directory, which doesn't take forever now:

      $ time make all -j8
      [...]
      real  0m4.521s

  Unfortunately adding `make install` to the mix still does some useless
  stuff, and it ends up taking ~30 seconds to complete a full build:

      $ time make all install -j8
      [...]
      real  0m32.542s

* [msbuild] Don't verify the xml syntax of targets files unless the files change.

* [build] Don't depend on installed files.

Don't depend on installed files, because that causes a rebuild when installing
to a different directory (i.e. package creation).

* Bump maccore to get build improvements.

Rebuilds are now very fast:

    $ make all install -j8
    $ time make all install -j8
    real	0m5.735s

Less than 6s to figure out that nothing needs to be done.

And strangely flushing the disk cache doesn't make it much slower:

    $ sudo purge
    $ time make all install -j8
    real	0m7.309s

Which probably means that Make mostly reads file metadata, and not actual file
contents (which is good).
2017-03-31 20:23:38 +02:00
Rolf Bjarne Kvinge 2a7e1c5497 [tests][msbuild] Teach tests about new potential location for assemblies. (#1951) 2017-03-31 11:18:50 +02:00
Chris Hamons 1ec3849617 [macos] Fix msbuild issues with shprojj/projitem library (#1936)
- In some build cases this chunk of code:

    <ItemGroup Condition=" '$(NoCompilerStandardLib)' == 'true' and '$(NoStdLib)' != 'true' ">
          <!-- Note that unlike VB, C# does not automatically locate System.dll as a "standard library"
               instead the reference is always passed from the project. Also, for mscorlib.dll
               we need to provide the explicit location in order to maintain the correct behaviour
     -->
        <_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
    </ItemGroup>

would trigger and force us to use mscorlib from system mono. That does not work well.
- By setting FrameworkPathOverride, we can get the right mscorlib
- However, that ItemGroup happens outside of a target, so we must move our setting to match for it to take effect
2017-03-30 15:04:21 -05:00
Sebastien Pouliot 0dfcb1f09f Merge branch 'master' into mono-2017-02 2017-03-28 21:31:33 -05:00
Alex Soto efceb473f6 [msbuild] Allow extensions bundle other extensions (#1810)
watchOS 3.2 introduced SiriKit extension that must be bundled
inside the Watch App Extension (yep a extension inside another extension).

So the _ResolveAppExtensionReferences and _CopyAppExtensionsToBundle should
now be run on extension projects too.
2017-03-28 10:08:02 -05:00
Rolf Bjarne Kvinge 26aa29ebd0 Merge remote-tracking branch 'origin/master' into mono-2017-02 2017-03-24 18:09:24 +01:00
Rolf Bjarne Kvinge 7411c033fb Merge remote-tracking branch 'origin/master' into framework-sdk 2017-03-24 14:44:54 +01:00
Marek Safar 105ee26509 Merge remote-tracking branch 'origin/master' into mono-2017-02 2017-03-23 23:13:43 +01:00
Jeffrey Stedfast 1a2cdbf26d [msbuild] Implemented GetFiles and GetFullPath tasks to fix the vs build (#1895)
* [msbuild] Implemented GetFiles and GetFullPath tasks to fix the vs build

Hopefully fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53410

* [msbuild] Added GetDirectories task and fixed GetFiles to handle Path not existing
2017-03-23 15:54:46 -04:00
Rolf Bjarne Kvinge 563f395cac Merge remote-tracking branch 'origin/master' into framework-sdk 2017-03-23 15:33:38 +01:00
Rolf Bjarne Kvinge 8a29f0deae Merge remote-tracking branch 'origin/master' into generator-ikvm 2017-03-22 14:11:00 +01:00
Jeffrey Stedfast 7db3d4f868 [msbuild] Use stamp files to force container app's _CompileToNative (#1878)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53303
2017-03-17 15:25:53 -04:00
Jeffrey Stedfast 296cb5c3fa [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-17 15:25:10 -04:00
Jeffrey Stedfast 694bd212b3 [msbuild] Added logging for all of the overridden MSBuild default tasks (#1829) 2017-03-17 15:24:58 -04:00
Jeffrey Stedfast 1c6565eaf5 [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-17 15:24:43 -04:00
Jeffrey Stedfast 51fdfa825c [msbuild] Run the _ComputeTargetArchitectures target before cleaning (#1828)
Some of the Clean steps need the _ComputeTargetArchitectures
target to run before they can properly do their thing because
they depend on DeviceSpecific paths.

Also added logic to rm -rf extension *.dSYM and framework *.dSYM
dirs in the container app bin dir (which fails on xbuild due to
a bug in xbuild... yay!)

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53007
2017-03-17 15:24:23 -04:00
Jeffrey Stedfast ca6da28e91 [msbuild] Make sure to codesign appex dylibs (#1812)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52745

Added a new CodesignNativeLibraries task that scans for
and then codesigns each *.dylib and *.metallib in the
app bundle (minus those in the PlugIns and Watch dirs).
2017-03-17 15:24:05 -04:00
Jeffrey Stedfast cfb5a1674a [msbuild] sanity check TargetiOSDevice property for conflicts (#1799)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52847

If the device archs do not match the configuration, don't
do a device-specific build.
2017-03-17 15:23:52 -04:00
Jeffrey Stedfast a03458660d [msbuild] Remove an unused enum that causes confusion (#1798) 2017-03-17 15:23:28 -04:00
Jeffrey Stedfast 19345f65a4 [msbuild] Make a build error more clearly worded (#1794)
Related to https://bugzilla.xamarin.com/show_bug.cgi?id=52847
2017-03-17 15:23:13 -04:00
Jeffrey Stedfast e6d037ef5a [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-03-17 15:22:46 -04:00
Jeffrey Stedfast ae047281a3 [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-03-17 15:19:51 -04:00
Timothy Risi 1f81d9d13f [mmp] Add mmp support for AOT options in XS (#1818) 2017-03-17 09:55:43 -08:00
Jeffrey Stedfast 8b376efa4b [msbuild] Use stamp files to force container app's _CompileToNative (#1878)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53303
2017-03-16 15:32:04 -04:00
Rolf Bjarne Kvinge 65ad42cce0 Merge remote-tracking branch 'origin/master' into framework-sdk 2017-03-14 19:25:11 +01:00
Rolf Bjarne Kvinge b41307bb7f Merge commit '2272efbb189d457dc6c599cefd875425baad92a5' into framework-sdk 2017-03-14 19:24:07 +01:00
Rolf Bjarne Kvinge a719e1f480 Merge remote-tracking branch 'origin/master' into generator-ikvm 2017-03-14 17:59:45 +01:00
Chris Hamons abf0f4a2d9 [XM] Improve XM msbuild support and add roslyn netstandard test case (#1846)
- Significant changes to target file under msbuild, ImplicitFacade processing in particular
- Tests are disabled due to https://bugzilla.xamarin.com/show_bug.cgi?id=53164 where we can't tests local target files only global
- Requires a mono msbuild with 95ab657a90 for tests to pass
- Until then, this is a workaround:
    sudo cp /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/Roslyn/System.Reflection.Metadata.dll /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/
2017-03-14 11:08:04 -05:00
Ankit Jain 18c1f808a1 Xamarin.Mac.FSharp.targets - Fix imports to work correctly with ..
.. MSBuildExtensionsPath* .

`MSBuildExtensionsPath*` supports search paths only if the string
`$(MSBuildExtensionsPath)` (or *32/*64) appear in the `Project`
attribute of the `Import` element. Otherwise the value of the property
or the default value is used. So, restructure to conditionally import
rather than a import using a property with the final path.
2017-03-14 11:54:13 +01:00
Marek Safar 3912019640 More mdb to pdb checks update 2017-03-14 11:54:13 +01:00
Marek Safar 258cbdda4b Adds pdb handling to mtouch 2017-03-14 11:51:08 +01:00
Marek Safar f2d61b67f3 [msbuild] Update few test expected debug symbols 2017-03-14 11:47:06 +01:00
Marek Safar 741fc32f71 [msbuild] Update test to reflect Mono.Dynamic.Interpreter.dll removal 2017-03-14 11:47:06 +01:00
Marek Safar e47eaff8d6 [msbuild] Remove smcs compiler overrides 2017-03-14 11:47:06 +01:00
Marek Safar 16ba9f1452 [build] Update debug symbols to pdb 2017-03-14 11:47:06 +01:00
Rolf Bjarne Kvinge ff9bae7bbc [mtouch] Don't put frameworks in WatchKit 1 extensions. Fixes #53232. (#1864)
The frameworks go into the container app's Frameworks directory.

https://bugzilla.xamarin.com/show_bug.cgi?id=53232
2017-03-13 17:34:27 -05: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
Emanuel 982f71da11 [msbuild] Ensure the MainAssembly path is absolute (#1857)
Fixes bug #52758 (https://bugzilla.xamarin.com/show_bug.cgi?id=52758)

For appex the MainAssembly path should be absolute, since mtouch will generate a build-arguments.txt file that then will be used to build the extension in the same mtouch process than the container app. Due to this, if the path stored is relative mtouch won't be able to find the assembly.
2017-03-10 12:41:27 +01:00
Rolf Bjarne Kvinge 449bcd32db [msbuild] Add support for IKVM-based generator. 2017-03-09 12:47:57 +01: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
Vincent Dondain 87955d1d6f [msbuild] Fix metal targets for Xcode8 (#1838)
Fixes bug #52982: [iOS]Metal samples fail to build with Xcode8.3
(https://bugzilla.xamarin.com/show_bug.cgi?id=52982)

Basically with Xcode8 Apple stopped using an intermediary step to generate the
default.metallib. This was what our `_ForgeMetal` target was doing, generate a `default.metal-ar`
file which was used as input for `_TemperMetal` and then generate the default.metallib.

Instead with Xcode8 you can just give Shaders.air directly to the metallib tool.

The fix in this commit is made in such a way that it still supports Xcode7.

if !Xcode8 then don't change anything.
if Xcode8+ then have `_ForgedMetal` output equal `@(_SmeltedMetal)` (basically skip the _ForgeMetal target).
2017-03-07 15:30:31 -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
Rolf Bjarne Kvinge 1e498bce22 Merge remote-tracking branch 'origin/master' into framework-sdk 2017-03-07 07:38:30 +01:00
Jeffrey Stedfast f205a8cfe6 [msbuild] Run the _ComputeTargetArchitectures target before cleaning (#1828)
Some of the Clean steps need the _ComputeTargetArchitectures
target to run before they can properly do their thing because
they depend on DeviceSpecific paths.

Also added logic to rm -rf extension *.dSYM and framework *.dSYM
dirs in the container app bin dir (which fails on xbuild due to
a bug in xbuild... yay!)

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53007
2017-03-07 07:15:14 +01:00
Jeffrey Stedfast dd834eeeb0 [msbuild] Make sure to codesign appex dylibs (#1812)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52745

Added a new CodesignNativeLibraries task that scans for
and then codesigns each *.dylib and *.metallib in the
app bundle (minus those in the PlugIns and Watch dirs).
2017-03-02 13:25:06 -05:00
Jeffrey Stedfast 5ba38492d5 [msbuild] sanity check TargetiOSDevice property for conflicts (#1799)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52847

If the device archs do not match the configuration, don't
do a device-specific build.
2017-03-01 10:22:41 -05:00
Jeffrey Stedfast 1b2d24ed2c [msbuild] Remove an unused enum that causes confusion (#1798) 2017-03-01 10:21:52 -05:00
Jeffrey Stedfast 297fcd8956 [msbuild] Make a build error more clearly worded (#1794)
Related to https://bugzilla.xamarin.com/show_bug.cgi?id=52847
2017-02-28 15:23:45 -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
Rolf Bjarne Kvinge 4de9a8c0d6 Merge remote-tracking branch 'origin/master' into framework-sdk 2017-02-28 10:16:18 +01: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
Chris Hamons bf47f0f1e2 Fixes for XM 4.5 and netstandard13 and updated comments (#1758)
- Update comments on XM45.targets file
- Remove unnecessary AssemblySearchPaths hack causing issues using nugets with same name as Facades
- Note: MSBuild with XM 4.5 is still broken for now
2017-02-24 17:45:38 -06:00
Rolf Bjarne Kvinge d212b97b1a Merge remote-tracking branch 'origin/master' into framework-sdk 2017-02-21 18:14:29 +01: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
Rolf Bjarne Kvinge 68fe70f317 [tests][msbuild] Enable bitcode for tvOS/Release builds. 2017-02-13 15:42:14 +01:00
Rolf Bjarne Kvinge fcb0d18cc7 [msbuild tests] Make the MyTVServicesExtension project actually work. 2017-02-10 16:39:38 +01:00
Rolf Bjarne Kvinge 23a1bd0a13 [msbuild tests] Make it possible for MyTVApp and MyTVServicesExtension to share code. 2017-02-10 16:39:37 +01:00
Rolf Bjarne Kvinge d725d5fb63 [msbuild] Add the MyTVServicesExtension project to the solution where it's needed. 2017-02-10 16:39:37 +01:00
Rolf Bjarne Kvinge c3c6f5cbeb [msbuild tests] Add more potential directories where assemblies might be. 2017-02-10 16:39:37 +01:00
Rolf Bjarne Kvinge f82a995b21 [msbuild tests] Assemblies do not always end up in the .monotouch-[32|64] directory anymore, so update tests accordingly.
Assemblies will not end up in the .monotouch-[32|64] subdirectory anymore
(unless they must because they're different), which means that it's not easy
to detect if an assembly really ends up in the subdirectory or not.

So modify tests to accept assemblies in either the root bundle directory, or
in the .monotouch-[32|64] subdirectory.
2017-02-10 14:46:31 +01:00
Ankit Jain e3166fbb15 [msbuild][fsharp] Copy .mdb files when building with msbuild (#1641)
Mono's fork of msbuild uses a `$(_DebugFileExt)` property to specify
the debug file extension (.pdb/.mdb) to use. It defaults to .pdb. So,
with XI/XM, .mdb files don't get copied to the output folder.

We also add a `$(FscDebugFileExt)` property, which allows our default of
`.mdb` to be overridden.

But the `$(_DebugFileExt)` support  is not in upstream msbuild yet. So,
we can't ask the F# upstream to add it. Hence, this is being added to
our FSharp target files. Once, all this is upstream, we can remove the
overrides from our files.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=51148
2017-02-06 15:27:07 -05:00
Jeffrey Stedfast bc251403c2 [msbuild] Properly decide on when to re-codesign app bundle (#1625)
If the user makes changes to an App Extension or Watch app,
then those bundles would change within the main app bundle
but the main app bundle would not get re-codesigned because
it was not properly considering those files as inputs in the
_CodesignAppBundle target.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52165
2017-02-06 13:52:30 -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
batmaninpink ca8bb9386b recognize networkextension app extension (#1545) 2017-01-24 07:50:37 +01:00
Vlad Brezae cd9292ffdd Enable selecting the sgen major mode (#1546)
* [mmp/mtouch] Add option for concurrent sgen

* [msbuild] Add support for concurrent sgen properties

* [mmp] Test for concurrent sgen option
2017-01-24 07:28:15 +01: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 948d3d652d [msbuild] Fixed the Mac targets for the batch codesign patch (#1525) 2017-01-18 17:31:16 -05:00
Jeffrey Stedfast 39ca12858a [msbuild] Fixed the IpaPackageDir (#1523)
Originally, the IpaPackagePath would default to something
like:

bin/Debug/iPhone/MyProjectName $(DateTime)/MyProjectName.ipa

It was recently changed to not have the timestamp, but I
seem to have forgotten to do away with the subdirectory
completely. In other words, w/o this fix, we'd get:

bin/Debug/iPhone/MyProjectName/MyProjectName.ipa

When what we *really* want is:

bin/Debug/iPhone/MyProjectName.ipa
2017-01-18 16:07:30 -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 439e71fbf1 [msbuild] Fixed the logic to properly codesign *.appex's inside watch apps (#1499)
Several dependency targets were not being properly run because the Condition
expressions on e.g. the _CodesignAppExtensions target depended on variables
that were empty until the dependencies set them. But dependencies are only
executed if the parent target's Conditions were met.

Also changed the _CodesignVerify target to use the _ResolvedAppExtensions
variable instead of the _AppExtensionCodesignProperties variable. This means
that the _CodesignVerify target no longer depends on the
_ReadCodesignAppExtensionProperties target being executed and thus makes it
less likely that bugs like that will slip by in the future.
2017-01-13 16:05:15 -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
Rolf Bjarne Kvinge 1d20b18889 Revert "[msbuild] Moved _CompileToNative so it runs after importing the app extension" (#1454) 2017-01-09 17:38:20 +01: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 3103153349 [msbuild] Fixed the Inputs for the _CodesignAppBundle target (#1438)
* [msbuild] Fixed the Inputs for the _CodesignAppBundle target

The Inputs need to include the Info.plist, embedded.mobileprovision,
and the native libs/frameworks since those files also get included
in the _CodeSignature/CodeResources.

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

* [msbuild] Added unit test to make sure _CodesignAppBundle logic works
2017-01-05 11:29:48 -05:00
Jeffrey Stedfast af22202496 [msbuild] Properly clean device-specific output directories (#1387)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=50454
2016-12-20 13:24:24 -05:00
Rolf Bjarne Kvinge ffe3184345 [generator] Use --target-framework to specify which XM profile to target. (#1339) 2016-12-20 11:33:56 +01:00
Jeffrey Stedfast 86fcbbe715 [msbuild] Moved _CompileToNative so it runs after importing the app extensions (#1380)
Once @rolfkvinge finishes implementing support in mtouch
for code-sharing between main app and app extensions, the
mtouch command will need to run *after* the app extensions
have been copied into the app bundle.
2016-12-20 11:32:15 +01:00
joj 5405f0ac67 [msbuild] Cleanup common and mmp for remoting support (#1381) 2016-12-20 11:19:04 +01:00
Jeffrey Stedfast b37e3d42b0 [msbuild] Clean the $(AppBundleDir).mSYM directory (#1377) 2016-12-19 20:26:07 -05:00
Jeffrey Stedfast 1d79984be1 [msbuild] Use $(DeviceSpecificOutputPath) instead of $(AppBundleDir)\..\ (#1379)
Just a little cleaner/nicer.
2016-12-19 20:25:26 -05:00
Jeffrey Stedfast b192a9c078 [msbuild] Prevent rebuilds from re-codesigning if the app bundle is unchanged (#1373)
Patch #2 for https://bugzilla.xamarin.com/show_bug.cgi?id=49097
2016-12-17 22:51:25 -05:00
Jeffrey Stedfast 67fe510947 [msbuild] Codesign App Extension libs & frameworks (#1363)
This is a fixup to the PR in issue #1350.

We really only want to delay codesigning of the App Extension
*bundle*, but want to codesign any native libs and frameworks
as usual.
2016-12-16 14:30:13 +01:00
Jeffrey Stedfast 0b05192a3d [msbuild] Delay running dsymutil and strip on App Extensions (#1351)
* [msbuild] Delay running dsymutil and strip on App Extensions

We want to run dsymutil and strip on App Extensions
from the main app bundle targets so that mtouch can
generate a shared Mono.framework in the main app bundle.

* [msbuild] Updated Archive to copy appex dsyms from the correct location
2016-12-15 16:29:31 -05:00
Jeffrey Stedfast 711bc9ab9e Msbuild delay codesign (#1350)
* [msbuild] Delay codesigning of App Extensions

Instead of codesigning App Extensions as part of the
App Extension build, we now codesign them as part of
the Codesign target of the main app project.

* [msbuild] Use an ItemGroup to define _AppExtensionCodesignProperties

By using an ItemGroup, we save all of the metadata
even if the values are null/empty. Using CreateItem,
any metadata property with a null or empty value
was not being saved in the .items file.

* [msbuild] Take advantage of %(_AppExtensionCodesignProperties.Identity)

...instead of having to use
%(_AppExtensionCodesignProperties.Filename)%(_AppExtensionCodesignProperties.Extension)
2016-12-15 16:28:55 -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
Jeffrey Stedfast c267c5668c [msbuild] Fixed EmbedMobileProvision to lookup provisions by name/uuid correctly (#1352)
Fixed the EmbedMobileProvision task to use the same strategy for looking up provisioning profiles as the DetectSigningIdentity task.

This can be considered a follow-up patch to https://bugzilla.xamarin.com/show_bug.cgi?id=25499 and commit 146e7b3962 in that it is needed if/when the .csproj file references the provisioning profile based on the Name instead of the UUID, but also stands on its own as a performance optimization (MobileProvisionIndex lookups are significantly faster than loading each and every provisioning profile and then using LINQ to match against the UUID).
2016-12-15 11:12:34 -05:00
Jeffrey Stedfast 42b121bac5 [msbuild] Fixed _GenerateFrameworkDebugSymbols to respect NoDSymUtil and NoSymbolStrip options (#1346) 2016-12-14 14:35:58 +01: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
Jeffrey Stedfast b16265593c [msbuild] Added support Simulator-specific builds (#1326) 2016-12-09 11:55:25 -05: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
Vincent Dondain 9fe8dca4a8 [msbuild] Remove TLSProvider option (#1238)
* AppleTLS is the default since C7 and support up to TLS 1.2.

* MonoTLS is limited to SSLv3 and TLSv1: both are being deprecated.

* Note: C9 release notes already mention MonoTLS is deprecated and that it will be removed in the future.
2016-12-08 11:56:44 -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 7dac4dfe58 Copy watchOS app dll to output directory (#1271)
If the watchOS dll app is not copied to the output directory, the watchOS app project will be outdated for VS and it'll be built all the time. That will also cause the iOS app project to be built.
2016-12-05 17:21:48 -05:00
Rolf Bjarne Kvinge 056d1ea8b4 [msbuild] Extensions can contain frameworks too. (#1301) 2016-12-05 18:21:46 +01:00
Jeffrey Stedfast 7d662f44e6 [msbuild] Don't rewrite MonoTouchDebugConfiguration.txt unless it has… (#1288)
* [msbuild] Don't rewrite MonoTouchDebugConfiguration.txt unless it has changed

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

* [msbuild] Reduce allocations in CreateDebugConfigurationTaskBase.cs
2016-12-01 17:15:14 -05:00
Jose Gallardo eb79a11317 Merge pull request #1268 from emaf/master
Changes GetVirtualProjectPath to make relative paths when building from VS
2016-12-01 16:45:57 +02:00
Jeffrey Stedfast b2a86cc534 [msbuild] Don't rm -rf the .dSYM dir in the _CompileToNative target (#1261)
That logic wrongly assumed that mtouch will always output a new
native executable file and that the dSYMs will need to be regenerated,
but that is not the case.

Move the rm -rf logic into the _GenerateDebugSymbols target instead,
so that we only delete the dSYMs if we've already committed to
regenerating them.

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

For a walk-through of the problem, see
https://bugzilla.xamarin.com/show_bug.cgi?id=47803#c9
2016-11-30 10:59: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
Jeffrey Stedfast 5682c4d8e9 [msbuild] Touch the .dSYM Info.plist after stripping the native exe (#1233)
The idea here is to prevent future builds from calling dsymutil
if the native executable hasn't changed since the previous build.

The reason we need to touch the dSYM Info.plist after stripping
is because the SymbolStrip task *may* modify the native executable
thereby giving it a newer mtime timestamp than the dSYM Info.plist
which would cause later builds to re-run the dsymutil task on an
already-stripped native executable.

It should be noted, however, that the _CodesignAppBundle target
already updates the mtime timestamp of the dSYM Info.plist for
precisely the same reason and since it is run *after* the
_GenerateDebugSymbols target, the 'touch' should generally not
be needed in the _GenerateDebugSymbols target.
2016-11-29 08:16:48 -05: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
Vincent Dondain 011bb14212 [msbuild/tests] Add watch-companion test (#1187) 2016-11-16 16:51:33 -05: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
Chris Hamons 7004944a6b Fix mmp rebuild logic to detect mmp failures and rebuild (#1149)
- https://bugzilla.xamarin.com/show_bug.cgi?id=46508

Since we were previously looking for the .exe instead of the launcher, mmp
failures would come back as good and we wouldn't rebuild. What we want
to do is look for the native launcher, which we perviously were doing wrong.
2016-11-14 10:58:50 -06: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
Chris Hamons d4e32a96f2 Merge branch 'master' into xm_mmp_rebuildfix 2016-11-09 14:20:41 -06:00
Chris Hamons 7ed3f17a6e Fix mmp rebuild logic to detect mmp failures and rebuild
- https://bugzilla.xamarin.com/show_bug.cgi?id=46508

Since we were previously looking for the .exe instead of the launcher, mmp
failures would come back as good and we wouldn't rebuild. What we want
to do is look for the native launcher, which we perviously were doing wrong.
2016-11-09 14:16:53 -06:00
Jeffrey Stedfast a055313a0d [msbuild] The CoreCodesignDependsOn target list does not start with an _ (#1140) 2016-11-08 15:59:09 -05:00
Ankit Jain 05c8420f6c [msbuild] Fix Metal project builds with msbuild for XI/XM (#1130)
Building `MetalKitEssentials.Mac` project from `mac-ios-samples` repo with
msbuild fails with:

```
"/Users/ankit/dev/mac-ios-samples/MetalKitEssentials/MetalKitEssentials.Mac/MetalKitEssentials.Mac.csproj" (default target) (1) ->
(_SmeltMetal target) ->
  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets : error : Tool exited with code: 1. Output: warning: unable to open file obj/Debug/metal/../../../../../../../Users/ankit/dev/mac-ios-samples/MetalKitEssentials/MetalKitEssentials.Mac/Resources/Shaders.dia for serializing diagnostics (Error opening output file 'obj/Debug/metal/../../../../../../../Users/ankit/dev/mac-ios-samples/MetalKitEssentials/MetalKitEssentials.Mac/Resources/Shaders.dia': No such file or directory) [-Wserialized-diagnostics] [/Users/ankit/dev/mac-ios-samples/MetalKitEssentials/MetalKitEssentials.Mac/MetalKitEssentials.Mac.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets : error : warning: '-std=osx-metal1.0' is equivalent to '-std=osx-metal1.1' [/Users/ankit/dev/mac-ios-samples/MetalKitEssentials/MetalKitEssentials.Mac/MetalKitEssentials.Mac.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets : error : error: unable to open output file 'obj/Debug/metal/../../../../../../../Users/ankit/dev/mac-ios-samples/MetalKitEssentials/MetalKitEssentials.Mac/Resources/Shaders.air': 'Error opening output file 'obj/Debug/metal/../../../../../../../Users/ankit/dev/mac-ios-samples/MetalKitEssentials/MetalKitEssentials.Mac/Resources/Shaders.air': No such file or directory' [/Users/ankit/dev/mac-ios-samples/MetalKitEssentials/MetalKitEssentials.Mac/MetalKitEssentials.Mac.csproj]
```

The path
`obj/Debug/metal/../../../../../../../Users/ankit/dev/mac-ios-samples/MetalKitEssentials/MetalKitEssentials.Mac/Resources/Shaders.dia`
should be just `Resources/Shaders.dia`. This is from the `@(Metal)` item
passed to the `Metal` task as:

	<Metal SourceFile="%(Metal.Identity)" ..

- This item is defined in the user's project file.
- And the task invocation is in
	`/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets`.

- The `Metal` task (indirectly[2]) uses the `DefiningProjectFullPath`
  metadata from that `SoureFile`, and expects to get the path to the
  file that defined that `@(Metal)` item. But since we are using
  `%(Metal.Identity)`, to use task batching, msbuild converts the
  `%(Metal.Identity)` to a string and then "boxes" that as an ITaskItem,
  and thus newly created item passed to `SourceFile` will have
  `DefiningProjectFullPath` set to the `Xamarin.Mac.Common.targets`!

- And trying to create a relative path using that gives us
  `obj/Debug/metal/../../../../../../../Users/ankit/dev/mac-ios-samples/MetalKitEssentials/MetalKitEssentials.Mac/Resources/Shaders.dia`

- The fix is to use `'%(Metal.Identity)` in the `Condition` to cause
  task batching, but use `SourceFile="@(Metal)"` so that we get the
  original item!

- Fixed for iOS targets too

---
1. The actual code is in `BundleResources.GetVirtualProjectPath`.
   Other tasks using this were looked at and they are all using
   `ITaskItem[]` and so passing `@(Items)` and thus get the original
   items.

2. And the build works in xbuild, because it has `DefiningProjectFullPath`
   for the "boxed" item set to `""`. And `GetVirtualProjectPath` works
   around that.
2016-11-07 13:37:59 -05:00
Ankit Jain 945c2043e3 [msbuild] Fix app extension builds with msbuild for XI and XM (#1124)
Some samples from the `ios-samples` repo failed with an error in running
`ditto`:

```
  Tool /usr/bin/ditto execution started with arguments: -rsrc /Users/ankit/dev/ios-samples/ios9/FilterDemoApp/FilterDemoAppExtension/bin/iPhoneSimulator/Debug/FilterDemoAppExtension.appex bin/iPhoneSimulator/Debug/FilterDemoApp.app/PlugIns/FilterDemoAppExtension.appex                                                  Environment variables being passed to the tool:
  ditto: can't get real path for source '/Users/ankit/dev/ios-samples/ios9/FilterDemoApp/FilterDemoAppExtension/bin/iPhoneSimulator/Debug/FilterDemoAppExtension.appex'                                                                                                                                                       Tool /usr/bin/ditto execution finished.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets : error : Tool exited with code: 1. Output: ditto: can't get real path for source '/Users/ankit/dev/ios-samples/ios9/FilterDemoApp/FilterDemoAppExtension/bin/iPhoneSimulator/Debug/FilterDemoAppExtension.appex' [/Users/ankit/dev/ios-samples/ios9/FilterDemoApp/FilterDemoApp/FilterDemoApp.csproj]
```

The directory
`/Users/ankit/dev/ios-samples/ios9/FilterDemoApp/FilterDemoAppExtension/bin/iPhoneSimulator/Debug/FilterDemoAppExtension.appex`
did exist *after* the full build was over, but just before `ditto` ran,
it didn't[1].

But it should have been created as part of the `FilterDemoAppExtension`
build, before `ditto` was called as the `FilterDemoAppExtension` project
is referenced by `FilterDemoApp`. And this builds fine with xbuild.

Debugging+hair-pulling revealed:

a. `FilterDemoApp.csproj` has a `ProjectReference` pointing to
`FilterDemoAppExtension.csproj`

b. xbuild figures out the build order based on the .sln and the project
references and builds the individual projects in that order.

c. But msbuild doesn't do that anymore. It seems to build in "some"
order (probably the order in which the projects appear in the sln), and
depends on each project's `ResolveProjectReferences` target building
such referenced projects! So, msbuild starts with building
`FilterDemoApp` project and should have built the extension project, as
it is referenced, but that does not happen.

d. It does not happen because XI, in `_SeparateAppExtensionReferences`,
moves any `Extension` projects from `@(ProjectReferences)` to other
items to handle them itself in `Xamarin.iOS.Common.targets`. So, the
`ResolveProjectReferences` does not see the extension project at all.

e. But XI targets handle this in `_ResolveAppExtensionReferences`, just
like `ResolveProjectReferences` from x/msbuild targets. BUT.. they depend
on the xbuild's behavior, where if you are building a `.sln` file, then
any dependent projects have already been built, and thus it just skips
them!!
	- Since, msbuild no longer does this.. the extension project is
	not built and instead proceeds to creating the apple bundle.

So, the fix is effectively to remove the `$(BuildingSolutionFile) == true`
check from that target.

- The same change is required for Watch extensions target too.
- And the corresponding changes for XamMac

- This fixes ~7 demos in ios-samples.

---
1. The directory and the corresponding files existed *after* the full
build but not before the `ditto` execution because after `ditto`
caused the `FilterDemoApp` project to fail, msbuild continued to build
the remaining `FilterDemoAppExtension` project! too late :)
2016-11-06 19:15:30 -05:00
Vincent Dondain 1f056d6a3e [msbuild] Fix minor typos in DetectSdkLocationsTaskBase (#1121) 2016-11-04 10:53:32 -04: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
Sebastien Pouliot 738a33afca Merge pull request #1087 from xamarin/msbuild-use-latest-profile
[msbuild] Allow Provisioning Profile lookups by name and use only the…
2016-11-03 11:09:41 -04:00
Jeffrey Stedfast 350f497e7a [msbuild] Validate that WatchOS2 App Extensions do not have watch-companion set (#1089) 2016-11-02 10:52:40 +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
Chris Hamons 82bfb2fe39 Fix XM dependency tracking of mmp bundle to prevent rebuilds (#1014)
- https://bugzilla.xamarin.com/show_bug.cgi?id=45764
- _CompileToNative's output in msbuild was incorrectly set to:
 $(_AppBundlePath)Contents\MacOS\$(TargetFileName) when the generated
 file lives at $(_AppBundlePath)Contents\MonoBundle\$(TargetFileName).
- This means we'd always try to rebuild, which can be rather time consuming.
- The XI target file is just different enough to require a seperate fix.
2016-10-27 20:15:28 +02: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 707b0e683f [msbuild] Added BeforeCodesign and AfterCodesign hooks for Mac (just like iOS has) (#1003) 2016-10-19 09:31:35 -05:00
Rolf Bjarne Kvinge c4b5fa5f44 [msbuild] Remove support for XI/Classic. (#976)
* [msbuild] Remove unused FrameworkList.xmls

* [msbuild] Make files in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/msbuild/iOS the real deal, not a symlink.

* [msbuild] Make /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS a symlink, instead of each file inside.

* [msbuild] Don't put anything in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/2.1 anymore.

* [msbuild] Remove support for XI/Classic binding projects.

* Improve 'install-system' to clean up old files.

* [msbuild] Simplify XI/Classic targets files a bit.

* [msbuild] Remove dead XI/Classic code.

* Bump maccore to get fix for xamarin-analysis.

commit xamarin/maccore@34c04c2bf1
Author: Rolf Bjarne Kvinge <rolf@xamarin.com>
Date:   Mon Oct 10 16:46:18 2016 +0200

    [analysis] Update to put files in /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS.

    XI/Classic is being removed now, which means files should go into
    /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/msbuild/iOS/ instead of into
    /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/2.1.
2016-10-13 10:47:46 +02:00
Jeffrey Stedfast fa114b2565 [msbuild] Fixed parsing of --gcc_flags=... for mtouch (#982)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=45240
2016-10-12 20:49:34 -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 2a02804d81 [msbuild] Fixed IsWatchExtension state property (#913)
The problem was that this property was evaluating to True
for the main app bundle because it assumed that if the
project contained a Watch app, that it was the WatchExtension.

This logic only holds true for WatchOS1, but not WatchOS2.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=44841
2016-10-03 13:44:31 -04:00
Ankit Jain 6f37730293 [msbuild] Set $(CscDebugFileExt) also, whenever overriding $(CscToolExe) (#896)
* [msbuild] Set $(CscDebugFileExt) also, whenever overriding $(CscToolExe)

- This property was introduced in mono's msbuild, but will be upstream
  also
- This *must* be set before Microsoft.CSharp.targets file is imported.
- Even though the msbuild targets will automatically select `.mdb` if
  the `$(CscToolExe)` is `mcs` or `mcs.exe`, it would be a good
  practice to set both the properties together.

- This came up in cases where we use `smcs`, because in that case the
  msbuild targets end up using `.pdb`.

* [msbuild] Set `$(CscDebugFileExt)` == `.mdb`

Xamarin.ObjcBinding.CSharp.targets: Set the debug file extension also,
since we are overriding the compiler via `$(CscToolExe)`. Also, move
the property definition around to ensure that they are set *before*
importing `Microsoft.CSharp.targets`.
2016-09-28 14:37:44 -04:00
Jeffrey Stedfast 5922215e72 [msbuild] Add watch-companion to UIRequiredDeviceCapabilities for watchOS1 extensions (#868)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=44257
2016-09-22 19:09:10 +02:00
Rolf Bjarne Kvinge d4edc453a6 Fix default http message handler for watchOS. (#873)
* Fix default http message handler for watchOS.

Fix default http message handler for watchOS to be NSUrlSessionHandler (the
previous attempt at eb7c2fd was quite incomplete), and make sure
HttpClientHandler is never used (show errors if someone tries).

* [tests] Remove explicit http client handler from project files.

Just use the default instead, since the set of valid http client handlers varies between platforms.
2016-09-22 14:29:18 +02:00
Rolf Bjarne Kvinge 9000e48034 [tests] Remove Classic test projects, and make the Unified test projects the master projects. (#858) 2016-09-21 22:55:10 +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
Emanuel 4f5fc6d263 Enables CoreCompile target for WatchOS App projects (#826)
* Enables CoreCompile target for WatchOS App projects

The iOS Designer depends on Roslyn Workspace APIs to inspect and get notified of project changes, which needs CoreCompile target to work.

Fixes Bug #41766 (https://bugzilla.xamarin.com/show_bug.cgi?id=41766)

* [msbuild] Adds empty cs file to avoid errors and warnings when building watchOS apps

Xbuild fails to build projects with no @(Compile). This change workaround it for watchOS apps.
2016-09-16 14:16:32 -04:00
Sebastien Pouliot f1804cce67 Merge branch 'cycle8' into xcode8 2016-09-16 13:24:24 -04: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 fca8a0c397 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:16:09 -04:00
Ankit Jain 4a87ccf948 [msbuild] Ensure that `BuildOnlySettings` is the first target to run for a `Build` (#841)
When building the `inspector` project with msbuild, the build fails
because of a missing `System.Runtime` reference,
-> which can be traced to the `ResolveAssemblyReferences` task not resolving dependencies.
	-> which can be traced to `$(_FindDependencies)` property being set to false
		-> which is false, because `$(BuildingProject)` is false, which should
		   have been set by the `BuildOnlySettings` target, run as a dependency of
		   `CoreBuild`.

We override `$(BuildDependsOn)` as:

  <BuildDependsOn>
     ...
     _UnpackLibraryResources;
     $(BuildDependsOn);
     ...
  </BuildDependsOn>

.. so, `_UnpackLibraryResources` runs before `BuildOnlySettings`. And
`_UnpackLibraryResources` depends on `ResolveReferences`, so the
`ResolveAssemblyReferences` task runs with the incorrect properties. And
later, during the build when `ResolveAssemblyReferences` is invoked
again, it gets skipped and the incorrect outputs get used.

`$(BuildingProject)` should be true for a project build. So,
`Xamarin.Mac.Common.targets` are fixed for that. And other similar
target files are also fixed.

Note: `Xamarin.iOS.Common.targets` already does this correctly.
Note: `$(BuildingProject)` is not used in xbuild, so this bug is seen
only when building with msbuild.
2016-09-15 21:38:55 -04:00
Jeffrey Stedfast f9e2e18794 [msbuild] Include the CFBundleVersion in the archive manifest (#839)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=44348
2016-09-15 14:50:02 -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
Jeffrey Stedfast 5f73edaac1 [msbuild] Check that ExtraArgs is not null before parsing (#795)
* [msbuild] Check that ExtraArgs is not null before parsing

* [msbuild] FIxed accidental typo in last commit
2016-09-07 17:42:04 -04:00
Jeffrey Stedfast c1e5fa0150 Cycle8 msbuild mmp fixes (#796)
* [msbuild] Fixed the mmp task to make sure the MonoBundle dir exists before enumerating its files (#787)

* [msbuild] Parse the mmp ExtraArgs to get the custom mono bundle dir name (#790)

The mmp utility allows users to pass -custom_bundle_name to specify
a custom directory name to use instead of MonoBundle, so we need to
parse the extra args to extract this value so that we can scan that
directory for dylibs to codesign.

* [msbuild] Check that ExtraArgs is not null before parsing

* [msbuild] FIxed accidental typo in last commit
2016-09-07 14:19:32 -04:00
Vincent Dondain 5ddee0dcbf [msbuild] Update classic build error (#791)
We now want the build error to always show up.
monotouch.dll will be shipped with XI 10 to allow migration (dependent on the dll being available).
Therefore the check wasn't valid anymore because it was only applying the error if monotouch.dll wasn't there.
This was done to avoid breaking our internal tests but we should actually be fine, if not we'll update the tests.
2016-09-07 12:50:22 -04:00
Vincent Dondain df7b2a5165 [msbuild] Add missing iOS+tvOS 10 Extension points (#786) 2016-09-07 17:42:14 +02:00
Jeffrey Stedfast d079b8afcb [msbuild] Parse the mmp ExtraArgs to get the custom mono bundle dir name (#790)
The mmp utility allows users to pass -custom_bundle_name to specify
a custom directory name to use instead of MonoBundle, so we need to
parse the extra args to extract this value so that we can scan that
directory for dylibs to codesign.
2016-09-07 11:30:29 -04:00
Jeffrey Stedfast 4d4decdad1 [msbuild] Fixed the mmp task to make sure the MonoBundle dir exists before enumerating its files (#787) 2016-09-07 09:15:40 -04:00
Vincent Dondain e4093d5908 [msbuild] ACTool update for iMessage Extension (#778) 2016-09-07 00:59:45 +02:00
Sebastien Pouliot 0cc8b176e8 Merge branch 'cycle8' into xcode8 2016-09-06 18:46:23 -04:00
Vincent Dondain 562b9564f1 [msbuild] Show proper build error when monotouch.dll doesn't exist (#750)
Due to the deprecation of classic we needed to provide a better and single error message
rather than the countless msbuild errors you'd have because you'd be missing monotouch.dll

* Migrate MySingleView & MyLibrary to Unified
2016-09-06 14:50:54 -04:00
Rolf Bjarne Kvinge f2c4c191c6 [msbuild] Set NSAllowArbitraryLoads when debugging watchOS apps. (#746)
* [msbuild] Move detection of network configuration to a separate task.

* [msbuild] Set NSAllowArbitraryLoads when debugging watchOS apps.

The only way to have reliable http connections from the watchOS 2 device
to the mac is to set NSAllowArbitraryLoads.

See also: https://forums.developer.apple.com/thread/6205
2016-09-02 08:30:15 -04:00
Rolf Bjarne Kvinge b7570c09d4 [msbuild] Remove debug spew. (#747) 2016-09-02 08:25:52 -04:00
Jeffrey Stedfast ee8eac1237 [msbuild] Only include *.dylibs from the app bundle for codesigning (i.e. not from child PlugIns) (#725)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43890
2016-09-01 11:43:26 -04:00
Rolf Bjarne Kvinge 88dcc52a35 Merge pull request #707 from rolfbjarne/msbuild-allow-http-for-watchos-debugging
[msbuild] Set NSAllowArbitraryLoads when debugging watchOS apps.
2016-09-01 16:48:56 +02:00
Jeffrey Stedfast 3ebed206e1 [msbuild] Only include *.dylibs from the app bundle for codesigning (i.e. not from child PlugIns) (#725)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43890
2016-09-01 15:42:07 +02:00
Rolf Bjarne Kvinge 91b8f958b9 [msbuild] Set NSAllowArbitraryLoads when debugging watchOS apps.
The only way to have reliable http connections from the watchOS 2 device
to the mac is to set NSAllowArbitraryLoads.

See also: https://forums.developer.apple.com/thread/6205
2016-08-31 19:43:21 +02:00
Rolf Bjarne Kvinge 7d96d81e52 [msbuild] Move detection of network configuration to a separate task. 2016-08-31 19:43:21 +02:00
Jeffrey Stedfast 73a1d74cab Cycle8 codesign simulator (#674)
* [msbuild] Always codesign iOS frameworks (#642)

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

* [msbuild] Always codesign *.dylibs, even for Simulator builds (#672)

Another fix for https://bugzilla.xamarin.com/show_bug.cgi?id=43264
2016-08-25 18:22:20 -04:00
Jeffrey Stedfast f42e9ee935 [msbuild] Explicitly check that IsMacEnabled == true (#673) 2016-08-25 16:46:34 -04:00
Jeffrey Stedfast 3fbfcf7b22 [msbuild] Always codesign *.dylibs, even for Simulator builds (#672)
Another fix for https://bugzilla.xamarin.com/show_bug.cgi?id=43264
2016-08-25 16:40:31 -04:00
Jeffrey Stedfast 11c4f6bdd9 [msbuild] Always codesign iOS frameworks (#642)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=43264
2016-08-25 13:08:03 -04: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
Jason Imison 39b13fecba Fix fsharp targets to detect 'F#' language. Fixes #43356 (#626) 2016-08-18 14:11:02 -04:00
Jason Imison 07e3ad785e Fix fsharp targets to detect 'F#' language. Fixes #43356 (#625) 2016-08-18 14:01:35 -04:00
Jeffrey Stedfast 67bdff568b [msbuild] code cleanup (#607) 2016-08-15 15:07:34 -04:00
Mikayla Hutchinson 07c6835608 Remove leftover/broken import in F# targets 2016-08-15 10:06:16 -04:00
Mikayla Hutchinson 740d91ad08 Remove leftover/broken import in F# targets 2016-08-12 16:20:37 -04:00
joj 44721a0a9e Modifying the way GAC elimination works so it will work in MSBuild (#540)
XBuild adds extra semi-colons to the string when serializing. I remove them via split to make MSBuild work.
2016-08-10 11:59:09 -03:00
Jeffrey Stedfast f77fbeb016 [msbuild] When doing device-specific builds, ignore incompatible devi… (#579)
[msbuild] When doing device-specific builds, ignore incompatible device OS's

If the user has tvOS, watchOS, and iOS projects in their solution
and goes to build for one of them for a specific device, it passes
along the device specific info to MSBuild. The build would then
fail for the tvOS and/or watchOS projects because of incompatible
architecture requirements.

This fixes that problem by short-cutting the ParseDeviceSpecificBuildInfo
task to output the default values (the values used when not building
for a specific device).
2016-08-09 14:40:17 -04:00
Jeffrey Stedfast ec56c6103d [msbuild] When doing device-specific builds, ignore incompatible devi… (#579)
[msbuild] When doing device-specific builds, ignore incompatible device OS's

If the user has tvOS, watchOS, and iOS projects in their solution
and goes to build for one of them for a specific device, it passes
along the device specific info to MSBuild. The build would then
fail for the tvOS and/or watchOS projects because of incompatible
architecture requirements.

This fixes that problem by short-cutting the ParseDeviceSpecificBuildInfo
task to output the default values (the values used when not building
for a specific device).
2016-08-09 14:39:08 -04:00
Mikayla Hutchinson 51b7f81eca Fix F# targets on xbuild 12.0 & 14.0 (#542) 2016-08-09 11:24:12 -04:00
Mikayla Hutchinson 3e04819622 Fix F# targets on xbuild 12.0 & 14.0 (#541) 2016-08-09 11:23:56 -04:00
Chris Hamons 309c3b5c9e [XM] Fix msbuild incompatibility in binding target file (#375) 2016-08-08 13:53:33 -05:00
Jeffrey Stedfast 235a4ab226 [msbuild] Fixed spelling of MacOSX to Mac OS X (#538)
* [msbuild] Fixed spelling of MacOSX to Mac OS X

* [msbuild] Use the name 'macOS' instead of 'Mac OS X' :)
2016-08-04 14:08:15 -04:00
joj 0034839244 Modifying the way GAC elimination works so it will work in MSBuild (#540)
XBuild adds extra semi-colons to the string when serializing. I remove them via split to make MSBuild work.
2016-08-03 14:34:54 -05:00
Jeffrey Stedfast c2295c65e9 [msbuild] Don't use a user-defined Mac OS X SDK version, it's useless (#528)
Recent Xcode versions only ship 1 version of the SDK, so it is
pointless to have a user-defined SDK version to link against.

We already use the LSMinimumOSVersion to determine the proper
-mmacosx-version-min argument to pass.
2016-08-03 10:53:07 -04:00
nosami 1c82491de6 Add F# targets to Xamarin.Mac.FSharp.targets 2016-08-02 20:17:34 +01:00
nosami 5df2224f71 Add F# targets to Xamarin.Mac.FSharp.targets 2016-08-02 20:14:55 +01:00
nosami a90fe3ce8a Fix the other FSharp templates. Fixes #42828 2016-08-02 16:59:56 +01:00
nosami f7c84735c8 Fixes #42828 2016-08-02 16:59:44 +01:00
Jason Imison 44b3920511 Fixes #42828 (#512)
* Fixes #42828

* Fix the other FSharp templates. Fixes #42828
2016-08-02 11:49:22 -04:00
Chris Hamons 9c00c941dc [XM] Allow 64-bit system mono in XM apps (#508)
- Back when this check was added, 64-bit mono was not standard/shipped. Now it is.
2016-07-29 14:21:45 -05:00
Chris Hamons ff1f30b305 [XM] Fix msbuild incompatibility in binding target file (#375) 2016-07-11 13:56:04 -04:00
Jeffrey Stedfast b604792a3e [msbuild] Replaced uses of $(_IpaOutputDir) with $(IpaPackageDir) (#336)
* [msbuild] Replaced uses of $(_IpaOutputDir) with $(IpaPackageDir)

Fixes the unit tests

* [msbuild] Define IpaPackageDir/Name based on IpaPackagePath if defined
2016-06-30 21:22:41 -07:00
Rolf Bjarne Kvinge 93e100688d [msbuild] Don't Assert.Ignore in ctors, it ends up as failures. 2016-06-29 00:06:43 +02:00
Rolf Bjarne Kvinge a66fdf2738 [tests] Skip MSBuild device tests when device builds are disabled. 2016-06-29 00:06:39 +02:00
Rolf Bjarne Kvinge 8c5b446f82 [msbuild] Reorder imports for F# watchOS extensions so that it compiles correctly. (#299)
Otherwise extensions would just compile like a normal .NET class library
project and produce a .dll.
2016-06-28 08:20:26 -07:00
Jeffrey Stedfast 518b8007cc [msbuild] Properly archive projects containing WatchOS2 apps (#268)
Fixes bug #41762
2016-06-27 15:22:45 -04:00
Jeffrey Stedfast fa511d0d77 [msbuild] Allow customization of IPA package directory & path (#285)
Fixes bug #41963
2016-06-27 14:39:38 -04:00
Vincent Dondain afa7e8d976 [msbuild] Import Xamarin.iOS.Analysis.targets (#283)
Update reference to maccore which includes
the bump to an update xamarin-analysis and
the corresponding Makefile changes.
2016-06-27 14:07:58 -04:00
Rolf Bjarne Kvinge ba7cddc34e [msbuild] Add nuget diagnostics. (#255)
* [msbuild] Add nuget diagnostics.

* [msbuild] Make restore less verbose.

To see if that's what's causing an infinite newline print loop on jenkins bots.

* [msbuild] nuget can't list sources on jenkins for some reason, so just do it manually.

* [msbuild] Make sure diagnostics doesn't fail the build.
2016-06-23 06:22:21 -07:00
Chris Hamons 3fcb2ed89e [XM] - XM Mobile should not resolve from the GAC either (#242)
- Centralize fix I made for XM 4.5 to apply to both and write larger test
- https://bugzilla.xamarin.com/show_bug.cgi?id=42001
2016-06-20 15:26:33 -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 ef0b8867b9 [msbuild] Rename and unify to IsMacEnabled (#193)
* [msbuild] Rename and unify to IsMacEnabled

We previously had an MtouchTargetsEnabled and a separate
IsMacTargetsEnabled for iOS and XM, when both actually
meant the same thing: is a Mac enabled for building this
project?

Note that instead of "targets", we make it more generic,
since the condition can be used in a task, a property
group or whatever really, not just to enable/disable
certain targets.

Also, we call it Enabled, rather than Connected or
Available, since it's more natural to think that all such
tasks/targets are enabled when you're building locally
on the Mac. Connected wouldn't have been appropriate, and
Available would be confusing.

For backwards compatibility I've kepd the old MtouchTargetsEnabled
pointing to IsMacEnabled. We'll change our Windows targets
accordingly to also unify this property and how/where it's
set.

* [msbuild] Use full condition comparison for robustness

This is the proper way to use a boolean in a condition, and
prevents errors whenever the property is an empty string or
anything other than a boolean value.
2016-06-16 13:14:43 -04:00
Jeffrey Stedfast 59a1233b26 [msbuild] Create a WatchKitSupport2 directory in the IPA for WatchOS2+ apps (#182)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=41762
2016-06-15 13:50:27 +02:00
Daniel Cazzulino a645369e66 [msbuild] Remove improper .0 at the end of package version (#181)
For whatever reason, VS added it even if the package version is
0.9.5, but VS happily finds it and everything builds fine but
it breaks on xbuild/mono/mac??
2016-06-13 16:58:14 -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
Daniel Cazzulino 9642dd9be0 Provide .editorconfig support for easier contributor formatting
Scoped to the msbuild folder for now which has consistent C# and
MSBuild formatting. The rest of the repo seems to be using different
formatting, so I didn't want to have to decide one way or the other.
2016-06-13 00:43:37 -03: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
Daniel Cazzulino fbf06ee933 [msbuild] Redefine the Exec task to prepare for remote execution from VS (#164)
Like the Copy/Delete/MakeDir/RemoveDir/Touch tasks, we need to override
this one so we can allow customer targets to also execute Mac tools
remotely when building from Windows, bringing parity to the build
customizations allowed on XS/xbuild since they build locally and Exec
"just works" there of course.
2016-06-10 10:02:53 +02:00
Chris Hamons 06c18bd887 [XM] Add release value option to msbuild/mmp to resolve XM 4.5 assemb… (#150)
[XM] Add release value option to msbuild/mmp to resolve XM 4.5 assemblies from system GAC

- This option "reverts" a C7 fix that prevented resovling assemblies from the GAC, which is unsafe
- If you use this option, you need to know what you are doing. The mono BCL and the XM BCL need to be compatible
- Use strictly puts you in the no support "you get to keep the pieces if it breaks" category.
2016-06-08 12:47:09 -04:00
joj a063725298 Added MtouchTargetsEnabled property to build (#139) 2016-06-06 15:30:34 -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 01587d8fb4 [msbuild] Explicitly target .NET 4.5 for Xamarin.Mac.Tasks.Core
The other projects already explicitly target .NET 4.5.
2016-06-01 11:28:51 -04:00
Jeffrey Stedfast f59d1195e5 [msbuild] Fixed up MmpTaskBase 2016-05-31 11:59:18 -04:00
Jeffrey Stedfast 582101a996 Macios symbolicate (#74) 2016-05-31 11:57:47 -04:00
Rolf Bjarne Kvinge c5ef10a221 [msbuild] Provide better info when a test fails due to unexpected build failures in the test. (#105) 2016-05-31 12:58:11 +02:00
Rolf Bjarne Kvinge 55dfad1351 [msbuild] Define __TVOS__, not __IOS__ for tvOS projects. (#101) 2016-05-31 10:33:59 +02:00
joj dea10d50b3 Renamed TaskBase class files to *TaskBase; Fixed Mac reference 2016-05-26 13:06:39 -03:00
joj b1e7cd4b23 Made tasks in Mac.Tasks.Core bases; added SessionId 2016-05-26 10:24:13 -03:00
joj 19b87f2723 Added new Mac.Tasks.Core project; moved tasks with no Core base there 2016-05-26 10:07:59 -03:00
Rolf Bjarne Kvinge a082722047 [msbuild] Make sure CFBundleShortVersionString is set to something. (#86)
This prevents the watch from getting mightily confused when re-installing
watch apps/extensions.

Not having a CFBundleShortVersionString would cause the following:

* Build & install & run would work fine the first time.
* The second build & install would confuse the watch so that the
  app wouldn't launch. Removing the app and reinstalling wouldn't
  work; the potential options would be to either reboot the device,
  or add a CFBundleShortVersionString to the Info.plists and install
  that build twice.
2016-05-26 14:20:43 +02:00
Rolf Bjarne Kvinge 3a70b71a4c [msbuild] LLVM is possible for armv7k as well. (#87) 2016-05-26 13:52:21 +02: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
Vincent Dondain 6ca327e193 [msbuild] Remove empty UIDeviceRequiredCapabilities array (#71)
Looks like Xcode isn't generating any UIDeviceRequiredCapabilities
for watchOS 1 extensions.

It used to have UIRequiredDeviceCapabilities = 'watch-companion'
but that *might* not be required anymore.
Commit 94e35a8570 on xamarin-macios/master
comes from those same assumptions.

Now regarding bug #41204:
User is getting error "ERROR ITMS-90563: "Missing UIRequiredDeviceCapabilities value"
when publish WatchKitCatalog sample.
(https://bugzilla.xamarin.com/show_bug.cgi?id=41204)

This might happen because we're still creating an empty array for the
UIDeviceRequiredCapabilities key.

In any case there's no need to create it.
2016-05-23 10:18:34 +02:00
Vincent Dondain 686693ca47 [msbuild] Add AudioUnit key to ValidateAppBundleTaskBase (#68) 2016-05-19 16:53:44 +02: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
Vincent Dondain af283be95d [msbuild/tests] Add ValidateAppBundleTaskTests
Includes regression test for bug #38673:
https://bugzilla.xamarin.com/show_bug.cgi?id=38673

Description:
"Validate that CFBundleVersion and CFBundleShortVersionString
match across main app and all extensions".
2016-05-11 20:24:07 +02:00
Jeffrey Stedfast 0dc4cd2413 [msbuild] reverted accidental debug logging 2016-05-11 12:07:24 -04:00
Jeffrey Stedfast 351d429273 [msbuild] Fixed Optimize metadata parsing logic for BundleResources
Fixes bug #41019
2016-05-11 12:03:15 -04:00
Vincent Dondain 0970fce6ed [msbuild/tests] Add TVServicesExtension test (#21)
* [msbuild/tests] Remove car idiom from Contents.json

The car idiom is something new projects used to generate
and that actool doesn't handle anymore.

Logs were polluted by a warning: "The app icon set 'AppIcons' has an unassigned child".

* [msbuild/tests] Add tvOS extension test

We now have MyTVServicesExtension project which
comes from a simple tvOS extension template.
It is attached to MyTVApp.

The TVApp test has been updated to also build the extension.

* [msbuild/tests] Fix Action Extension version number

The action extension project now has a version number that
is matching the parent app.

Avoids warning message.
2016-05-03 13:17:38 -04:00
Emanuel d25da2a0e3 Set IsStreamable to false if the ODR are Embed 2016-05-02 15:48:57 -03:00
Emanuel b359fae77d [ODR] Sign app bundle if the AssetPackaManifest has changed 2016-05-02 15:48:50 -03:00
Emanuel b838b603f0 Avoid codesigning embedded assetpacks for AdHoc IPA 2016-05-02 15:48:41 -03:00
Jeffrey Stedfast 7344399ccf [msbuild] Added LinkDescription support for iOS
Fixes bug #40503
2016-04-26 16:15:18 -04:00
Vincent Dondain 2145c468a0 [msbuild] Add tvOS AppExtension targets 2016-04-26 10:19:54 -04:00
Rolf Bjarne Kvinge 94e35a8570 [msbuild] Xcode doesn't seem to add a UIRequiredDeviceCapabilities = 'watch-companion' anymore.
Xcode doesn't see to add a UIRequiredDeviceCapabilities = 'watch-companion'
anymore for watchos apps/extensions, not even when setting the deployment
version to 2.0.

This makes watchOS 2 apps launch in the simulator again.
2016-04-25 18:15:01 -04:00
Jeffrey Stedfast b0c55a87f6 [msbuild] Fixed FileWrites logic for OptimizeImage task 2016-04-25 18:14:55 -04:00
Jeffrey Stedfast e97d69b25c [msbuild] Don't write actool/ibtool/etc outputs to FileWrites
MSBuild compares what is in FileWrites with the Outputs of the target
and any file that exists in FileWrites but *doesn't* exist in Outputs
gets deleted with the assumption that it is no longer needed via the
IncrementalClean MSBuild target.

Since these tasks cannot know what the outputs will be until the task
is run, we cannot use FileWrites.
2016-04-25 18:14:55 -04:00
Rolf Bjarne Kvinge 68df944ad6 Build MSBuild targets & assemblies. 2016-04-24 14:48:44 -04:00