Skip to content

Commit 0ac8eef

Browse files
claucambramgallien
authored andcommitted
fix(mac-crafter): Work around broken consecutive shell integration builds
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
1 parent b0f4f1c commit 0ac8eef

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

admin/osx/mac-crafter/Sources/main.swift

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,33 @@ struct Build: ParsableCommand {
208208
)
209209
}
210210

211-
print("Crafting \(appName) Desktop Client...")
212-
213-
let allOptionsString = craftOptions.map({ "--options \"\($0)\"" }).joined(separator: " ")
214-
215211
let clientBuildDir = "\(buildPath)/\(craftTarget)/build/\(craftBlueprintName)"
212+
print("Crafting \(appName) Desktop Client...")
216213
if fullRebuild {
217214
do {
218215
try fm.removeItem(atPath: clientBuildDir)
219216
} catch let error {
220217
print("WARNING! Error removing build directory: \(error)")
221218
}
219+
} else {
220+
// HACK: When building the client we often run into issues with the shell integration
221+
// component -- particularly the FileProviderExt part. So we wipe out the build
222+
// artifacts so this part gets build first. Let's first check if we have an existing
223+
// build in the folder we expect
224+
let shellIntegrationDir = "\(clientBuildDir)/work/build/shell_integration/MacOSX"
225+
if fm.fileExists(atPath: shellIntegrationDir) {
226+
print("Removing existing shell integration build artifacts...")
227+
do {
228+
try fm.removeItem(atPath: shellIntegrationDir)
229+
} catch let error {
230+
print("WARNING! Error removing shell integration build directory: \(error)")
231+
}
232+
}
222233
}
223234

224235
let buildMode = fullRebuild ? "-i" : disableAppBundle ? "compile" : "--compile --install"
225236
let offlineMode = offline ? "--offline" : ""
237+
let allOptionsString = craftOptions.map({ "--options \"\($0)\"" }).joined(separator: " ")
226238
guard shell(
227239
"\(craftCommand) --buildtype \(buildType) \(buildMode) \(offlineMode) \(allOptionsString) \(craftBlueprintName)"
228240
) == 0 else {

0 commit comments

Comments
 (0)