Skip to content

Commit ad5a54f

Browse files
Copilotrolfbjarne
andcommitted
Convert paths to absolute in C# tasks instead of MSBuild targets
Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
1 parent dd792ca commit ad5a54f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

dotnet/targets/Microsoft.MaciOS.Sdk.Xcode.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This file contains MSBuild targets that support building Xcode framework project
1313
<UsingTask TaskName="Xamarin.MacDev.Tasks.CreateXcFramework" AssemblyFile="$(_XamarinTaskAssembly)"/>
1414

1515
<PropertyGroup>
16-
<_XcodeProjectDefaultOutputPathRoot>$(IntermediateOutputPath)xcode/</_XcodeProjectDefaultOutputPathRoot>
16+
<_XcodeProjectDefaultOutputPathRoot>$(MSBuildProjectDirectory)/$(IntermediateOutputPath)xcode/</_XcodeProjectDefaultOutputPathRoot>
1717
<_BuildXcodeProjectsStamp>$(_MaciOSStampDirectory)_BuildXcodeProjects.stamp</_BuildXcodeProjectsStamp>
1818
</PropertyGroup>
1919

msbuild/Xamarin.MacDev.Tasks/Tasks/CreateXcArchive.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ protected override IList<string> GenerateCommandLineCommands ()
5757

5858
if (!string.IsNullOrEmpty (OutputPath)) {
5959
args.Add ("-archivePath");
60-
args.Add (OutputPath);
60+
args.Add (Path.GetFullPath (OutputPath));
6161
}
6262

6363
if (!string.IsNullOrEmpty (DerivedDataPath)) {
6464
args.Add ("-derivedDataPath");
65-
args.Add (DerivedDataPath);
65+
args.Add (Path.GetFullPath (DerivedDataPath));
6666
}
6767

6868
if (!string.IsNullOrEmpty (PackageCachePath)) {
6969
args.Add ("-packageCachePath");
70-
args.Add (PackageCachePath);
70+
args.Add (Path.GetFullPath (PackageCachePath));
7171
}
7272

7373
args.AddRange (archive_args);

msbuild/Xamarin.MacDev.Tasks/Tasks/CreateXcFramework.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ protected override IList<string> GenerateCommandLineCommands ()
2121
{
2222
var args = new List<string> ();
2323

24-
if (Directory.Exists (XcArchivePath)) {
25-
foreach (var frameworkArchive in Directory.EnumerateDirectories (XcArchivePath, "*.xcarchive")) {
24+
var fullXcArchivePath = Path.GetFullPath (XcArchivePath);
25+
if (Directory.Exists (fullXcArchivePath)) {
26+
foreach (var frameworkArchive in Directory.EnumerateDirectories (fullXcArchivePath, "*.xcarchive")) {
2627
args.Add ("-archive");
2728
args.Add (frameworkArchive);
2829
args.Add ("-framework");
@@ -32,7 +33,7 @@ protected override IList<string> GenerateCommandLineCommands ()
3233

3334
if (!string.IsNullOrEmpty (OutputPath)) {
3435
args.Add ("-output");
35-
args.Add (OutputPath);
36+
args.Add (Path.GetFullPath (OutputPath));
3637
}
3738

3839
return args;

0 commit comments

Comments
 (0)