From 94a763932d3b1d4183da30d038ae3ccbef5474c5 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Mon, 13 Apr 2015 00:40:40 +0100 Subject: [PATCH] fixes for new OS X Server 4.1 --- BuildaCIServer/SourceControlBlueprint.swift | 6 +++++- Buildasaur/LocalSource.swift | 22 ++++++++++++++++++++- Buildasaur/XcodeLocalSource.swift | 3 ++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/BuildaCIServer/SourceControlBlueprint.swift b/BuildaCIServer/SourceControlBlueprint.swift index d02fe37..429f506 100644 --- a/BuildaCIServer/SourceControlBlueprint.swift +++ b/BuildaCIServer/SourceControlBlueprint.swift @@ -81,7 +81,11 @@ public class SourceControlBlueprint : XcodeServerEntity { let repoId = self.projectWCCIdentifier let remoteUrl = self.projectURL - let workingCopyPath = self.projectName + var workingCopyPath = self.projectName + //ensure a trailing slash + if !workingCopyPath.hasSuffix("/") { + workingCopyPath = workingCopyPath + "/" + } let relativePathToProject = self.projectPath let blueprintName = self.wCCName let branch = self.branch diff --git a/Buildasaur/LocalSource.swift b/Buildasaur/LocalSource.swift index d707541..1b2e719 100644 --- a/Buildasaur/LocalSource.swift +++ b/Buildasaur/LocalSource.swift @@ -60,7 +60,27 @@ public class LocalSource : JSONSerializable { var projectURL: NSURL? { get { if let urlString = self.pullValueForKey("IDESourceControlProjectURL") { - return NSURL(string: urlString) + + var finalUrlString = urlString + let type = self.checkoutType! + if type == .SSH { + if !finalUrlString.hasPrefix("git@") { + finalUrlString = "git@\(finalUrlString)" + } + } + + return NSURL(string: finalUrlString) + } + return nil + } + } + + var checkoutType: AllowedCheckoutTypes? { + get { + if + let meta = self.workspaceMetadata, + let type = LocalSource.parseCheckoutType(meta) { + return type } return nil } diff --git a/Buildasaur/XcodeLocalSource.swift b/Buildasaur/XcodeLocalSource.swift index ce4f744..64f72c9 100644 --- a/Buildasaur/XcodeLocalSource.swift +++ b/Buildasaur/XcodeLocalSource.swift @@ -16,7 +16,8 @@ extension LocalSource { let projectWCCIdentifier = self.projectWCCIdentifier! let wccName = self.projectWCCName! let projectName = self.projectName! - let projectURL = self.projectURL!.absoluteString! + let projectURLOrig = self.projectURL! + let projectURL = projectURLOrig.absoluteString! let projectPath = self.projectPath! let publicSSHKey = self.publicSSHKey let privateSSHKey = self.privateSSHKey