fastlane 2.70.0.beta.20171214010003 → 2.70.0.beta.20171215010003
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fastlane/lib/fastlane/actions/docs/pilot.md +10 -10
- data/fastlane/lib/fastlane/version.rb +1 -1
- data/fastlane/swift/Appfile.swift +17 -0
- data/fastlane/swift/ArgumentProcessor.swift +72 -0
- data/fastlane/swift/Deliverfile.swift +14 -0
- data/fastlane/swift/DeliverfileProtocol.swift +118 -0
- data/fastlane/swift/Fastfile.swift +12 -0
- data/fastlane/swift/Fastlane.swift +3739 -0
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +409 -0
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +103 -0
- data/fastlane/swift/Gymfile.swift +14 -0
- data/fastlane/swift/GymfileProtocol.swift +86 -0
- data/fastlane/swift/LaneFileProtocol.swift +103 -0
- data/fastlane/swift/Matchfile.swift +14 -0
- data/fastlane/swift/MatchfileProtocol.swift +54 -0
- data/fastlane/swift/Precheckfile.swift +14 -0
- data/fastlane/swift/PrecheckfileProtocol.swift +24 -0
- data/fastlane/swift/RubyCommand.swift +138 -0
- data/fastlane/swift/Runner.swift +190 -0
- data/fastlane/swift/RunnerArgument.swift +18 -0
- data/fastlane/swift/Scanfile.swift +14 -0
- data/fastlane/swift/ScanfileProtocol.swift +88 -0
- data/fastlane/swift/Screengrabfile.swift +14 -0
- data/fastlane/swift/ScreengrabfileProtocol.swift +48 -0
- data/fastlane/swift/Snapshotfile.swift +14 -0
- data/fastlane/swift/SnapshotfileProtocol.swift +70 -0
- data/fastlane/swift/SocketClient.swift +283 -0
- data/fastlane/swift/SocketClientDelegateProtocol.swift +19 -0
- data/fastlane/swift/SocketResponse.swift +74 -0
- data/fastlane/swift/main.swift +43 -0
- data/match/lib/match/encrypt.rb +12 -0
- metadata +31 -2
@@ -0,0 +1,103 @@
|
|
1
|
+
//
|
2
|
+
// LaneFileProtocol.swift
|
3
|
+
// FastlaneSwiftRunner
|
4
|
+
//
|
5
|
+
// Created by Joshua Liebowitz on 8/4/17.
|
6
|
+
// Copyright © 2017 Joshua Liebowitz. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
import Foundation
|
10
|
+
|
11
|
+
public protocol LaneFileProtocol: class {
|
12
|
+
var fastlaneVersion: String { get }
|
13
|
+
static func runLane(named: String)
|
14
|
+
|
15
|
+
func recordLaneDescriptions()
|
16
|
+
func beforeAll()
|
17
|
+
func afterAll(currentLane: String)
|
18
|
+
func onError(currentLane: String, errorInfo: String)
|
19
|
+
}
|
20
|
+
|
21
|
+
public extension LaneFileProtocol {
|
22
|
+
var fastlaneVersion: String { return "" } // default "" because that means any is fine
|
23
|
+
func beforeAll() { } // no op by default
|
24
|
+
func afterAll(currentLane: String) { } // no op by default
|
25
|
+
func onError(currentLane: String, errorInfo: String) {} // no op by default
|
26
|
+
func recordLaneDescriptions() { } // no op by default
|
27
|
+
}
|
28
|
+
|
29
|
+
@objcMembers
|
30
|
+
public class LaneFile: NSObject, LaneFileProtocol {
|
31
|
+
private(set) static var fastfileInstance: Fastfile?
|
32
|
+
|
33
|
+
// Called before any lane is executed.
|
34
|
+
private func setupAllTheThings() {
|
35
|
+
// Step 1, add lange descriptions
|
36
|
+
(self as! Fastfile).recordLaneDescriptions()
|
37
|
+
|
38
|
+
// Step 2, run beforeAll() function
|
39
|
+
LaneFile.fastfileInstance!.beforeAll()
|
40
|
+
}
|
41
|
+
|
42
|
+
public static var lanes: [String : String] {
|
43
|
+
var laneToMethodName: [String : String] = [:]
|
44
|
+
var methodCount: UInt32 = 0
|
45
|
+
let methodList = class_copyMethodList(self, &methodCount)
|
46
|
+
for i in 0..<Int(methodCount) {
|
47
|
+
let selName = sel_getName(method_getName(methodList![i]))
|
48
|
+
let name = String(cString: selName)
|
49
|
+
let lowercasedName = name.lowercased()
|
50
|
+
guard lowercasedName.hasSuffix("lane") else {
|
51
|
+
continue
|
52
|
+
}
|
53
|
+
|
54
|
+
laneToMethodName[lowercasedName] = name
|
55
|
+
let lowercasedNameNoLane = String(lowercasedName.prefix(lowercasedName.count - 4))
|
56
|
+
laneToMethodName[lowercasedNameNoLane] = name
|
57
|
+
}
|
58
|
+
return laneToMethodName
|
59
|
+
}
|
60
|
+
|
61
|
+
public static func loadFastfile() {
|
62
|
+
if self.fastfileInstance == nil {
|
63
|
+
let fastfileType: AnyObject.Type = NSClassFromString(self.className())!
|
64
|
+
let fastfileAsNSObjectType: NSObject.Type = fastfileType as! NSObject.Type
|
65
|
+
let currentFastfileInstance: Fastfile? = fastfileAsNSObjectType.init() as? Fastfile
|
66
|
+
self.fastfileInstance = currentFastfileInstance
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
public static func runLane(named: String) {
|
71
|
+
log(message: "Running lane: \(named)")
|
72
|
+
self.loadFastfile()
|
73
|
+
|
74
|
+
guard let fastfileInstance: Fastfile = self.fastfileInstance else {
|
75
|
+
let message = "Unable to instantiate class named: \(self.className())"
|
76
|
+
log(message: message)
|
77
|
+
fatalError(message)
|
78
|
+
}
|
79
|
+
|
80
|
+
// call all methods that need to be called before we start calling lanes
|
81
|
+
fastfileInstance.setupAllTheThings()
|
82
|
+
|
83
|
+
let currentLanes = self.lanes
|
84
|
+
let lowerCasedLaneRequested = named.lowercased()
|
85
|
+
|
86
|
+
guard let laneMethod = currentLanes[lowerCasedLaneRequested] else {
|
87
|
+
let message = "unable to find lane named: \(named)"
|
88
|
+
log(message: message)
|
89
|
+
fatalError(message)
|
90
|
+
}
|
91
|
+
|
92
|
+
// We need to catch all possible errors here and display a nice message
|
93
|
+
_ = fastfileInstance.perform(NSSelectorFromString(laneMethod))
|
94
|
+
|
95
|
+
// only call on success
|
96
|
+
fastfileInstance.afterAll(currentLane: named)
|
97
|
+
log(message: "Done running lane: \(named) 🚀")
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
// Please don't remove the lines below
|
102
|
+
// They are used to detect outdated files
|
103
|
+
// FastlaneRunnerAPIVersion [0.9.1]
|
@@ -0,0 +1,14 @@
|
|
1
|
+
// This class is automatically included in FastlaneRunner during build
|
2
|
+
|
3
|
+
// This autogenerated file will be overwritten or replaced during build time, or when you initialize `match`
|
4
|
+
class Matchfile: MatchfileProtocol {
|
5
|
+
// If you want to enable `match`, run `fastlane match init`
|
6
|
+
// After, this file will be replaced with a custom implementation that contains values you supplied
|
7
|
+
// during the `init` process, and you won't see this message
|
8
|
+
}
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
// Generated with fastlane 2.69.2
|
@@ -0,0 +1,54 @@
|
|
1
|
+
protocol MatchfileProtocol: class {
|
2
|
+
var gitUrl: String { get }
|
3
|
+
var gitBranch: String { get }
|
4
|
+
var type: String { get }
|
5
|
+
var appIdentifier: [String] { get }
|
6
|
+
var username: String { get }
|
7
|
+
var keychainName: String { get }
|
8
|
+
var keychainPassword: String? { get }
|
9
|
+
var readonly: Bool { get }
|
10
|
+
var teamId: String? { get }
|
11
|
+
var gitFullName: String? { get }
|
12
|
+
var gitUserEmail: String? { get }
|
13
|
+
var teamName: String? { get }
|
14
|
+
var verbose: Bool { get }
|
15
|
+
var force: Bool { get }
|
16
|
+
var skipConfirmation: Bool { get }
|
17
|
+
var shallowClone: Bool { get }
|
18
|
+
var cloneBranchDirectly: Bool { get }
|
19
|
+
var workspace: String? { get }
|
20
|
+
var forceForNewDevices: Bool { get }
|
21
|
+
var skipDocs: Bool { get }
|
22
|
+
var platform: String { get }
|
23
|
+
var templateName: String? { get }
|
24
|
+
}
|
25
|
+
|
26
|
+
extension MatchfileProtocol {
|
27
|
+
var gitUrl: String { return "" }
|
28
|
+
var gitBranch: String { return "master" }
|
29
|
+
var type: String { return "development" }
|
30
|
+
var appIdentifier: [String] { return [] }
|
31
|
+
var username: String { return "" }
|
32
|
+
var keychainName: String { return "login.keychain" }
|
33
|
+
var keychainPassword: String? { return nil }
|
34
|
+
var readonly: Bool { return false }
|
35
|
+
var teamId: String? { return nil }
|
36
|
+
var gitFullName: String? { return nil }
|
37
|
+
var gitUserEmail: String? { return nil }
|
38
|
+
var teamName: String? { return nil }
|
39
|
+
var verbose: Bool { return false }
|
40
|
+
var force: Bool { return false }
|
41
|
+
var skipConfirmation: Bool { return false }
|
42
|
+
var shallowClone: Bool { return false }
|
43
|
+
var cloneBranchDirectly: Bool { return false }
|
44
|
+
var workspace: String? { return nil }
|
45
|
+
var forceForNewDevices: Bool { return false }
|
46
|
+
var skipDocs: Bool { return false }
|
47
|
+
var platform: String { return "ios" }
|
48
|
+
var templateName: String? { return nil }
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
// Please don't remove the lines below
|
53
|
+
// They are used to detect outdated files
|
54
|
+
// FastlaneRunnerAPIVersion [0.9.1]
|
@@ -0,0 +1,14 @@
|
|
1
|
+
// This class is automatically included in FastlaneRunner during build
|
2
|
+
|
3
|
+
// This autogenerated file will be overwritten or replaced during build time, or when you initialize `precheck`
|
4
|
+
class Precheckfile: PrecheckfileProtocol {
|
5
|
+
// If you want to enable `precheck`, run `fastlane precheck init`
|
6
|
+
// After, this file will be replaced with a custom implementation that contains values you supplied
|
7
|
+
// during the `init` process, and you won't see this message
|
8
|
+
}
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
// Generated with fastlane 2.69.2
|
@@ -0,0 +1,24 @@
|
|
1
|
+
protocol PrecheckfileProtocol: class {
|
2
|
+
var appIdentifier: String { get }
|
3
|
+
var username: String { get }
|
4
|
+
var teamId: String? { get }
|
5
|
+
var teamName: String? { get }
|
6
|
+
var defaultRuleLevel: String { get }
|
7
|
+
var includeInAppPurchases: Bool { get }
|
8
|
+
var freeStuffInIap: String? { get }
|
9
|
+
}
|
10
|
+
|
11
|
+
extension PrecheckfileProtocol {
|
12
|
+
var appIdentifier: String { return "" }
|
13
|
+
var username: String { return "" }
|
14
|
+
var teamId: String? { return nil }
|
15
|
+
var teamName: String? { return nil }
|
16
|
+
var defaultRuleLevel: String { return "error" }
|
17
|
+
var includeInAppPurchases: Bool { return true }
|
18
|
+
var freeStuffInIap: String? { return nil }
|
19
|
+
}
|
20
|
+
|
21
|
+
|
22
|
+
// Please don't remove the lines below
|
23
|
+
// They are used to detect outdated files
|
24
|
+
// FastlaneRunnerAPIVersion [0.9.1]
|
@@ -0,0 +1,138 @@
|
|
1
|
+
//
|
2
|
+
// RubyCommand.swift
|
3
|
+
// FastlaneSwiftRunner
|
4
|
+
//
|
5
|
+
// Created by Joshua Liebowitz on 8/4/17.
|
6
|
+
// Copyright © 2017 Joshua Liebowitz. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
import Foundation
|
10
|
+
|
11
|
+
protocol RubyCommandable {
|
12
|
+
var json: String { get }
|
13
|
+
}
|
14
|
+
|
15
|
+
struct RubyCommand: RubyCommandable {
|
16
|
+
struct Argument {
|
17
|
+
enum ArgType {
|
18
|
+
case stringClosure
|
19
|
+
|
20
|
+
var typeString: String {
|
21
|
+
switch self {
|
22
|
+
case .stringClosure:
|
23
|
+
return "string_closure" // this should match when is in ruby's SocketServerActionCommandExecutor
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
let name: String
|
29
|
+
let value: Any?
|
30
|
+
let type: ArgType?
|
31
|
+
|
32
|
+
init(name: String, value: Any?, type: ArgType? = nil) {
|
33
|
+
self.name = name
|
34
|
+
self.value = value
|
35
|
+
self.type = type
|
36
|
+
}
|
37
|
+
|
38
|
+
var hasValue: Bool {
|
39
|
+
return nil != self.value
|
40
|
+
}
|
41
|
+
|
42
|
+
var json: String {
|
43
|
+
get {
|
44
|
+
|
45
|
+
if let someValue = value {
|
46
|
+
let typeJson: String
|
47
|
+
if let type = type {
|
48
|
+
typeJson = ", \"value_type\" : \"\(type.typeString)\""
|
49
|
+
}else {
|
50
|
+
typeJson = ""
|
51
|
+
}
|
52
|
+
|
53
|
+
if type == .stringClosure {
|
54
|
+
return "{\"name\" : \"\(name)\", \"value\" : \"ignored_for_closure\"\(typeJson)}"
|
55
|
+
} else if let array = someValue as? [String] {
|
56
|
+
return "{\"name\" : \"\(name)\", \"value\" : \"\(array.joined(separator: ","))\"\(typeJson)}"
|
57
|
+
} else if let hash = someValue as? [String : Any] {
|
58
|
+
let jsonData = try! JSONSerialization.data(withJSONObject: hash, options: [])
|
59
|
+
let jsonString = String(data: jsonData, encoding: .utf8)!
|
60
|
+
return "{\"name\" : \"\(name)\", \"value\" : \(jsonString)\(typeJson)}"
|
61
|
+
} else {
|
62
|
+
let dictionary = [
|
63
|
+
"name": name,
|
64
|
+
"value": someValue
|
65
|
+
]
|
66
|
+
let jsonData = try! JSONSerialization.data(withJSONObject: dictionary, options: [])
|
67
|
+
let jsonString = String(data: jsonData, encoding: .utf8)!
|
68
|
+
return jsonString
|
69
|
+
}
|
70
|
+
} else {
|
71
|
+
// Just exclude this arg if it doesn't have a value
|
72
|
+
return ""
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
let commandID: String
|
79
|
+
let methodName: String
|
80
|
+
let className: String?
|
81
|
+
let args: [Argument]
|
82
|
+
|
83
|
+
func performCallback(callbackArg: String) {
|
84
|
+
// WARNING: This will perform the first callback it receives
|
85
|
+
let callbacks = self.args.filter { ($0.type != nil) && $0.type == .stringClosure }
|
86
|
+
guard let callback = callbacks.first else {
|
87
|
+
verbose(message: "received call to performCallback with \(callbackArg), but no callback available to perform")
|
88
|
+
return
|
89
|
+
}
|
90
|
+
|
91
|
+
guard let callbackArgValue = callback.value else {
|
92
|
+
verbose(message: "received call to performCallback with \(callbackArg), but callback is nil")
|
93
|
+
return
|
94
|
+
}
|
95
|
+
|
96
|
+
guard let callbackClosure = callbackArgValue as? ((String) -> Void) else {
|
97
|
+
verbose(message: "received call to performCallback with \(callbackArg), but callback type is unknown \(callbackArgValue.self)")
|
98
|
+
return
|
99
|
+
}
|
100
|
+
|
101
|
+
print("Performing callback with: \(callbackArg)")
|
102
|
+
callbackClosure(callbackArg)
|
103
|
+
}
|
104
|
+
|
105
|
+
var json: String {
|
106
|
+
let argsArrayJson = self.args
|
107
|
+
.map { $0.json }
|
108
|
+
.filter { $0 != "" }
|
109
|
+
|
110
|
+
let argsJson: String?
|
111
|
+
if argsArrayJson.count > 0 {
|
112
|
+
argsJson = "\"args\" : [\(argsArrayJson.joined(separator: ","))]"
|
113
|
+
} else {
|
114
|
+
argsJson = nil
|
115
|
+
}
|
116
|
+
|
117
|
+
let commandIDJson = "\"commandID\" : \"\(commandID)\""
|
118
|
+
let methodNameJson = "\"methodName\" : \"\(methodName)\""
|
119
|
+
|
120
|
+
var jsonParts = [commandIDJson, methodNameJson]
|
121
|
+
if let argsJson = argsJson {
|
122
|
+
jsonParts.append(argsJson)
|
123
|
+
}
|
124
|
+
|
125
|
+
if let className = className {
|
126
|
+
let classNameJson = "\"className\" : \"\(className)\""
|
127
|
+
jsonParts.append(classNameJson)
|
128
|
+
}
|
129
|
+
|
130
|
+
let commandJsonString = "{\(jsonParts.joined(separator: ","))}"
|
131
|
+
|
132
|
+
return commandJsonString
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
// Please don't remove the lines below
|
137
|
+
// They are used to detect outdated files
|
138
|
+
// FastlaneRunnerAPIVersion [0.9.1]
|
@@ -0,0 +1,190 @@
|
|
1
|
+
//
|
2
|
+
// Runner.swift
|
3
|
+
// FastlaneSwiftRunner
|
4
|
+
//
|
5
|
+
// Created by Joshua Liebowitz on 8/26/17.
|
6
|
+
// Copyright © 2017 Joshua Liebowitz. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
import Foundation
|
10
|
+
|
11
|
+
let logger: Logger = {
|
12
|
+
return Logger()
|
13
|
+
}()
|
14
|
+
|
15
|
+
let runner: Runner = {
|
16
|
+
return Runner()
|
17
|
+
}()
|
18
|
+
|
19
|
+
func desc(_ laneDescription: String) {
|
20
|
+
// no-op, this is handled in fastlane/lane_list.rb
|
21
|
+
}
|
22
|
+
|
23
|
+
class Runner {
|
24
|
+
fileprivate var thread: Thread!
|
25
|
+
fileprivate var socketClient: SocketClient!
|
26
|
+
fileprivate let dispatchGroup: DispatchGroup = DispatchGroup()
|
27
|
+
fileprivate var returnValue: String? // lol, so safe
|
28
|
+
fileprivate var currentlyExecutingCommand: RubyCommandable? = nil
|
29
|
+
fileprivate var shouldLeaveDispatchGroupDuringDisconnect = false
|
30
|
+
|
31
|
+
func executeCommand(_ command: RubyCommandable) -> String {
|
32
|
+
self.dispatchGroup.enter()
|
33
|
+
currentlyExecutingCommand = command
|
34
|
+
socketClient.send(rubyCommand: command)
|
35
|
+
|
36
|
+
let secondsToWait = DispatchTimeInterval.seconds(SocketClient.defaultCommandTimeoutSeconds)
|
37
|
+
let connectTimeout = DispatchTime.now() + secondsToWait
|
38
|
+
let timeoutResult = self.dispatchGroup.wait(timeout: connectTimeout)
|
39
|
+
let failureMessage = "command didn't execute in: \(SocketClient.defaultCommandTimeoutSeconds) seconds"
|
40
|
+
let success = testDispatchTimeoutResult(timeoutResult, failureMessage: failureMessage, timeToWait: secondsToWait)
|
41
|
+
guard success else {
|
42
|
+
log(message: "command timeout")
|
43
|
+
fatalError()
|
44
|
+
}
|
45
|
+
|
46
|
+
if let returnValue = self.returnValue {
|
47
|
+
return returnValue
|
48
|
+
} else {
|
49
|
+
return ""
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
// Handle threading stuff
|
55
|
+
extension Runner {
|
56
|
+
func startSocketThread() {
|
57
|
+
let secondsToWait = DispatchTimeInterval.seconds(SocketClient.connectTimeoutSeconds)
|
58
|
+
|
59
|
+
self.dispatchGroup.enter()
|
60
|
+
|
61
|
+
self.socketClient = SocketClient(commandTimeoutSeconds:timeout, socketDelegate: self)
|
62
|
+
self.thread = Thread(target: self, selector: #selector(startSocketComs), object: nil)
|
63
|
+
self.thread!.name = "socket thread"
|
64
|
+
self.thread!.start()
|
65
|
+
|
66
|
+
let connectTimeout = DispatchTime.now() + secondsToWait
|
67
|
+
let timeoutResult = self.dispatchGroup.wait(timeout: connectTimeout)
|
68
|
+
|
69
|
+
let failureMessage = "couldn't start socket thread in: \(SocketClient.connectTimeoutSeconds) seconds"
|
70
|
+
let success = testDispatchTimeoutResult(timeoutResult, failureMessage: failureMessage, timeToWait: secondsToWait)
|
71
|
+
guard success else {
|
72
|
+
log(message: "socket thread timeout")
|
73
|
+
fatalError()
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
func disconnectFromFastlaneProcess() {
|
78
|
+
self.shouldLeaveDispatchGroupDuringDisconnect = true
|
79
|
+
self.dispatchGroup.enter()
|
80
|
+
socketClient.sendComplete()
|
81
|
+
|
82
|
+
let connectTimeout = DispatchTime.now() + 2
|
83
|
+
_ = self.dispatchGroup.wait(timeout: connectTimeout)
|
84
|
+
}
|
85
|
+
|
86
|
+
@objc func startSocketComs() {
|
87
|
+
guard let socketClient = self.socketClient else {
|
88
|
+
return
|
89
|
+
}
|
90
|
+
|
91
|
+
socketClient.connectAndOpenStreams()
|
92
|
+
self.dispatchGroup.leave()
|
93
|
+
}
|
94
|
+
|
95
|
+
fileprivate func testDispatchTimeoutResult(_ timeoutResult: DispatchTimeoutResult, failureMessage: String, timeToWait: DispatchTimeInterval) -> Bool {
|
96
|
+
switch timeoutResult {
|
97
|
+
case .success:
|
98
|
+
return true
|
99
|
+
case .timedOut:
|
100
|
+
log(message: "timeout: \(failureMessage)")
|
101
|
+
return false
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
extension Runner : SocketClientDelegateProtocol {
|
107
|
+
func commandExecuted(serverResponse: SocketClientResponse) {
|
108
|
+
switch serverResponse {
|
109
|
+
case .success(let returnedObject, let closureArgumentValue):
|
110
|
+
verbose(message: "command executed")
|
111
|
+
self.returnValue = returnedObject
|
112
|
+
if let command = self.currentlyExecutingCommand as? RubyCommand {
|
113
|
+
if let closureArgumentValue = closureArgumentValue {
|
114
|
+
command.performCallback(callbackArg: closureArgumentValue)
|
115
|
+
}
|
116
|
+
}
|
117
|
+
self.dispatchGroup.leave()
|
118
|
+
|
119
|
+
case .alreadyClosedSockets, .connectionFailure, .malformedRequest, .malformedResponse, .serverError:
|
120
|
+
log(message: "error encountered while executing command:\n\(serverResponse)")
|
121
|
+
self.dispatchGroup.leave()
|
122
|
+
|
123
|
+
case .commandTimeout(let timeout):
|
124
|
+
log(message: "Runner timed out after \(timeout) second(s)")
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
func connectionsOpened() {
|
129
|
+
DispatchQueue.main.async {
|
130
|
+
verbose(message: "connected!")
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
func connectionsClosed() {
|
135
|
+
DispatchQueue.main.async {
|
136
|
+
self.thread?.cancel()
|
137
|
+
self.thread = nil
|
138
|
+
self.socketClient = nil
|
139
|
+
verbose(message: "connection closed!")
|
140
|
+
if self.shouldLeaveDispatchGroupDuringDisconnect {
|
141
|
+
self.dispatchGroup.leave()
|
142
|
+
}
|
143
|
+
exit(0)
|
144
|
+
}
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
class Logger {
|
149
|
+
enum LogMode {
|
150
|
+
init(logMode: String) {
|
151
|
+
switch logMode {
|
152
|
+
case "normal", "default":
|
153
|
+
self = .normal
|
154
|
+
case "verbose":
|
155
|
+
self = .verbose
|
156
|
+
default:
|
157
|
+
logger.log(message: "unrecognized log mode: \(logMode), defaulting to 'normal'")
|
158
|
+
self = .normal
|
159
|
+
}
|
160
|
+
}
|
161
|
+
case normal
|
162
|
+
case verbose
|
163
|
+
}
|
164
|
+
|
165
|
+
public static var logMode: LogMode = .normal
|
166
|
+
|
167
|
+
func log(message: String) {
|
168
|
+
let timestamp = NSDate().timeIntervalSince1970
|
169
|
+
print("[\(timestamp)]: \(message)")
|
170
|
+
}
|
171
|
+
|
172
|
+
func verbose(message: String) {
|
173
|
+
if Logger.logMode == .verbose {
|
174
|
+
let timestamp = NSDate().timeIntervalSince1970
|
175
|
+
print("[\(timestamp)]: \(message)")
|
176
|
+
}
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
func log(message: String) {
|
181
|
+
logger.log(message: message)
|
182
|
+
}
|
183
|
+
|
184
|
+
func verbose(message: String) {
|
185
|
+
logger.verbose(message: message)
|
186
|
+
}
|
187
|
+
|
188
|
+
// Please don't remove the lines below
|
189
|
+
// They are used to detect outdated files
|
190
|
+
// FastlaneRunnerAPIVersion [0.9.1]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
//
|
2
|
+
// RunnerArgument.swift
|
3
|
+
// FastlaneSwiftRunner
|
4
|
+
//
|
5
|
+
// Created by Joshua Liebowitz on 9/1/17.
|
6
|
+
// Copyright © 2017 Joshua Liebowitz. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
import Foundation
|
10
|
+
|
11
|
+
struct RunnerArgument {
|
12
|
+
let name: String
|
13
|
+
let value: String
|
14
|
+
}
|
15
|
+
|
16
|
+
// Please don't remove the lines below
|
17
|
+
// They are used to detect outdated files
|
18
|
+
// FastlaneRunnerAPIVersion [0.9.1]
|
@@ -0,0 +1,14 @@
|
|
1
|
+
// This class is automatically included in FastlaneRunner during build
|
2
|
+
|
3
|
+
// This autogenerated file will be overwritten or replaced during build time, or when you initialize `scan`
|
4
|
+
class Scanfile: ScanfileProtocol {
|
5
|
+
// If you want to enable `scan`, run `fastlane scan init`
|
6
|
+
// After, this file will be replaced with a custom implementation that contains values you supplied
|
7
|
+
// during the `init` process, and you won't see this message
|
8
|
+
}
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
// Generated with fastlane 2.69.2
|
@@ -0,0 +1,88 @@
|
|
1
|
+
protocol ScanfileProtocol: class {
|
2
|
+
var workspace: String? { get }
|
3
|
+
var project: String? { get }
|
4
|
+
var device: String? { get }
|
5
|
+
var toolchain: String? { get }
|
6
|
+
var devices: [String]? { get }
|
7
|
+
var scheme: String? { get }
|
8
|
+
var clean: Bool { get }
|
9
|
+
var codeCoverage: Bool? { get }
|
10
|
+
var addressSanitizer: Bool? { get }
|
11
|
+
var threadSanitizer: Bool? { get }
|
12
|
+
var skipBuild: Bool { get }
|
13
|
+
var outputDirectory: String { get }
|
14
|
+
var outputStyle: String? { get }
|
15
|
+
var outputTypes: String { get }
|
16
|
+
var outputFiles: String? { get }
|
17
|
+
var buildlogPath: String { get }
|
18
|
+
var includeSimulatorLogs: Bool { get }
|
19
|
+
var formatter: String? { get }
|
20
|
+
var testWithoutBuilding: Bool? { get }
|
21
|
+
var buildForTesting: Bool? { get }
|
22
|
+
var xctestrun: String? { get }
|
23
|
+
var derivedDataPath: String? { get }
|
24
|
+
var resultBundle: String? { get }
|
25
|
+
var sdk: String? { get }
|
26
|
+
var openReport: Bool { get }
|
27
|
+
var configuration: String? { get }
|
28
|
+
var destination: String? { get }
|
29
|
+
var xcargs: String? { get }
|
30
|
+
var xcconfig: String? { get }
|
31
|
+
var onlyTesting: String? { get }
|
32
|
+
var skipTesting: String? { get }
|
33
|
+
var slackUrl: String? { get }
|
34
|
+
var slackChannel: String? { get }
|
35
|
+
var slackMessage: String? { get }
|
36
|
+
var skipSlack: Bool { get }
|
37
|
+
var slackOnlyOnFailure: Bool { get }
|
38
|
+
var useClangReportName: Bool { get }
|
39
|
+
var customReportFileName: String? { get }
|
40
|
+
var failBuild: Bool { get }
|
41
|
+
}
|
42
|
+
|
43
|
+
extension ScanfileProtocol {
|
44
|
+
var workspace: String? { return nil }
|
45
|
+
var project: String? { return nil }
|
46
|
+
var device: String? { return nil }
|
47
|
+
var toolchain: String? { return nil }
|
48
|
+
var devices: [String]? { return nil }
|
49
|
+
var scheme: String? { return nil }
|
50
|
+
var clean: Bool { return false }
|
51
|
+
var codeCoverage: Bool? { return nil }
|
52
|
+
var addressSanitizer: Bool? { return nil }
|
53
|
+
var threadSanitizer: Bool? { return nil }
|
54
|
+
var skipBuild: Bool { return false }
|
55
|
+
var outputDirectory: String { return "./test_output" }
|
56
|
+
var outputStyle: String? { return nil }
|
57
|
+
var outputTypes: String { return "html,junit" }
|
58
|
+
var outputFiles: String? { return nil }
|
59
|
+
var buildlogPath: String { return "~/Library/Logs/scan" }
|
60
|
+
var includeSimulatorLogs: Bool { return false }
|
61
|
+
var formatter: String? { return nil }
|
62
|
+
var testWithoutBuilding: Bool? { return nil }
|
63
|
+
var buildForTesting: Bool? { return nil }
|
64
|
+
var xctestrun: String? { return nil }
|
65
|
+
var derivedDataPath: String? { return nil }
|
66
|
+
var resultBundle: String? { return nil }
|
67
|
+
var sdk: String? { return nil }
|
68
|
+
var openReport: Bool { return false }
|
69
|
+
var configuration: String? { return nil }
|
70
|
+
var destination: String? { return nil }
|
71
|
+
var xcargs: String? { return nil }
|
72
|
+
var xcconfig: String? { return nil }
|
73
|
+
var onlyTesting: String? { return nil }
|
74
|
+
var skipTesting: String? { return nil }
|
75
|
+
var slackUrl: String? { return nil }
|
76
|
+
var slackChannel: String? { return nil }
|
77
|
+
var slackMessage: String? { return nil }
|
78
|
+
var skipSlack: Bool { return false }
|
79
|
+
var slackOnlyOnFailure: Bool { return false }
|
80
|
+
var useClangReportName: Bool { return false }
|
81
|
+
var customReportFileName: String? { return nil }
|
82
|
+
var failBuild: Bool { return true }
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
// Please don't remove the lines below
|
87
|
+
// They are used to detect outdated files
|
88
|
+
// FastlaneRunnerAPIVersion [0.9.1]
|
@@ -0,0 +1,14 @@
|
|
1
|
+
// This class is automatically included in FastlaneRunner during build
|
2
|
+
|
3
|
+
// This autogenerated file will be overwritten or replaced during build time, or when you initialize `screengrab`
|
4
|
+
class Screengrabfile: ScreengrabfileProtocol {
|
5
|
+
// If you want to enable `screengrab`, run `fastlane screengrab init`
|
6
|
+
// After, this file will be replaced with a custom implementation that contains values you supplied
|
7
|
+
// during the `init` process, and you won't see this message
|
8
|
+
}
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
// Generated with fastlane 2.69.2
|