diff --git a/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx b/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx index cae2cb561191..73f4ff1ab063 100644 --- a/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx +++ b/msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx @@ -1619,4 +1619,8 @@ Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information. + + + The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose. + diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompile.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompile.cs index 3adaa8afd0d9..3a546dfbb4fb 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompile.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompile.cs @@ -36,9 +36,6 @@ public class AOTCompile : XamarinParallelTask, ITaskCallback, ICancelableTask { [Required] public string OutputDirectory { get; set; } = string.Empty; - [Required] - public string SdkDevPath { get; set; } = string.Empty; - #region Output [Output] public ITaskItem []? AssemblyFiles { get; set; } @@ -341,7 +338,7 @@ public override bool Execute () environment [item.ItemSpec] = item.GetMetadata ("Value"); ForEach (listOfArguments, (arg) => { - ExecuteAsync (AOTCompilerPath, arg.Arguments, environment: environment, sdkDevPath: SdkDevPath, showErrorIfFailure: false /* we show our own error below */) + ExecuteAsync (AOTCompilerPath, arg.Arguments, environment: environment, sdkDevPath: GetSdkDevPath (), showErrorIfFailure: false /* we show our own error below */) .ContinueWith ((v) => { if (v.Result.ExitCode != 0) Log.LogError (MSBStrings.E7118 /* Failed to AOT compile {0}, the AOT compiler exited with code {1} */, Path.GetFileName (arg.Input), v.Result.ExitCode); diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/AlTool.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/AlTool.cs index 366f00d9ada1..1ba536e83233 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/AlTool.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/AlTool.cs @@ -27,9 +27,6 @@ public abstract class ALToolTaskBase : XamarinTask, ICancelableTask { [Required] public string FilePath { get; set; } = string.Empty; - [Required] - public string SdkDevPath { get; set; } = string.Empty; - protected abstract string ALToolAction { get; } public override bool Execute () @@ -44,7 +41,7 @@ public override bool Execute () return false; cancellationTokenSource = new CancellationTokenSource (); - var rv = ExecuteAsync (Log, executable, args, sdkDevPath: SdkDevPath, cancellationToken: cancellationTokenSource.Token).Result; + var rv = ExecuteAsync (Log, executable, args, sdkDevPath: GetSdkDevPath (), cancellationToken: cancellationTokenSource.Token).Result; LogErrorsFromOutput (rv.Output.MergedOutput); return !Log.HasLoggedErrors; } diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileNativeCode.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileNativeCode.cs index ea95c3530e4a..a8a4d5489b02 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileNativeCode.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileNativeCode.cs @@ -25,9 +25,6 @@ public class CompileNativeCode : XamarinTask, ICancelableTask, ITaskCallback { [Required] public string MinimumOSVersion { get; set; } = ""; - [Required] - public string SdkDevPath { get; set; } = ""; - [Required] public string SdkRoot { get; set; } = ""; @@ -142,7 +139,7 @@ public override bool Execute () arguments.Add ("-c"); arguments.Add (src); - processes [i] = ExecuteAsync ("xcrun", arguments, sdkDevPath: SdkDevPath); + processes [i] = ExecuteAsync ("xcrun", arguments, sdkDevPath: GetSdkDevPath ()); } System.Threading.Tasks.Task.WaitAll (processes); diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileSceneKitAssets.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileSceneKitAssets.cs index 3f50e6199dee..ab24ad7035d1 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileSceneKitAssets.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/CompileSceneKitAssets.cs @@ -37,9 +37,6 @@ public class CompileSceneKitAssets : XamarinTask, ICancelableTask, IHasProjectDi [Required] public ITaskItem [] SceneKitAssets { get; set; } = Array.Empty (); - [Required] - public string SdkDevPath { get; set; } = ""; - [Required] public string SdkPlatform { get; set; } = ""; @@ -87,7 +84,7 @@ Task CopySceneKitAssets (string scnassets, string output, string intermediate) var executable = GetExecutable (args, ToolName, CopySceneKitAssetsPath); - return ExecuteAsync (executable, args, sdkDevPath: SdkDevPath, environment: environment, showErrorIfFailure: true); + return ExecuteAsync (executable, args, sdkDevPath: GetSdkDevPath (), environment: environment, showErrorIfFailure: true); } static bool TryGetScnAssetsPath (string file, out string scnassets) diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/CoreMLCompiler.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/CoreMLCompiler.cs index f30f62555eb7..864747e9ea67 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/CoreMLCompiler.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/CoreMLCompiler.cs @@ -30,11 +30,6 @@ public class CoreMLCompiler : XamarinTask, ICancelableTask, IHasProjectDir, IHas [Required] public string ResourcePrefix { get; set; } = ""; - string sdkDevPath = ""; - public string SdkDevPath { - get { return string.IsNullOrEmpty (sdkDevPath) ? "/" : sdkDevPath; } - set { sdkDevPath = value; } - } #endregion #region Outputs @@ -60,7 +55,7 @@ int Compile (ITaskItem item, string outputDir, string log, string partialPlist) args.Add (partialPlist); var executable = GetExecutable (args, ToolName, CoreMlcPath); - var rv = ExecuteAsync (executable, args, sdkDevPath).Result; + var rv = ExecuteAsync (executable, args, GetSdkDevPath ()).Result; var exitCode = rv.ExitCode; var output = rv.Output.StandardOutput; File.WriteAllText (log, output); diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/DSymUtil.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/DSymUtil.cs index 58011d2fbc90..ff6da8a221fc 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/DSymUtil.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/DSymUtil.cs @@ -21,9 +21,6 @@ public class DSymUtil : XamarinTask, ITaskCallback { [Required] public ITaskItem [] Executable { get; set; } = Array.Empty (); - [Required] - public string SdkDevPath { get; set; } = string.Empty; - #endregion #region Outputs @@ -65,7 +62,7 @@ void ExecuteDSymUtil (ITaskItem item, List contentFiles) args.Add (dSymDir); args.Add (Path.GetFullPath (item.ItemSpec)); - ExecuteAsync ("xcrun", args, sdkDevPath: SdkDevPath).Wait (); + ExecuteAsync ("xcrun", args, sdkDevPath: GetSdkDevPath ()).Wait (); var contentsDir = Path.Combine (dSymDir, "Contents"); if (Directory.Exists (contentsDir)) diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSdkLocation.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSdkLocation.cs index 084c0cc3ecd3..024ab9ef58ac 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSdkLocation.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSdkLocation.cs @@ -30,9 +30,10 @@ public string SdkRoot { } = ""; [Output] - public string SdkDevPath { - get; set; - } = ""; + public new string SdkDevPath { + get => base.SdkDevPath; + set => base.SdkDevPath = value; + } [Output] public string SdkPlatform { diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs index 0c0f8efc00f6..5f088bec35f2 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs @@ -27,9 +27,6 @@ public class GetMlaunchArguments : XamarinTask, ICancelableTask { public string AppManifestPath { get; set; } = string.Empty; - [Required] - public string SdkDevPath { get; set; } = string.Empty; - public ITaskItem [] AdditionalArguments { get; set; } = Array.Empty (); public string DeviceName { get; set; } = string.Empty; public ITaskItem [] EnvironmentVariables { get; set; } = Array.Empty (); @@ -112,7 +109,7 @@ public IPhoneDeviceType DeviceType { var tmpfile = Path.GetTempFileName (); try { var output = new StringBuilder (); - var result = ExecuteAsync (MlaunchPath, new string [] { "--listsim", tmpfile }, SdkDevPath).Result; + var result = ExecuteAsync (MlaunchPath, new string [] { "--listsim", tmpfile }, GetSdkDevPath ()).Result; if (result.ExitCode != 0) return string.Empty; simulator_list = File.ReadAllText (tmpfile); @@ -130,7 +127,7 @@ public IPhoneDeviceType DeviceType { var tmpfile = Path.GetTempFileName (); try { var output = new StringBuilder (); - var result = ExecuteAsync (MlaunchPath, new string [] { $"--listdev:{tmpfile}", "--output-format:xml", "--use-amdevice:false" }, SdkDevPath).Result; + var result = ExecuteAsync (MlaunchPath, new string [] { $"--listdev:{tmpfile}", "--output-format:xml", "--use-amdevice:false" }, GetSdkDevPath ()).Result; if (result.ExitCode != 0) return string.Empty; device_list = File.ReadAllText (tmpfile); diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs index 8430835aefee..444be72981de 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs @@ -15,9 +15,6 @@ public class InstallNameTool : XamarinTask, ITaskCallback { [Required] public ITaskItem [] DynamicLibrary { get; set; } = []; - [Required] - public string SdkDevPath { get; set; } = ""; - // This isn't consumed from the targets files, but it's needed for VSX to create corresponding // files on Windows. [Output] @@ -50,7 +47,7 @@ public override bool Execute () arguments.Add (input.GetMetadata ("DynamicLibraryId")); arguments.Add (temporaryTarget); - processes [i] = ExecuteAsync ("xcrun", arguments, sdkDevPath: SdkDevPath).ContinueWith ((v) => { + processes [i] = ExecuteAsync ("xcrun", arguments, sdkDevPath: GetSdkDevPath ()).ContinueWith ((v) => { if (v.IsFaulted) throw v.Exception; if (v.Status == TaskStatus.RanToCompletion) { diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/LinkNativeCode.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/LinkNativeCode.cs index ad7f93d0114c..02a7eaf4823f 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/LinkNativeCode.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/LinkNativeCode.cs @@ -21,9 +21,6 @@ public class LinkNativeCode : XamarinTask, ITaskCallback { // A path to entitlements to be embedded into the executable public string EntitlementsInExecutable { get; set; } = string.Empty; - [Required] - public string SdkDevPath { get; set; } = string.Empty; - [Required] public bool SdkIsSimulator { get; set; } @@ -213,7 +210,7 @@ bool ExecuteUnsafe () arguments.Add (flag.ItemSpec); } - var rv = ExecuteAsync ("xcrun", arguments, sdkDevPath: SdkDevPath, showErrorIfFailure: false).Result; + var rv = ExecuteAsync ("xcrun", arguments, sdkDevPath: GetSdkDevPath (), showErrorIfFailure: false).Result; if (rv.ExitCode != 0) { var stderr = rv.Output.MergedOutput; #if NET @@ -284,7 +281,7 @@ string ConvertEntitlementsToDerEntitlements (string entitlements) "-o", derEntitlements, "--raw", }; - ExecuteAsync ("xcrun", arguments, sdkDevPath: SdkDevPath).Wait (); + ExecuteAsync ("xcrun", arguments, sdkDevPath: GetSdkDevPath ()).Wait (); return derEntitlements; } diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/MergeAppBundles.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/MergeAppBundles.cs index 5f8fcf89c516..ffdc7818a440 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/MergeAppBundles.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/MergeAppBundles.cs @@ -46,9 +46,6 @@ public partial class MergeAppBundles : XamarinTask { [Required] public string OutputAppBundle { get; set; } = ""; - [Required] - public string SdkDevPath { get; set; } = ""; - #endregion enum FileType { @@ -441,7 +438,7 @@ void MergeMachOFiles (string output, IList input) arguments.Add ("-output"); arguments.Add (output); arguments.AddRange (sourceFiles); - ExecuteAsync ("lipo", arguments, sdkDevPath: SdkDevPath).Wait (); + ExecuteAsync ("lipo", arguments, sdkDevPath: GetSdkDevPath ()).Wait (); } FileType GetFileType (string path) diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/Metal.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/Metal.cs index 8e5c4b298ebe..0329254e0617 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/Metal.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/Metal.cs @@ -32,9 +32,6 @@ public class Metal : XamarinTask, IHasProjectDir, IHasResourcePrefix { [Required] public string ResourcePrefix { get; set; } = string.Empty; - [Required] - public string SdkDevPath { get; set; } = string.Empty; - [Required] public string SdkVersion { get; set; } = string.Empty; diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/MetalLib.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/MetalLib.cs index 804c846c14fe..88b7da3db0ed 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/MetalLib.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/MetalLib.cs @@ -25,9 +25,6 @@ public class MetalLib : XamarinTask, ITaskCallback { [Required] public string OutputLibrary { get; set; } = string.Empty; - [Required] - public string SdkDevPath { get; set; } = string.Empty; - [Required] public string SdkRoot { get; set; } = string.Empty; diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizeImage.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizeImage.cs index 6fef2efe045f..b39456725f3d 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizeImage.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizeImage.cs @@ -29,9 +29,6 @@ public class OptimizeImage : XamarinParallelTask, ICancelableTask { public string PngCrushPath { get; set; } = string.Empty; - [Required] - public string SdkDevPath { get; set; } = string.Empty; - #endregion static List GenerateCommandLineCommands (string inputImage, string outputImage) @@ -92,7 +89,7 @@ public override bool Execute () ForEach (listOfArguments, (arg) => { var args = arg.Arguments; var executable = GetExecutable (args, "pngcrush", PngCrushPath); - ExecuteAsync (Log, executable, args, sdkDevPath: SdkDevPath, showErrorIfFailure: false /* we show our own error below */, cancellationToken: cancellationTokenSource.Token) + ExecuteAsync (Log, executable, args, sdkDevPath: GetSdkDevPath (), showErrorIfFailure: false /* we show our own error below */, cancellationToken: cancellationTokenSource.Token) .ContinueWith ((v) => { Execution execution = v.Result; if (execution.ExitCode != 0) diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/ScnTool.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/ScnTool.cs index 5f8e9617c1a8..f0b58104cb04 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/ScnTool.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/ScnTool.cs @@ -39,9 +39,6 @@ public class ScnTool : XamarinParallelTask, IHasProjectDir, IHasResourcePrefix { [Required] public string SdkVersion { get; set; } = string.Empty; - [Required] - public string SdkDevPath { get; set; } = string.Empty; - #endregion #region Outputs @@ -91,7 +88,7 @@ public override bool Execute () } ForEach (listOfArguments, (arg) => { - ExecuteAsync ("xcrun", arg.Arguments, sdkDevPath: SdkDevPath).Wait (); + ExecuteAsync ("xcrun", arg.Arguments, sdkDevPath: GetSdkDevPath ()).Wait (); }); BundleResources = bundleResources.ToArray (); diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/XamarinTask.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/XamarinTask.cs index 1bbb84be1afc..a95732ea6cf6 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/XamarinTask.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/XamarinTask.cs @@ -23,11 +23,23 @@ public abstract class XamarinTask : Task, IHasSessionId, ICustomLogger { public string TargetFrameworkMoniker { get; set; } = string.Empty; + public string SdkDevPath { get; set; } = string.Empty; + + public string GetSdkDevPath () + { + if (string.IsNullOrEmpty (SdkDevPath)) { + Log.LogError (MSBStrings.E7169, /* The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose. */ GetType ().Name, "SdkDevPath"); + return ""; + } + + return SdkDevPath; + } + void VerifyTargetFrameworkMoniker () { if (!string.IsNullOrEmpty (TargetFrameworkMoniker)) return; - Log.LogError ($"The task {GetType ().Name} requires TargetFrameworkMoniker to be set."); + Log.LogError (MSBStrings.E7169, /* The task '{0}' requires the property '{1}' to be set. Please file an issue at https://github.com/dotnet/macios/issues/new/choose. */ GetType ().Name, "TargetFrameworkMoniker"); } public string Product { diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeBuildTask.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeBuildTask.cs index 79a2ffb7b36d..0bf3cb03aae4 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeBuildTask.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeBuildTask.cs @@ -4,9 +4,6 @@ namespace Xamarin.MacDev.Tasks { public abstract class XcodeBuildTask : XamarinTask { - // Task input parameters - public string SdkDevPath { get; set; } = string.Empty; - public string WorkingDirectory { get; set; } = string.Empty; public string OutputPath { get; set; } = string.Empty; @@ -25,7 +22,7 @@ public override bool Execute () } args.AddRange (GenerateCommandLineCommands ()); - ExecuteAsync ("xcrun", args, sdkDevPath: SdkDevPath, workingDirectory: WorkingDirectory).Wait (); + ExecuteAsync ("xcrun", args, sdkDevPath: GetSdkDevPath (), workingDirectory: WorkingDirectory).Wait (); return !Log.HasLoggedErrors; } diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeCompilerToolTask.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeCompilerToolTask.cs index 1be61b08f5fd..69d788e17765 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeCompilerToolTask.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeCompilerToolTask.cs @@ -41,16 +41,6 @@ public abstract class XcodeCompilerToolTask : XamarinTask, IHasProjectDir, IHasR [Required] public string SdkPlatform { get; set; } = string.Empty; - string? sdkDevPath; - public string SdkDevPath { -#if NET - get { return string.IsNullOrEmpty (sdkDevPath) ? "/" : sdkDevPath; } -#else - get { return (sdkDevPath is null || string.IsNullOrEmpty (sdkDevPath)) ? "/" : sdkDevPath; } -#endif - set { sdkDevPath = value; } - } - [Required] public string SdkVersion { get; set; } = string.Empty; @@ -102,7 +92,7 @@ protected abstract string DefaultBinDir { } protected string DeveloperRootBinDir { - get { return Path.Combine (SdkDevPath, "usr", "bin"); } + get { return Path.Combine (GetSdkDevPath (), "usr", "bin"); } } protected abstract string ToolName { get; } @@ -219,7 +209,7 @@ protected int Compile (ITaskItem [] items, string output, ITaskItem manifest) if (Log.HasLoggedErrors) return 1; - var rv = ExecuteAsync (tool, args, sdkDevPath, environment: environment).Result; + var rv = ExecuteAsync (tool, args, SdkDevPath, environment: environment).Result; var exitCode = rv.ExitCode; var messages = rv.Output.StandardOutput; File.WriteAllText (manifest.ItemSpec, messages); diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeTool.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeTool.cs index ee357deeaa0a..3eacbd135257 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeTool.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeTool.cs @@ -27,9 +27,6 @@ public abstract class XcodeToolTaskBase : XamarinTask, IHasProjectDir, IHasResou [Required] public string ResourcePrefix { get; set; } = string.Empty; - [Required] - public string SdkDevPath { get; set; } = string.Empty; - public string ToolExe { get { return toolExe ?? ToolName; } set { toolExe = value; } @@ -51,15 +48,15 @@ protected abstract string DefaultBinDir { } protected string DeveloperRootBinDir { - get { return Path.Combine (SdkDevPath, "usr", "bin"); } + get { return Path.Combine (GetSdkDevPath (), "usr", "bin"); } } protected string DevicePlatformBinDir { - get { return Path.Combine (SdkDevPath, "Platforms", "iPhoneOS.platform", "Developer", "usr", "bin"); } + get { return Path.Combine (GetSdkDevPath (), "Platforms", "iPhoneOS.platform", "Developer", "usr", "bin"); } } protected string SimulatorPlatformBinDir { - get { return Path.Combine (SdkDevPath, "Platforms", "iPhoneSimulator.platform", "Developer", "usr", "bin"); } + get { return Path.Combine (GetSdkDevPath (), "Platforms", "iPhoneSimulator.platform", "Developer", "usr", "bin"); } } protected abstract string ToolName { get; } diff --git a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs index 16a79e70fb84..b5d2723c775d 100644 --- a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs +++ b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs @@ -60,6 +60,7 @@ MergeAppBundles CreateTask (string outputBundle, params string [] inputBundles) var task = CreateTask (); task.InputAppBundles = inputItems.ToArray (); task.OutputAppBundle = outputBundle; + task.SdkDevPath = Configuration.xcode_root; return task; } @@ -98,7 +99,7 @@ public void TestLipoExecutable () var outputBundle = Path.Combine (Cache.CreateTemporaryDirectory (), "Merged.app"); var task = CreateTask (outputBundle, bundles); - Assert.IsTrue (task.Execute (), "Task execution"); + ExecuteTask (task); // The bundle should only contain a single file. Assert.AreEqual (1, Directory.GetFileSystemEntries (outputBundle).Length, "Files in bundle");