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

189 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge f613eacd9b
[msbuild] Parse --marshal-managed-exceptions and --marshal-objectivec-exceptions in ParseBundlerArgumentsTask. (#9493)
Also add some tests.
2020-08-26 19:03:45 +02:00
Rolf Bjarne Kvinge be095c5a26
[msbuild] Make sure to restore the binding project before trying to build it. (#9288)
Fixes numerous build failures like this:

    The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
    The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
    The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
    The type or namespace name 'TestFixtureAttribute' could not be found (are you missing a using directive or an assembly reference?)
    The type or namespace name 'TestFixtureAttribute' could not be found (are you missing a using directive or an assembly reference?)
2020-08-06 16:02:12 +02:00
Rolf Bjarne Kvinge 92a9aacbd3 [msbuild][tests] Adjust the BindingProject test according to the relocation of bindings-test.csproj.
Also remove the BindingProject.FrameworkTest, it's 100% identical to
BindingProject.BuildTest, and thus redundant.
2020-07-22 09:07:22 +02:00
Chris Hamons 5657a63539
Add support for arbitrary extensions to be bundled in XI/XM apps (#9048)
- This commit adds a hook, "AdditionalAppExtensions", to the msbuild to allow
extensions written in other languages, such as Swift, to be embedded and signed in an
Xamarin App bundle easily.
- Example:
<AdditionalAppExtensions Include="$(MSBuildProjectDirectory)/../../native">
	<Name>NativeTodayExtension</Name>
	<BuildOutput Condition="'$(Platform)' == 'iPhone'">build/Debug-iphoneos</BuildOutput>
	<BuildOutput Condition="'$(Platform)' == 'iPhoneSimulator'">build/Debug-iphonesimulator</BuildOutput>
</AdditionalAppExtensions>
2020-07-16 10:13:15 -05:00
Rolf Bjarne Kvinge b46aae7fd6
[msbuild] Make the ParseExtraMtouchArgs task platform-agnostic, and share it between Xamarin.iOS and Xamarin.Mac. (#9061)
* Change the parsing code slightly, to make it easier to parse other arguments
  (coming soon).
* Add the parsing task to Xamarin.Mac projects, and use it there as well. The
  parsed result isn't used yet, but it will be soon.
* Unify a few related MSBuild properties (MtouchNoSymbolStrip and
  MtouchNoDSymUtil).
2020-07-13 14:56:34 +02:00
Rolf Bjarne Kvinge 6bc03419fa
[msbuild] Unify the CompileAppManifest target. (#8875)
Also rework the class hierarchy a little bit, so that Xamarin.iOS and
Xamarin.Mac are identical:

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

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

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

New commits in xamarin/Xamarin.MacDev:

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

Diff: 45c5a680e2..a1bc6f39b3
2020-06-16 17:40:04 +02:00
Rolf Bjarne Kvinge 75341a9f20
[msbuild/tests] Set MSBUILD_EXE_PATH when running unit tests from within VS. Fixes #5042. (#8846)
Also fix several tests to work when executed from within VS due to some difference

There's also a change to the MtouchTask: lookup of framework assemblies won't
succeed anymore if the path to the assembly is just an unrooted filename
(which may happen to be a file in the current directory (as a test proved
accidentally) - in which case it will never be a framework assembly).

Unfortunately this won't make all tests pass, around 20 tests will still fail with:

     #RunTarget-ErrorCount
    	The "GetReferenceNearestTargetFrameworkTask" task could not be instantiated from the assembly "/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/NuGet.Build.Tasks.dll". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. Specified cast is not valid.
    	The "GetReferenceNearestTargetFrameworkTask" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.
      Expected: 0
      But was:  2

but I couldn't figure out how to fix these errors.

Fixes https://github.com/xamarin/xamarin-macios/issues/5042.
2020-06-15 09:16:39 +02:00
Rolf Bjarne Kvinge f0581a4ab0
[src] Remove the remaining Classic code. (#8819)
* [src] Update project files to remove XAMCORE_2_0 and __UNIFIED__.

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

* [src] Remove Classic code from System.Net.Http.

* [src] Remove Classic code from the ObjCRuntime namespace.

* [src] Remove Classic code from the native types.

* [src] Remove the Classic defines from the makefiles.

* [src] Remove Classic code from the Constants class.

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

* [src] NUnitLite still needs the XAMCORE_2_0 and __UNIFIED__ defines.

They still have conditional code with those defines:
a977ca5757/NUnitLite-1.0.0/src/framework/Constraints/Numerics.cs (L57)
2020-06-10 19:12:37 +02:00
Rolf Bjarne Kvinge 1b570ebb20
[msbuild] Update to NUnit 3.12 and NUnit.ConsoleRunner 3.11.1. (#8613) 2020-05-20 09:26:05 +02:00
Rolf Bjarne Kvinge 392200d930
[mtouch/mmp] Share numerous command-line arguments. (#8599)
* [mtouch/mmp] Share Application.IsDualBuild, Is32Build and Is64Build.

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

* [mtouch/mmp] Share --force.

* [mtouch/mmp] Share --cache.

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

* [mtouch/mmp] Share --i18n.

* [mtouch/mmp] Share --xml.

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

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

* [mtouch/mmp] Share --sdk.

* [mtouch/mmp] Share --debug.

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

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

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

* Update according to review.

* [mmp] Remove --registrar:il.

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

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

* [mtouch/mmp] Keep bundler-specific code in its corresponding file.
2020-05-19 15:30:38 +02:00
Rolf Bjarne Kvinge cb234697f5
[msbuild] Remove the net461 version of the msbuild task assemblies. (#8419)
The netstandard2.0 version has been the default for a few weeks now, and no
problems have been found, so just delete the net461 version.

This speeds up testing a bit, since we won't be testing the net461 version
anymore.
2020-04-20 09:59:22 +02:00
Sebastien Pouliot a5ac0ea102
[generator] Add C#8 nullability into generated code (#7570)
Goals
* Reflect Apple nullability annotations in our bindings using C#8
* No warnings when building bindings

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

Notes
* Apple's own annotations are not 100% accurate :(
* Where known issue exists we have _fixed_ our attributes to match reality :)
* We also do additional null-checks internally that might seems not required (better safe than sorry).
2020-04-09 09:29:28 -04:00
Rolf Bjarne Kvinge 5aff10b3c0
[msbuild] No need to pass --gsharedvt to mtouch anymore, mtouch ignores --gsharedvt since it must always be enabled. (#8270) 2020-04-02 17:22:17 +02:00
Alex Soto 3ff3e07ebe Merge remote-tracking branch 'xamarin/d16-5-xcode11.4' 2020-03-26 19:59:14 -04:00
Rolf Bjarne Kvinge c68700ad4f
Bump Xamarin.MacDev. (#8059)
* Bump Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

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

Diff: 210c664e56..a0a11aff27

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* [msbuild] Add support for Metal in the simulator. Fixes #7392. (#7983)
2020-02-28 19:59:03 +01:00
Sebastien Pouliot a40f6e8804
[msbuild][tests] Re-enable test case (issue fixed a while ago) (#8001) 2020-02-27 17:23:55 -05:00
Rolf Bjarne Kvinge df51d134c0
[msbuild] Add support for Metal in the simulator. Fixes #7392. (#7983) 2020-02-26 18:26:21 +01:00
Waleed Chaudhry bc878256f4
[msbuild] Update test engine to implement IBuildEngine4 (#7905) 2020-02-18 10:56:29 -05:00
Rolf Bjarne Kvinge d98a8f1792
[msbuild] Tweak the tests. (#7877)
This is a series of commits that tweaks the msbuild tests a little bit.

* [msbuild] Match configuration between MyWatchKit2Extension and MyWatchKit2IntentsExtension.

Fixes this warning:

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

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

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

* [msbuild] Clean up project files a bit.

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

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

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

* [msbuild] Simplify test project configuration a bit.

* [msbuild] Unify output path.

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

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

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

* [xtro] re-enable PDFKit

* Disable watchOS and fix xtro

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

Disables PDFKit on xtro in macOS

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

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

New commits in xamarin/maccore:

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

Diff: 55957e908d..546270c8f9

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

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

New commits in xamarin/macios-binaries:

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

Diff: eb6980e8b6..f8c6e63228

* [msbuild] Reflect ibtool changes in our tests

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

* [mtouch] Workaround strange behavior of realpath.

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

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

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

The method signature probably changed from a beta release to the corresponding
stable release, and this method was never updated.
2020-02-11 15:27:08 +01:00
Jonathan Peppers bba8fe731f
[msbuild] remove {GAC} from $(AssemblySearchPaths) (#7815)
Fixes: https://developercommunity.visualstudio.com/content/problem/788505/xamarin-found-conflicts-between-different-versions.html
Fixes: http://work.azdo.io/1008385
Context: 73b93c2dc9/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets (L337-L341)

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

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

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

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

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

Compared to Windows:

    Used locations
        {TargetFrameworkDirectory}
        {GAC}
        {RawFileName}

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

Xamarin.Mac is already doing this:

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

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

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

* Added a test assertion for this as well.
2020-02-07 08:54:29 -06:00
Rolf Bjarne Kvinge 9960ee43de
[msbuild] Fix several issues in the MyWatchApp2 test project. (#7804)
* [msbuild] Fix the MyWatchApp2 test project to include resources already present.

Fixes several warnings:

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

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

Fixes this warning:

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

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

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

> MyWatchApp2/obj/iPhoneSimulator/Debug/actool/cloned-assets/Resources/Images.xcassets : actool warning : The app icon set "AppIcons" has an unassigned child. [MyWatchApp2/MyWatchApp2.csproj]
2020-02-06 07:26:20 +01:00
Rolf Bjarne Kvinge 346e29397d
[msbuild] Remove unused files. (#7801) 2020-02-05 23:55:11 +01:00
Rolf Bjarne Kvinge 7bdb167ffe
[msbuild] Remove outdated AppStore and Ad-Hoc configurations from test projects. (#7777) 2020-02-03 13:56:49 +01:00
Rolf Bjarne Kvinge b5b74ff1c4
[msbuild] Remove unused csproj variable. (#7778) 2020-02-03 13:56:36 +01:00
Rolf Bjarne Kvinge 23275441af
[msbuild] Copy tests before making changes to them. (#7753)
Copy test projects to a temporary directory before using them for tests. This
makes sure tests don't leave a dirty working tree (because some tests modify
the on-disk test code).

We'll also start running tests using SDK-style project files, and this way
it's much easier to run tests twice, once using the old format and once using
the new format, and then compare the results.

Most of the changes are related to making the test projects and code
relocatable.
2020-01-24 16:15:34 +01:00
Rolf Bjarne Kvinge eb29f4375e
[msbuild] Remove unused conditional compilation directive. (#7747) 2020-01-24 08:59:55 +01:00
Bruno Garcia 455ed695bf fix: Template typos execution, transition (#7723)
* fix: Execution typo

* fix: transiton -> transition
2020-01-20 15:29:23 +01:00
Rolf Bjarne Kvinge 54b07b2f2d
[msbuild] Build the MSBuild task assemblies for netstandard2.0. (#7706)
* Bump Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@210c664 Adds net451 to Xamarin.MacDev.csproj
* xamarin/Xamarin.MacDev@64db365 [winios] Changes provisioning profiles default path
* xamarin/Xamarin.MacDev@d34430a Switch to short-form projects and build for both net461 and netstandard2.0. (#68)

Diff: 0f578f51e6..210c664e56

* [msbuild] Update to latest Mono.Cecil.

The older version doesn't support netstandard2.0.

No code changes were required.

* [msbuild] Remove unused usings.

* [msbuild] Make ILMerge work when building for netstandard2.0.

Also unify/deduplicate the ILMerge logic between Xamarin.iOS and Xamarin.Mac.

* [msbuild] Build for netstandard2.0 in addition to net461.

* [msbuild] Use custom project configurations to support running the tests for both netstandard2.0 and net461.

Use custom project configurations to support running the tests for when the
tasks assembly is built for netstandard2.0 and net461.

* [tests] Make command-line based 'make test-ios-tasks' run tests for both netstandard2.0 and net461.

* [xharness] Add test configuration to run iOS MSBuild tests using either netstandard2.0 or net461.

* [msbuild] Make the netstandard2.0-buils task assemblies the default.

* [msbuild] ILRepack lib assemblies, not ref assemblies.

Ask MSBuild to copy lib assemblies to the output folder when building for
netstandard2.0, this way we can easily find the actual implementation
libraries to pass to ILRepack.

* [msbuild] Merge System.Text.Encodings.Web.dll as well.

* [xharness] Fix build of MSBuild tests for iOS.
2020-01-16 18:22:48 +01:00
Rolf Bjarne Kvinge c4e15ed6b6
[msbuild] Convert project files to sdk-style project files. (#7698)
* [msbuild] Convert to short-form csproj.

* [msbuild] Make asserts more useful.

* [msbuild] Make tests ignore the actual location of the test assembly.

* [msbuild] Short-style projects default to deterministic builds, which is not compatible with wildcard versions.

* [msbuild] Adjust test.

* Update .gitignore.

* Bump NUnit.ConsoleRunner version.

* [msbuild] Fix indentation.

* [msbuild] Simplify csproj.
2020-01-14 08:16:02 +01:00
Rolf Bjarne Kvinge 087e00e305
[msbuild] Adjust test to work locally by being less demanding. (#7694)
These tests were checking if mtouch is called (or not) by checking for the
full installed path to mtouch. When running the tests locally, we're using the
locally built mtouch, and thus the path is different and the tests failed.

Instead check for a smaller substring that is present in both cases.
2020-01-10 18:41:11 +01:00
monojenkins fd91cf731d [d16-5] [msbuild] Add verbosity options on separate lines for mtouch parsing (#7673)
This is more strict than the response-file spec [0] (and filed as a
separate issue [1]) but `mtouch` currently requires one option-per-line
(for filtering some options) for the cache to work properly (i.e. so it
can ignore the `-v` and the `-q` and re-use the existing, cached,
binaries). E.g. from:

```
...
-v -v -v -v
```

to

```
...
-v
-v
-v
-v
```

This is an optimization fix (since cached output helps build times) and
it's also part of a bug fix [2] (part of another commit [3], that was
reverted [4] due to other issues, like this one).

This needs another fix [5] to work properly (like `mtouch` requires)
but both can be applied separately (so different PR for different
changes).

[0] https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/response-file-compiler-option
[1] https://github.com/xamarin/xamarin-macios/issues/7644
[2] https://github.com/xamarin/xamarin-macios/issues/7514
[3] https://github.com/xamarin/xamarin-macios/pull/7544
[4] https://github.com/xamarin/xamarin-macios/pull/7589
[5] https://github.com/xamarin/xamarin-macios/pull/7647


Co-authored-by: Sebastien Pouliot <sebastien.pouliot@gmail.com>
2020-01-06 16:52:36 -05:00
Sebastien Pouliot 229edf7f85 [msbuild] Add verbosity options on separate lines for mtouch parsing (#7649)
This is more strict than the response-file spec [0] (and filed as a
separate issue [1]) but `mtouch` currently requires one option-per-line
(for filtering some options) for the cache to work properly (i.e. so it
can ignore the `-v` and the `-q` and re-use the existing, cached,
binaries). E.g. from:

```
...
-v -v -v -v
```

to

```
...
-v
-v
-v
-v
```

This is an optimization fix (since cached output helps build times) and
it's also part of a bug fix [2] (part of another commit [3], that was
reverted [4] due to other issues, like this one).

This needs another fix [5] to work properly (like `mtouch` requires)
but both can be applied separately (so different PR for different
changes).

[0] https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/response-file-compiler-option
[1] https://github.com/xamarin/xamarin-macios/issues/7644
[2] https://github.com/xamarin/xamarin-macios/issues/7514
[3] https://github.com/xamarin/xamarin-macios/pull/7544
[4] https://github.com/xamarin/xamarin-macios/pull/7589
[5] https://github.com/xamarin/xamarin-macios/pull/7647
2020-01-02 15:02:28 -05:00
Rolf Bjarne Kvinge 5c7b669b5b [msbuild] Don't leave changes behind if a test fails. (#7636) 2019-12-23 13:30:12 -05:00
Rolf Bjarne Kvinge cf97aaf971
[msbuild] Don't use gdk-sharp, use native functions instead. (#7623)
* [msbuild] Don't use gdk-sharp, use native functions instead.

There's no netstandard version of gdk-sharp.

* Don't require the source checkout to be named 'xamarin-macios'.
2019-12-19 15:21:09 +01:00
Rolf Bjarne Kvinge 6ceb45c9fc
Merge pull request #7611 from rolfbjarne/msbuild-use-system-text-json
[msbuild] Use System.Text.Json instead of System.Json, since only the former is available in .netcore.
2019-12-19 00:35:04 +01:00
Rolf Bjarne Kvinge 8c589c0093
[msbuild] Remove unused file. (#7610) 2019-12-18 07:15:49 +01:00
Rolf Bjarne Kvinge b7a50608f6 [msbuild] Adjust the Bug60536 test so that it continues to fail as expected after switching json parser.
The Bug60536 is about showing a good error message if the json in an asset
pack is invalid. It turns out that System.Text.Json is a bit more permissive
than System.Json, so the json that was previously failing to parse is now
parsing fine [1]. So introduce something that is certainly invalid json
everywhere, and update the test itself as well to cope with different error
message and error location.

Also remove workaround for xbuild in this test, since xbuild isn't used anymore.

[1]: Technically the json is still invalid, because according to the json spec
it's not valid to end a list of array elements with a trailing comma. The
problem is that System.Json would in some cases allow trailing commas for
lists of array elements, and sometimes not, which means that we have to ask
System.Text.Json to allow trailing commas as well. And when System.Text.Json
is asked to allow trailing commas, it also successfully parses a case of
trailing comma where System.Json didn't, thus the need for coming up with
something even more invalid.
2019-12-17 11:28:42 +01:00
Rolf Bjarne Kvinge c422869c4b
[msbuild] Update tests to NUnit 3.12. (#7597)
Updating the msbuild tasks to use netstandard2.0 requires us to bump NUnit to 3+.

This requires:

* A few code changes due to breaking API changes in NUnit.
* Changes in xharness and a makefile to cope with the new location for the
  NUnit console runner (I added a helper script to make things slightly
  easier).
2019-12-16 23:55:59 +01:00