Skip to content

Commit 47c76b3

Browse files
committed
improvements
1 parent 0a8b344 commit 47c76b3

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

dotnet/targets/Xamarin.Shared.Sdk.targets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,6 +2279,7 @@
22792279
Condition="'$(IsMacEnabled)' == 'true'"
22802280
ZipFilePath="%(_CompressedPlugIns.Identity)"
22812281
ExtractionPath="%(_CompressedPlugIns.ExtractionPath)"
2282+
SdkDevPath="$(_SdkDevPath)"
22822283
>
22832284
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
22842285
</Unzip>
@@ -2322,6 +2323,7 @@
23222323
CopyToWindows="true"
23232324
ZipFilePath="%(_CompressedXpcServices.Identity)"
23242325
ExtractionPath="%(_CompressedXpcServices.ExtractionPath)"
2326+
SdkDevPath="$(_SdkDevPath)"
23252327
>
23262328
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
23272329
</Unzip>

msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,4 +1629,8 @@
16291629
<data name="E7163" xml:space="preserve">
16301630
<value>Unable to copy the inputs to this task to the remote build server for unknown reasons. The build log may have more information.</value>
16311631
</data>
1632+
1633+
<data name="E7164" xml:space="preserve">
1634+
<value>The task '{0}' is trying to call an external process, but a path to Xcode has not been provided. Please file an issue at https://github.com/dotnet/macios/issues/new/choose.</value>
1635+
</data>
16321636
</root>

msbuild/Xamarin.MacDev.Tasks/Tasks/XamarinTask.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ static async System.Threading.Tasks.Task<Execution> ExecuteAsync (Task task, str
113113
if (!string.IsNullOrEmpty (sdkDevPath))
114114
launchEnvironment ["DEVELOPER_DIR"] = sdkDevPath;
115115

116-
if (string.IsNullOrEmpty (sdkDevPath))
117-
log.LogError ($"Calling external processes without specifying the Xcode path in the task {(task?.GetType ()?.Name ?? "?")}! StackTrace: {Environment.StackTrace}");
116+
if (string.IsNullOrEmpty (sdkDevPath)) {
117+
log.LogError (MSBStrings.E7164 /* The task '{0}' is trying to call an external process, but a path to Xcode has not been provided. Please file an issue at https://github.com/dotnet/macios/issues/new/choose. */, task.GetType ().Name);
118+
log.LogMessage (MessageImportance.Low, Environment.StackTrace);
119+
}
118120

119121
var currentId = Interlocked.Increment (ref executionCounter);
120122
log.LogMessage (MessageImportance.Normal, MSBStrings.M0001, currentId, fileName, StringUtils.FormatArguments (arguments)); // Started external tool execution #{0}: {1} {2}

tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/CreateBindingResourceTaskTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
using NUnit.Framework;
1111

12+
using Xamarin.Tests;
1213
using Xamarin.Utils;
1314

1415
namespace Xamarin.MacDev.Tasks {
@@ -22,11 +23,12 @@ CreateBindingResourcePackage ExecuteTask (string compress, bool symlinks, out st
2223
task.BindingResourcePath = Path.Combine (tmpdir, "CreateBindingResourceTaskTest");
2324
task.IntermediateOutputPath = Path.Combine (tmpdir, "IntermediateOutputPath");
2425
task.NativeReferences = CreateNativeReferences (tmpdir, symlinks);
26+
task.SdkDevPath = Configuration.xcode_root;
2527

2628
var currentDir = Environment.CurrentDirectory;
2729
try {
2830
Environment.CurrentDirectory = tmpdir;
29-
Assert.IsTrue (task.Execute (), "Execute");
31+
ExecuteTask (task);
3032
} finally {
3133
Environment.CurrentDirectory = currentDir;
3234
}

0 commit comments

Comments
 (0)