From ce207d263f84e36888db234186ca6a6169a1c291 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Fri, 7 Sep 2018 08:52:38 -0400 Subject: [PATCH] Order additional arguments after response file (#4607) (#4612) (#4769) - https://github.com/xamarin/xamarin-macios/issues/4594 - There were being adding _before_ the response file which meant options that were overriding defaults were not being honored --- .../Tasks/MmpTaskBase.cs | 13 +- .../Tasks/MTouchTaskBase.cs | 16 +- .../AppDelegate.cs | 59 +++++ .../AppWithExtraArgumentThatOverrides.csproj | 110 ++++++++++ .../AppWithExtraArgumentThatOverrides.sln | 23 ++ .../AppIcon.appiconset/Contents.json | 202 ++++++++++++++++++ .../Assets.xcassets/Contents.json | 6 + .../Entitlements.plist | 6 + .../Info.plist | 40 ++++ .../LaunchScreen.storyboard | 27 +++ .../AppWithExtraArgumentThatOverrides/Main.cs | 15 ++ .../Main.storyboard | 26 +++ .../ViewController.cs | 26 +++ .../ViewController.designer.cs | 17 ++ .../ProjectsTests/ResponseFileArguments.cs | 22 ++ .../Xamarin.iOS.Tasks.Tests.csproj | 1 + tests/mmptest/src/LinkerTests.cs | 10 + tools/mmp/driver.cs | 1 + 18 files changed, 611 insertions(+), 9 deletions(-) create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/AppDelegate.cs create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/AppWithExtraArgumentThatOverrides.csproj create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/AppWithExtraArgumentThatOverrides.sln create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/Assets.xcassets/Contents.json create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/Entitlements.plist create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/Info.plist create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/LaunchScreen.storyboard create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/Main.cs create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/Main.storyboard create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/ViewController.cs create mode 100644 msbuild/tests/AppWithExtraArgumentThatOverrides/ViewController.designer.cs create mode 100644 msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/ResponseFileArguments.cs diff --git a/msbuild/Xamarin.Mac.Tasks.Core/Tasks/MmpTaskBase.cs b/msbuild/Xamarin.Mac.Tasks.Core/Tasks/MmpTaskBase.cs index 12a266475dfd..e732a153bf0a 100644 --- a/msbuild/Xamarin.Mac.Tasks.Core/Tasks/MmpTaskBase.cs +++ b/msbuild/Xamarin.Mac.Tasks.Core/Tasks/MmpTaskBase.cs @@ -102,7 +102,6 @@ protected override bool ValidateParameters () protected override string GenerateCommandLineCommands () { var args = new CommandLineArgumentBuilder (); - var actualArgs = new CommandLineArgumentBuilder (); bool msym; args.AddLine ("/verbose"); @@ -203,9 +202,6 @@ protected override string GenerateCommandLineCommands () args.AddQuotedLine ("/root-assembly:" + Path.GetFullPath (ApplicationAssembly.ItemSpec)); } - if (!string.IsNullOrWhiteSpace (ExtraArguments)) - actualArgs.Add (ExtraArguments); - if (NativeReferences != null) { foreach (var nr in NativeReferences) args.AddQuotedLine ("/native-reference:" + Path.GetFullPath (nr.ItemSpec)); @@ -237,9 +233,16 @@ protected override string GenerateCommandLineCommands () Log.LogWarning ("Failed to create response file '{0}': {1}", responseFile, ex); } - // Use only the response file + // Some arguments can not safely go in the response file and are + // added separately. They must go _after_ the response file + // as they may override options passed in the response file + var actualArgs = new CommandLineArgumentBuilder (); + actualArgs.AddQuoted ($"@{responseFile}"); + if (!string.IsNullOrWhiteSpace (ExtraArguments)) + actualArgs.Add (ExtraArguments); + return actualArgs.ToString (); } diff --git a/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs b/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs index 857b6544a229..c0159bc5bc34 100644 --- a/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs +++ b/msbuild/Xamarin.iOS.Tasks.Core/Tasks/MTouchTaskBase.cs @@ -360,7 +360,8 @@ static string Unquote (string text, int startIndex) protected override string GenerateCommandLineCommands () { var args = new CommandLineArgumentBuilder (); - var actualArgs = new CommandLineArgumentBuilder (); + List unescapedArgs = new List (); + TargetArchitecture architectures; bool msym; @@ -561,7 +562,7 @@ protected override string GenerateCommandLineCommands () } } else { // other user-defined mtouch arguments - actualArgs.AddQuoted (StringParserService.Parse (argument, customTags)); + unescapedArgs.Add (StringParserService.Parse (argument, customTags)); } } } @@ -579,7 +580,7 @@ protected override string GenerateCommandLineCommands () args.AddLine ("--cxx"); if (gcc.Arguments.Length > 0) - actualArgs.AddQuoted ($"--gcc_flags={gcc.Arguments.ToString ()}"); + unescapedArgs.Add ($"--gcc_flags={gcc.Arguments.ToString ()}"); foreach (var asm in References) { if (IsFrameworkItem(asm)) { @@ -618,9 +619,16 @@ protected override string GenerateCommandLineCommands () Log.LogWarning ("Failed to create response file '{0}': {1}", responseFile, ex); } - // Use only the response file + // Some arguments can not safely go in the response file and are + // added separately. They must go _after_ the response file + // as they may override options passed in the response file + var actualArgs = new CommandLineArgumentBuilder (); + actualArgs.AddQuoted ($"@{responseFile}"); + foreach (var arg in unescapedArgs) + actualArgs.AddQuoted (arg); + return actualArgs.ToString (); } diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/AppDelegate.cs b/msbuild/tests/AppWithExtraArgumentThatOverrides/AppDelegate.cs new file mode 100644 index 000000000000..cd8308288342 --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/AppDelegate.cs @@ -0,0 +1,59 @@ +using Foundation; +using UIKit; + +namespace AppWithExtraArgumentThatOverrides +{ + // The UIApplicationDelegate for the application. This class is responsible for launching the + // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. + [Register ("AppDelegate")] + public class AppDelegate : UIApplicationDelegate + { + // class-level declarations + + public override UIWindow Window + { + get; + set; + } + + public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) + { + // Override point for customization after application launch. + // If not required for your application you can safely delete this method + + return true; + } + + public override void OnResignActivation (UIApplication application) + { + // Invoked when the application is about to move from active to inactive state. + // This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) + // or when the user quits the application and it begins the transition to the background state. + // Games should use this method to pause the game. + } + + public override void DidEnterBackground (UIApplication application) + { + // Use this method to release shared resources, save user data, invalidate timers and store the application state. + // If your application supports background exection this method is called instead of WillTerminate when the user quits. + } + + public override void WillEnterForeground (UIApplication application) + { + // Called as part of the transiton from background to active state. + // Here you can undo many of the changes made on entering the background. + } + + public override void OnActivated (UIApplication application) + { + // Restart any tasks that were paused (or not yet started) while the application was inactive. + // If the application was previously in the background, optionally refresh the user interface. + } + + public override void WillTerminate (UIApplication application) + { + // Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground. + } + } +} + diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/AppWithExtraArgumentThatOverrides.csproj b/msbuild/tests/AppWithExtraArgumentThatOverrides/AppWithExtraArgumentThatOverrides.csproj new file mode 100644 index 000000000000..21b8abe96350 --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/AppWithExtraArgumentThatOverrides.csproj @@ -0,0 +1,110 @@ + + + + Debug + iPhoneSimulator + {EE94F06F-56CB-4A1A-A9C6-858D2D70D9CE} + {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Exe + AppWithExtraArgumentThatOverrides + AppWithExtraArgumentThatOverrides + Resources + + + true + full + false + bin\iPhoneSimulator\Debug + DEBUG;ENABLE_TEST_CLOUD; + prompt + 4 + iPhone Developer + true + true + true + 47045 + None + x86_64 + HttpClientHandler + x86 + --linksdkonly -v -v + + + pdbonly + true + bin\iPhone\Release + prompt + 4 + iPhone Developer + true + Entitlements.plist + SdkOnly + ARM64 + HttpClientHandler + x86 + + + pdbonly + true + bin\iPhoneSimulator\Release + prompt + 4 + iPhone Developer + true + None + x86_64 + HttpClientHandler + x86 + + + true + full + false + bin\iPhone\Debug + DEBUG;ENABLE_TEST_CLOUD; + prompt + 4 + iPhone Developer + true + true + true + true + true + Entitlements.plist + 59771 + SdkOnly + ARM64 + HttpClientHandler + x86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + ViewController.cs + + + + \ No newline at end of file diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/AppWithExtraArgumentThatOverrides.sln b/msbuild/tests/AppWithExtraArgumentThatOverrides/AppWithExtraArgumentThatOverrides.sln new file mode 100644 index 000000000000..fb63e8fb9f49 --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/AppWithExtraArgumentThatOverrides.sln @@ -0,0 +1,23 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppWithExtraArgumentThatOverrides", "AppWithExtraArgumentThatOverrides.csproj", "{EE94F06F-56CB-4A1A-A9C6-858D2D70D9CE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|iPhoneSimulator = Debug|iPhoneSimulator + Release|iPhone = Release|iPhone + Release|iPhoneSimulator = Release|iPhoneSimulator + Debug|iPhone = Debug|iPhone + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EE94F06F-56CB-4A1A-A9C6-858D2D70D9CE}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {EE94F06F-56CB-4A1A-A9C6-858D2D70D9CE}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {EE94F06F-56CB-4A1A-A9C6-858D2D70D9CE}.Release|iPhone.ActiveCfg = Release|iPhone + {EE94F06F-56CB-4A1A-A9C6-858D2D70D9CE}.Release|iPhone.Build.0 = Release|iPhone + {EE94F06F-56CB-4A1A-A9C6-858D2D70D9CE}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {EE94F06F-56CB-4A1A-A9C6-858D2D70D9CE}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {EE94F06F-56CB-4A1A-A9C6-858D2D70D9CE}.Debug|iPhone.ActiveCfg = Debug|iPhone + {EE94F06F-56CB-4A1A-A9C6-858D2D70D9CE}.Debug|iPhone.Build.0 = Debug|iPhone + EndGlobalSection +EndGlobal diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/Assets.xcassets/AppIcon.appiconset/Contents.json b/msbuild/tests/AppWithExtraArgumentThatOverrides/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..64d0e3ddf877 --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,202 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + }, + { + "size" : "24x24", + "idiom" : "watch", + "scale" : "2x", + "role" : "notificationCenter", + "subtype" : "38mm" + }, + { + "size" : "27.5x27.5", + "idiom" : "watch", + "scale" : "2x", + "role" : "notificationCenter", + "subtype" : "42mm" + }, + { + "size" : "29x29", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "38mm" + }, + { + "size" : "44x44", + "idiom" : "watch", + "scale" : "2x", + "role" : "longLook", + "subtype" : "42mm" + }, + { + "size" : "86x86", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "38mm" + }, + { + "size" : "98x98", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "42mm" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/Assets.xcassets/Contents.json b/msbuild/tests/AppWithExtraArgumentThatOverrides/Assets.xcassets/Contents.json new file mode 100644 index 000000000000..4caf392f92c9 --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/Entitlements.plist b/msbuild/tests/AppWithExtraArgumentThatOverrides/Entitlements.plist new file mode 100644 index 000000000000..9ae599370b42 --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/Info.plist b/msbuild/tests/AppWithExtraArgumentThatOverrides/Info.plist new file mode 100644 index 000000000000..45a6ed5ea808 --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleName + AppWithExtraArgumentThatOverrides + CFBundleIdentifier + com.companyname.AppWithExtraArgumentThatOverrides + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + MinimumOSVersion + 11.4 + UIDeviceFamily + + 1 + 2 + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/AppIcon.appiconset + + diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/LaunchScreen.storyboard b/msbuild/tests/AppWithExtraArgumentThatOverrides/LaunchScreen.storyboard new file mode 100644 index 000000000000..5d2e905aa808 --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/Main.cs b/msbuild/tests/AppWithExtraArgumentThatOverrides/Main.cs new file mode 100644 index 000000000000..4ab6cd44952a --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/Main.cs @@ -0,0 +1,15 @@ +using UIKit; + +namespace AppWithExtraArgumentThatOverrides +{ + public class Application + { + // This is the main entry point of the application. + static void Main (string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main (args, null, "AppDelegate"); + } + } +} diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/Main.storyboard b/msbuild/tests/AppWithExtraArgumentThatOverrides/Main.storyboard new file mode 100644 index 000000000000..cb656be6cdff --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/ViewController.cs b/msbuild/tests/AppWithExtraArgumentThatOverrides/ViewController.cs new file mode 100644 index 000000000000..81278835a8da --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/ViewController.cs @@ -0,0 +1,26 @@ +using System; + +using UIKit; + +namespace AppWithExtraArgumentThatOverrides +{ + public partial class ViewController : UIViewController + { + protected ViewController (IntPtr handle) : base (handle) + { + // Note: this .ctor should not contain any initialization logic. + } + + public override void ViewDidLoad () + { + base.ViewDidLoad (); + // Perform any additional setup after loading the view, typically from a nib. + } + + public override void DidReceiveMemoryWarning () + { + base.DidReceiveMemoryWarning (); + // Release any cached data, images, etc that aren't in use. + } + } +} diff --git a/msbuild/tests/AppWithExtraArgumentThatOverrides/ViewController.designer.cs b/msbuild/tests/AppWithExtraArgumentThatOverrides/ViewController.designer.cs new file mode 100644 index 000000000000..2eb177ad745b --- /dev/null +++ b/msbuild/tests/AppWithExtraArgumentThatOverrides/ViewController.designer.cs @@ -0,0 +1,17 @@ +// +// This file has been generated automatically by MonoDevelop to store outlets and +// actions made in the Xcode designer. If it is removed, they will be lost. +// Manual changes to this file may not be handled correctly. +// +using Foundation; + +namespace AppWithExtraArgumentThatOverrides +{ + [Register ("ViewController")] + partial class ViewController + { + void ReleaseDesignerOutlets () + { + } + } +} diff --git a/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/ResponseFileArguments.cs b/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/ResponseFileArguments.cs new file mode 100644 index 000000000000..ab898a892e9b --- /dev/null +++ b/msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/ResponseFileArguments.cs @@ -0,0 +1,22 @@ +using System; +using System.IO; +using System.Linq; +using NUnit.Framework; + +namespace Xamarin.iOS.Tasks +{ + public class ResponseFileArguments : ProjectTest + { + public ResponseFileArguments () : base ("iPhoneSimulator") + { + } + + [Test] + public void ProjectWithExtraArgment_CorrectlyOverridesLinkingParam () + { + BuildProject ("AppWithExtraArgumentThatOverrides", Platform, "Debug", clean: true); + Assert.True (Engine.Logger.MessageEvents.Any (x => x.Message.Contains ("using mode 'SDKOnly'"))); + } + } +} + diff --git a/msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj b/msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj index 1f2f817bd88b..f02fe20e29b3 100644 --- a/msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj +++ b/msbuild/tests/Xamarin.iOS.Tasks.Tests/Xamarin.iOS.Tasks.Tests.csproj @@ -107,6 +107,7 @@ ExecutionHelper.cs + diff --git a/tests/mmptest/src/LinkerTests.cs b/tests/mmptest/src/LinkerTests.cs index bc4d8a0001c1..51f5737ec135 100644 --- a/tests/mmptest/src/LinkerTests.cs +++ b/tests/mmptest/src/LinkerTests.cs @@ -125,5 +125,15 @@ public void Linking_ShouldHandleMixedModeAssemblies (string linker, bool builds_ Assert.True (buildOutput.Contains ("2014") == builds_successfully, $"Building with {linker} did not give 2014 status {builds_successfully} as expected.\n\n{buildOutput}"); }); } + + [Test] + public void LinkingAdditionalArguments_ShouldBeUsed () + { + MMPTests.RunMMPTest (tmpDir => { + TI.UnifiedTestConfig test = new TI.UnifiedTestConfig (tmpDir) { CSProjConfig = "-v -v --linkplatform" }; + string buildOutput = TI.TestUnifiedExecutable (test).BuildOutput; + Assert.IsTrue (buildOutput.Contains ("Selected Linking: 'Platform'"), $"Build Output did not contain expected selected linking line: {buildOutput}"); + }); + } } } diff --git a/tools/mmp/driver.cs b/tools/mmp/driver.cs index 92db2d8f4953..6a8114fc9809 100644 --- a/tools/mmp/driver.cs +++ b/tools/mmp/driver.cs @@ -505,6 +505,7 @@ static void Main2 (string [] args) if (verbose > 0) Console.WriteLine ("Selected target framework: {0}; API: {1}", targetFramework, IsClassic ? "Classic" : "Unified"); + Log (1, $"Selected Linking: '{App.LinkMode}'"); if (action == Action.RunRegistrar) { App.Registrar = RegistrarMode.Static;