Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/AOTCompile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public override bool Execute ()
environment [item.ItemSpec] = item.GetMetadata ("Value");

ForEach (listOfArguments, (arg) => {
ExecuteAsync (AOTCompilerPath, arg.Arguments, environment: environment, sdkDevPath: GetSdkDevPath (), showErrorIfFailure: false /* we show our own error below */)
ExecuteAsync (AOTCompilerPath, arg.Arguments, environment: environment, 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);
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/AlTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public override bool Execute ()
return false;

cancellationTokenSource = new CancellationTokenSource ();
var rv = ExecuteAsync (Log, executable, args, sdkDevPath: GetSdkDevPath (), cancellationToken: cancellationTokenSource.Token).Result;
var rv = ExecuteAsync (executable, args, cancellationToken: cancellationTokenSource.Token).Result;
LogErrorsFromOutput (rv.Output.MergedOutput);
return !Log.HasLoggedErrors;
}
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/BGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public override bool Execute ()
return false;

cancellationTokenSource = new CancellationTokenSource ();
ExecuteAsync (Log, executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();
ExecuteAsync (executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();
return !Log.HasLoggedErrors;
}

Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/Codesign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ void Sign (SignInfo info)
var environment = new Dictionary<string, string?> () {
{ "CODESIGN_ALLOCATE", GetCodesignAllocate (item) },
};
var rv = ExecuteAsync (fileName, arguments, null, environment).Result;
var rv = ExecuteAsync (fileName, arguments, environment).Result;
var exitCode = rv.ExitCode;
var messages = rv.Output.StandardOutput;

Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/CompileNativeCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public override bool Execute ()
arguments.Add ("-c");
arguments.Add (src);

processes [i] = ExecuteAsync ("xcrun", arguments, sdkDevPath: GetSdkDevPath ());
processes [i] = ExecuteAsync ("xcrun", arguments);
}

System.Threading.Tasks.Task.WaitAll (processes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ Task CopySceneKitAssets (string scnassets, string output, string intermediate)
args.Add ($"--resources-folder-path={AppBundleName}");

var executable = GetExecutable (args, ToolName, CopySceneKitAssetsPath);

return ExecuteAsync (executable, args, sdkDevPath: GetSdkDevPath (), environment: environment, showErrorIfFailure: true);
return ExecuteAsync (executable, args, environment: environment, showErrorIfFailure: true);
}

static bool TryGetScnAssetsPath (string file, out string scnassets)
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/CoreMLCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,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, GetSdkDevPath ()).Result;
var rv = ExecuteAsync (executable, args).Result;
var exitCode = rv.ExitCode;
var output = rv.Output.StandardOutput;
File.WriteAllText (log, output);
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/CreateAssetPack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public override bool Execute ()
var args = GenerateCommandLineCommands ();
var executable = GetExecutable (args, "zip", ZipPath);
cancellationTokenSource = new CancellationTokenSource ();
ExecuteAsync (Log, executable, args, workingDirectory: GetWorkingDirectory (), cancellationToken: cancellationTokenSource.Token).Wait ();
ExecuteAsync (executable, args, workingDirectory: GetWorkingDirectory (), cancellationToken: cancellationTokenSource.Token).Wait ();
return !Log.HasLoggedErrors;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public override bool Execute ()
var args = GenerateCommandLineCommands ();
var executable = GetExecutable (args, "productbuild", ProductBuildPath);
cancellationTokenSource = new CancellationTokenSource ();
ExecuteAsync (Log, executable, args, workingDirectory: OutputDirectory, cancellationToken: cancellationTokenSource.Token).Wait ();
ExecuteAsync (executable, args, workingDirectory: OutputDirectory, cancellationToken: cancellationTokenSource.Token).Wait ();
return !Log.HasLoggedErrors;
}

Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/DSymUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void ExecuteDSymUtil (ITaskItem item, List<ITaskItem> contentFiles)
args.Add (dSymDir);

args.Add (Path.GetFullPath (item.ItemSpec));
ExecuteAsync ("xcrun", args, sdkDevPath: GetSdkDevPath ()).Wait ();
ExecuteAsync ("xcrun", args).Wait ();

var contentsDir = Path.Combine (dSymDir, "Contents");
if (Directory.Exists (contentsDir))
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/Ditto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ bool ExecuteImpl ()
}

cancellationTokenSource = new CancellationTokenSource ();
ExecuteAsync (Log, executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();
ExecuteAsync (executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();

// Create a list of all the files we've copied
if (CreateOutputFiles) {
Expand Down
4 changes: 2 additions & 2 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public IPhoneDeviceType DeviceType {
var tmpfile = Path.GetTempFileName ();
try {
var output = new StringBuilder ();
var result = ExecuteAsync (MlaunchPath, new string [] { "--listsim", tmpfile }, GetSdkDevPath ()).Result;
var result = ExecuteAsync (MlaunchPath, new string [] { "--listsim", tmpfile }).Result;
if (result.ExitCode != 0)
return string.Empty;
simulator_list = File.ReadAllText (tmpfile);
Expand All @@ -127,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" }, GetSdkDevPath ()).Result;
var result = ExecuteAsync (MlaunchPath, new string [] { $"--listdev:{tmpfile}", "--output-format:xml", "--use-amdevice:false" }).Result;
if (result.ExitCode != 0)
return string.Empty;
device_list = File.ReadAllText (tmpfile);
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/InstallNameTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override bool Execute ()
arguments.Add (input.GetMetadata ("DynamicLibraryId"));
arguments.Add (temporaryTarget);

processes [i] = ExecuteAsync ("xcrun", arguments, sdkDevPath: GetSdkDevPath ()).ContinueWith ((v) => {
processes [i] = ExecuteAsync ("xcrun", arguments).ContinueWith ((v) => {
if (v.IsFaulted)
throw v.Exception;
if (v.Status == TaskStatus.RanToCompletion) {
Expand Down
4 changes: 2 additions & 2 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/LinkNativeCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ bool ExecuteUnsafe ()
arguments.Add (flag.ItemSpec);
}

var rv = ExecuteAsync ("xcrun", arguments, sdkDevPath: GetSdkDevPath (), showErrorIfFailure: false).Result;
var rv = ExecuteAsync ("xcrun", arguments, showErrorIfFailure: false).Result;
if (rv.ExitCode != 0) {
var stderr = rv.Output.MergedOutput;
#if NET
Expand Down Expand Up @@ -281,7 +281,7 @@ string ConvertEntitlementsToDerEntitlements (string entitlements)
"-o", derEntitlements,
"--raw",
};
ExecuteAsync ("xcrun", arguments, sdkDevPath: GetSdkDevPath ()).Wait ();
ExecuteAsync ("xcrun", arguments).Wait ();
return derEntitlements;
}

Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/MergeAppBundles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ void MergeMachOFiles (string output, IList<Entry> input)
arguments.Add ("-output");
arguments.Add (output);
arguments.AddRange (sourceFiles);
ExecuteAsync ("lipo", arguments, sdkDevPath: GetSdkDevPath ()).Wait ();
ExecuteAsync ("lipo", arguments).Wait ();
}

FileType GetFileType (string path)
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/Metal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public override bool Execute ()
args.Add (SourceFile!.ItemSpec);

cancellationTokenSource = new CancellationTokenSource ();
ExecuteAsync (Log, executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();
ExecuteAsync (executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();

return !Log.HasLoggedErrors;
}
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/MetalLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public override bool Execute ()
var executable = GetExecutable (args, "metallib", MetalLibPath);

cancellationTokenSource = new CancellationTokenSource ();
ExecuteAsync (Log, executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();
ExecuteAsync (executable, args, environment: env, cancellationToken: cancellationTokenSource.Token).Wait ();

return !Log.HasLoggedErrors;
}
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/OptimizeImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,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: GetSdkDevPath (), showErrorIfFailure: false /* we show our own error below */, cancellationToken: cancellationTokenSource.Token)
ExecuteAsync (executable, args, showErrorIfFailure: false /* we show our own error below */, cancellationToken: cancellationTokenSource.Token)
.ContinueWith ((v) => {
Execution execution = v.Result;
if (execution.ExitCode != 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override bool Execute ()
var args = GenerateCommandLineCommands ();
var executable = GetExecutable (args, "plutil", PlutilPath);
cancellationTokenSource = new CancellationTokenSource ();
ExecuteAsync (Log, executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();
ExecuteAsync (executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();
return !Log.HasLoggedErrors;
}

Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/ScnTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public override bool Execute ()
}

ForEach (listOfArguments, (arg) => {
ExecuteAsync ("xcrun", arg.Arguments, sdkDevPath: GetSdkDevPath ()).Wait ();
ExecuteAsync ("xcrun", arg.Arguments).Wait ();
});

BundleResources = bundleResources.ToArray ();
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/SpotlightIndexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public override bool Execute ()
};
var executable = GetExecutable (args, "mdimport", MdimportPath);
cancellationTokenSource = new CancellationTokenSource ();
ExecuteAsync (Log, executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();
ExecuteAsync (executable, args, cancellationToken: cancellationTokenSource.Token).Wait ();
return !Log.HasLoggedErrors;
}

Expand Down
6 changes: 3 additions & 3 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/XamarinTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ protected string GetSdkPlatform (bool isSimulator)
return PlatformFrameworkHelper.GetSdkPlatform (Platform, isSimulator);
}

internal protected System.Threading.Tasks.Task<Execution> ExecuteAsync (string fileName, IList<string> arguments, string? sdkDevPath = null, Dictionary<string, string?>? environment = null, bool showErrorIfFailure = true, string? workingDirectory = null, CancellationToken? cancellationToken = null)
internal protected System.Threading.Tasks.Task<Execution> ExecuteAsync (string fileName, IList<string> arguments, Dictionary<string, string?>? environment = null, bool showErrorIfFailure = true, string? workingDirectory = null, CancellationToken? cancellationToken = null)
{
return ExecuteAsync (Log, fileName, arguments, sdkDevPath, environment, showErrorIfFailure, workingDirectory, cancellationToken);
return ExecuteAsync (Log, fileName, arguments, SdkDevPath, environment, showErrorIfFailure, workingDirectory, cancellationToken);
}

static int executionCounter;
internal protected static async System.Threading.Tasks.Task<Execution> ExecuteAsync (TaskLoggingHelper log, string fileName, IList<string> arguments, string? sdkDevPath = null, Dictionary<string, string?>? environment = null, bool showErrorIfFailure = true, string? workingDirectory = null, CancellationToken? cancellationToken = null)
static async System.Threading.Tasks.Task<Execution> ExecuteAsync (TaskLoggingHelper log, string fileName, IList<string> arguments, string? sdkDevPath = null, Dictionary<string, string?>? environment = null, bool showErrorIfFailure = true, string? workingDirectory = null, CancellationToken? cancellationToken = null)
{
// Create a new dictionary if we're given one, to make sure we don't change the caller's dictionary.
var launchEnvironment = environment is null ? new Dictionary<string, string?> () : new Dictionary<string, string?> (environment);
Expand Down
2 changes: 1 addition & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeBuildTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public override bool Execute ()
}
args.AddRange (GenerateCommandLineCommands ());

ExecuteAsync ("xcrun", args, sdkDevPath: GetSdkDevPath (), workingDirectory: WorkingDirectory).Wait ();
ExecuteAsync ("xcrun", args, workingDirectory: WorkingDirectory).Wait ();
return !Log.HasLoggedErrors;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ protected int Compile (ITaskItem [] items, string output, ITaskItem manifest)
var environment = new Dictionary<string, string?> ();
var args = new List<string> ();

if (!string.IsNullOrEmpty (SdkDevPath))
environment.Add ("DEVELOPER_DIR", SdkDevPath);

// workaround for ibtool[d] bug / asserts if Intel version is loaded
string tool;
if (IsTranslated ()) {
Expand Down Expand Up @@ -209,7 +206,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, environment: environment).Result;
var exitCode = rv.ExitCode;
var messages = rv.Output.StandardOutput;
File.WriteAllText (manifest.ItemSpec, messages);
Expand Down
Loading