Skip to content
Merged
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
9 changes: 8 additions & 1 deletion common.cake
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,10 @@ void BuildXcodeXcframework (FilePath xcodeProject, PodSpec [] podSpecs, Platform

var target = podSpec.TargetName;
var buildDirectory = workingDirectory.Combine (podSpec.FrameworkName);
var xcframeworkPath = workingDirectory.Combine ($"{podSpec.FrameworkName}.xcframework");
var xcodeBuildArgs = new ProcessArgumentBuilder();
xcodeBuildArgs.Append ("-create-xcframework");
xcodeBuildArgs.Append($"-output {workingDirectory}/{podSpec.FrameworkName}.xcframework");
xcodeBuildArgs.Append($"-output {xcframeworkPath}");

foreach (var platform in platforms) {
Information ($"Building {podSpec.FrameworkName} framework with {platform.Sdk} platform SDK...");
Expand Down Expand Up @@ -624,6 +625,12 @@ void BuildXcodeXcframework (FilePath xcodeProject, PodSpec [] podSpecs, Platform
}

Information ($"Building {podSpec.FrameworkName} xcframework...");

// xcodebuild -create-xcframework fails when its output path already exists,
// so drop the xcframework left behind by any previous run.
if (DirectoryExists (xcframeworkPath))
DeleteDirectory (xcframeworkPath, new DeleteDirectorySettings { Recursive = true, Force = true });

ThrowIfProcessFailed ("xcodebuild -create-xcframework", StartProcess ("xcodebuild", new ProcessSettings { Arguments = xcodeBuildArgs }));
}
}
Expand Down
Loading