Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Serghei Moret committed Jan 12, 2018
2 parents 14ad954 + 91b6ddf commit 9c7e592
Show file tree
Hide file tree
Showing 26 changed files with 1,012 additions and 573 deletions.
28 changes: 24 additions & 4 deletions Calabash Launcher.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/* Begin PBXBuildFile section */
5D1A40371F98FBE60055F57F /* SharedElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D1A40361F98FBE60055F57F /* SharedElement.swift */; };
5D272E7F1FB98BC200E957DE /* NSStoryboard+Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D272E7E1FB98BC200E957DE /* NSStoryboard+Constants.swift */; };
5D70B6471FEBB40700EE767D /* NSUserInterfaceItemIdentifier+Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D70B6461FEBB40700EE767D /* NSUserInterfaceItemIdentifier+Constants.swift */; };
5D948C901F8F4BDA0001BC50 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D948C8F1F8F4BDA0001BC50 /* Extensions.swift */; };
5D948C921F8F4FC40001BC50 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D948C911F8F4FC40001BC50 /* Constants.swift */; };
5D948C941F8F556D0001BC50 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D948C931F8F556D0001BC50 /* Language.swift */; };
Expand All @@ -31,14 +33,15 @@
ED4C14E81DB29FB700A1190E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED4C14E61DB29FB700A1190E /* Main.storyboard */; };
ED4C14F01DB2A10E00A1190E /* BuildScript.command in Resources */ = {isa = PBXBuildFile; fileRef = ED4C14EF1DB2A10E00A1190E /* BuildScript.command */; };
ED4C14F21DB2DB1C00A1190E /* get_sim_list.command in Resources */ = {isa = PBXBuildFile; fileRef = ED4C14F11DB2DB1C00A1190E /* get_sim_list.command */; };
ED51B7181F8FC2F500759547 /* PlistOperations.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED51B7171F8FC2F500759547 /* PlistOperations.swift */; };
ED51B7181F8FC2F500759547 /* PlistHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED51B7171F8FC2F500759547 /* PlistHandler.swift */; };
ED51B71A1F90BE5300759547 /* PathWarningViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED51B7191F90BE5300759547 /* PathWarningViewController.swift */; };
ED5DB5FD1E01534A00B0FADC /* create_irb_session.command in Resources */ = {isa = PBXBuildFile; fileRef = ED5DB5FC1E01534A00B0FADC /* create_irb_session.command */; };
ED66FA801E098E3F0081A30D /* flash.command in Resources */ = {isa = PBXBuildFile; fileRef = ED66FA7F1E098E3F0081A30D /* flash.command */; };
ED66FA821E0AB8570081A30D /* quit_irb_session.command in Resources */ = {isa = PBXBuildFile; fileRef = ED66FA811E0AB8570081A30D /* quit_irb_session.command */; };
ED7045051DD61B9000272059 /* get_screen.command in Resources */ = {isa = PBXBuildFile; fileRef = ED7045041DD61B9000272059 /* get_screen.command */; };
ED7045071DD6202400272059 /* get_elements_by_offset.command in Resources */ = {isa = PBXBuildFile; fileRef = ED7045061DD6202400272059 /* get_elements_by_offset.command */; };
ED7278961FA78E050022505E /* app_download.command in Resources */ = {isa = PBXBuildFile; fileRef = ED7278951FA78E050022505E /* app_download.command */; };
ED7764841FF78033007E85AE /* check_for_duplicates.command in Resources */ = {isa = PBXBuildFile; fileRef = ED7764831FF78033007E85AE /* check_for_duplicates.command */; };
ED85D2ED1F94D8A000E5E2D8 /* change_sim_language.command in Resources */ = {isa = PBXBuildFile; fileRef = ED85D2EC1F94D8A000E5E2D8 /* change_sim_language.command */; };
ED85D2F01F950A9400E5E2D8 /* LanguageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED85D2EF1F950A9400E5E2D8 /* LanguageViewController.swift */; };
ED9472941E365F9D00FE2982 /* ElementConstructorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED9472931E365F9C00FE2982 /* ElementConstructorViewController.swift */; };
Expand All @@ -49,6 +52,8 @@
ED99D7B01FB335560077B965 /* Sparkle.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = ED99D7AA1FB334DA0077B965 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
ED9AC7541FB5E12200886E06 /* get_physical_device.command in Resources */ = {isa = PBXBuildFile; fileRef = ED9AC7531FB5E12100886E06 /* get_physical_device.command */; };
EDB433361DD49AF5001BABEC /* InspectorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDB433351DD49AF5001BABEC /* InspectorViewController.swift */; };
EDBC4AE32002C8A6000E4D63 /* erase_simulator.command in Resources */ = {isa = PBXBuildFile; fileRef = EDBC4AE22002C8A6000E4D63 /* erase_simulator.command */; };
EDBC4AE120024CD3000E4D63 /* app_install.command in Resources */ = {isa = PBXBuildFile; fileRef = EDBC4AE020024CD3000E4D63 /* app_install.command */; };
EDBC88071DFEE8A6004CB840 /* kill_process.command in Resources */ = {isa = PBXBuildFile; fileRef = EDBC88061DFEE8A6004CB840 /* kill_process.command */; };
EDC06B7C1DB40E7800379878 /* get_tags.command in Resources */ = {isa = PBXBuildFile; fileRef = EDC06B7B1DB40E7800379878 /* get_tags.command */; };
EDC4C6331F9A1DC000EAE830 /* TextViewPrinter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDC4C6321F9A1DC000EAE830 /* TextViewPrinter.swift */; };
Expand Down Expand Up @@ -82,6 +87,8 @@

/* Begin PBXFileReference section */
5D1A40361F98FBE60055F57F /* SharedElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedElement.swift; sourceTree = "<group>"; };
5D272E7E1FB98BC200E957DE /* NSStoryboard+Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSStoryboard+Constants.swift"; sourceTree = "<group>"; };
5D70B6461FEBB40700EE767D /* NSUserInterfaceItemIdentifier+Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSUserInterfaceItemIdentifier+Constants.swift"; sourceTree = "<group>"; };
5D948C8F1F8F4BDA0001BC50 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
5D948C911F8F4FC40001BC50 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
5D948C931F8F556D0001BC50 /* Language.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Language.swift; sourceTree = "<group>"; };
Expand All @@ -105,14 +112,15 @@
ED4C14E91DB29FB700A1190E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
ED4C14EF1DB2A10E00A1190E /* BuildScript.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = BuildScript.command; sourceTree = "<group>"; };
ED4C14F11DB2DB1C00A1190E /* get_sim_list.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = get_sim_list.command; sourceTree = "<group>"; };
ED51B7171F8FC2F500759547 /* PlistOperations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlistOperations.swift; sourceTree = "<group>"; };
ED51B7171F8FC2F500759547 /* PlistHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlistHandler.swift; sourceTree = "<group>"; };
ED51B7191F90BE5300759547 /* PathWarningViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PathWarningViewController.swift; sourceTree = "<group>"; };
ED5DB5FC1E01534A00B0FADC /* create_irb_session.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = create_irb_session.command; sourceTree = "<group>"; };
ED66FA7F1E098E3F0081A30D /* flash.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = flash.command; sourceTree = "<group>"; };
ED66FA811E0AB8570081A30D /* quit_irb_session.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = quit_irb_session.command; sourceTree = "<group>"; };
ED7045041DD61B9000272059 /* get_screen.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = get_screen.command; sourceTree = "<group>"; };
ED7045061DD6202400272059 /* get_elements_by_offset.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = get_elements_by_offset.command; sourceTree = "<group>"; };
ED7278951FA78E050022505E /* app_download.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = app_download.command; sourceTree = "<group>"; };
ED7764831FF78033007E85AE /* check_for_duplicates.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = check_for_duplicates.command; sourceTree = "<group>"; };
ED85D2EC1F94D8A000E5E2D8 /* change_sim_language.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = change_sim_language.command; sourceTree = "<group>"; };
ED85D2EF1F950A9400E5E2D8 /* LanguageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguageViewController.swift; sourceTree = "<group>"; };
ED9472931E365F9C00FE2982 /* ElementConstructorViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ElementConstructorViewController.swift; sourceTree = "<group>"; };
Expand All @@ -121,6 +129,8 @@
ED99D7AA1FB334DA0077B965 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Launcher/Frameworks/Sparkle.framework; sourceTree = "<group>"; };
ED9AC7531FB5E12100886E06 /* get_physical_device.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = get_physical_device.command; sourceTree = "<group>"; };
EDB433351DD49AF5001BABEC /* InspectorViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InspectorViewController.swift; sourceTree = "<group>"; };
EDBC4AE22002C8A6000E4D63 /* erase_simulator.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = erase_simulator.command; sourceTree = "<group>"; };
EDBC4AE020024CD3000E4D63 /* app_install.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = app_install.command; sourceTree = "<group>"; };
EDBC88061DFEE8A6004CB840 /* kill_process.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = kill_process.command; sourceTree = "<group>"; };
EDC06B7B1DB40E7800379878 /* get_tags.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = get_tags.command; sourceTree = "<group>"; };
EDC4C6321F9A1DC000EAE830 /* TextViewPrinter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextViewPrinter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -206,8 +216,10 @@
ED06A0E11E850CA70092C96E /* BashOutput.swift */,
5D948C8F1F8F4BDA0001BC50 /* Extensions.swift */,
5D948C911F8F4FC40001BC50 /* Constants.swift */,
5D272E7E1FB98BC200E957DE /* NSStoryboard+Constants.swift */,
5D70B6461FEBB40700EE767D /* NSUserInterfaceItemIdentifier+Constants.swift */,
5D948C931F8F556D0001BC50 /* Language.swift */,
ED51B7171F8FC2F500759547 /* PlistOperations.swift */,
ED51B7171F8FC2F500759547 /* PlistHandler.swift */,
D7E21B491F969FDD0044169A /* Localization.swift */,
D7E21B4B1F96B0470044169A /* RegexHandler.swift */,
EDC4C6321F9A1DC000EAE830 /* TextViewPrinter.swift */,
Expand All @@ -228,6 +240,9 @@
EDD303941F8F86B00042E27F /* bash */ = {
isa = PBXGroup;
children = (
EDBC4AE22002C8A6000E4D63 /* erase_simulator.command */,
EDBC4AE020024CD3000E4D63 /* app_install.command */,
ED7764831FF78033007E85AE /* check_for_duplicates.command */,
ED9AC7531FB5E12100886E06 /* get_physical_device.command */,
D7E995B71FAFB1D600318741 /* check_sim_type.command */,
ED7278951FA78E050022505E /* app_download.command */,
Expand Down Expand Up @@ -382,10 +397,13 @@
ED85D2ED1F94D8A000E5E2D8 /* change_sim_language.command in Resources */,
EDFF031A1DD4A245000CA17C /* start_device.command in Resources */,
EDCDF5681E1AAC9F00738F91 /* Gemfile in Resources */,
EDBC4AE32002C8A6000E4D63 /* erase_simulator.command in Resources */,
EDBC4AE120024CD3000E4D63 /* app_install.command in Resources */,
ED7045071DD6202400272059 /* get_elements_by_offset.command in Resources */,
ED9472961E37BD3E00FE2982 /* get_uniq_elements.command in Resources */,
EDEBE3861E0BD2D60069B9BC /* clicked_2.png in Resources */,
EDC06B7C1DB40E7800379878 /* get_tags.command in Resources */,
ED7764841FF78033007E85AE /* check_for_duplicates.command in Resources */,
ED4C14E81DB29FB700A1190E /* Main.storyboard in Resources */,
D7E995B81FAFB1D600318741 /* check_sim_type.command in Resources */,
ED4C14F01DB2A10E00A1190E /* BuildScript.command in Resources */,
Expand All @@ -410,6 +428,7 @@
5D1A40371F98FBE60055F57F /* SharedElement.swift in Sources */,
EDFF031C1DD4C33A000CA17C /* DeviceCollector.swift in Sources */,
ED4C14E31DB29FB700A1190E /* TasksViewController.swift in Sources */,
5D70B6471FEBB40700EE767D /* NSUserInterfaceItemIdentifier+Constants.swift in Sources */,
FD4D0F351F8D086100EAD142 /* ApplicationStateHandler.swift in Sources */,
ED9472941E365F9D00FE2982 /* ElementConstructorViewController.swift in Sources */,
EDB433361DD49AF5001BABEC /* InspectorViewController.swift in Sources */,
Expand All @@ -421,8 +440,9 @@
5D948C901F8F4BDA0001BC50 /* Extensions.swift in Sources */,
ED4C14E11DB29FB700A1190E /* AppDelegate.swift in Sources */,
FD1047081F90B02E00A89D1C /* TagsController.swift in Sources */,
5D272E7F1FB98BC200E957DE /* NSStoryboard+Constants.swift in Sources */,
D7E21B4A1F969FDD0044169A /* Localization.swift in Sources */,
ED51B7181F8FC2F500759547 /* PlistOperations.swift in Sources */,
ED51B7181F8FC2F500759547 /* PlistHandler.swift in Sources */,
D71FD8681F9E6C140091FD30 /* AppHandler.swift in Sources */,
ED51B71A1F90BE5300759547 /* PathWarningViewController.swift in Sources */,
5D948C921F8F4FC40001BC50 /* Constants.swift in Sources */,
Expand Down
35 changes: 16 additions & 19 deletions Launcher/Classes/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,31 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}

@IBAction func configurationButton(_ sender: Any) {
if
let controller = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"), bundle: nil).instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "settingswindow")) as? SettingsViewController,
guard
let controller = NSStoryboard(name: .main, bundle: nil).instantiateController(withIdentifier: .settingsWindow) as? SettingsViewController,
let contentViewController = NSApplication.shared.mainWindow?.contentViewController,
contentViewController.presentedViewControllers?.first(where: { $0 is SettingsViewController }) == nil {
contentViewController.presentViewControllerAsSheet(controller)
}
contentViewController.presentedViewControllers?.first(where: { $0 is SettingsViewController }) == nil else { return }
contentViewController.presentViewControllerAsSheet(controller)
}

@IBAction func resetUserDefaults(_ sender: Any) {
// Reset UserDefaults
if let appDomain = Bundle.main.bundleIdentifier {
UserDefaults.standard.removePersistentDomain(forName: appDomain)
AppHandler().restartApplication()
} else {
if
let controller = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"), bundle: nil).instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "warningwindow")) as? NSViewController,
} else if
let controller = NSStoryboard(name: .main, bundle: nil).instantiateController(withIdentifier: .warningWindow) as? NSViewController,
let contentViewController = NSApplication.shared.mainWindow?.contentViewController,
contentViewController.presentedViewControllers?.first(where: { $0 is SettingsViewController }) == nil {
contentViewController.presentViewControllerAsModalWindow(controller)
}
contentViewController.presentViewControllerAsModalWindow(controller)
}
}

@IBAction func runTests(_ sender: Any) {
if
guard
let tabViewController = NSApplication.shared.mainWindow?.contentViewController as? NSTabViewController,
let tasksViewController = tabViewController.childViewControllers.first as? TasksViewController {
tasksViewController.runScript()
}
let tasksViewController = tabViewController.childViewControllers.first as? TasksViewController else { return }
tasksViewController.runScript()
}

func application(application: NSApplication, shouldSaveApplicationState coder: NSCoder) -> Bool {
Expand Down Expand Up @@ -86,12 +82,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func killProcessScreenshot() {
let taskQueueNew = DispatchQueue.global(qos: .background)

taskQueueNew.sync {
taskQueueNew.sync { [weak self] in
guard let strongSelf = self else { return }
let path = Constants.FilePaths.Bash.killProcess
self.buildTaskNew = Process()
self.buildTaskNew.launchPath = path
self.buildTaskNew.launch()
self.buildTaskNew.waitUntilExit()
strongSelf.buildTaskNew = Process()
strongSelf.buildTaskNew.launchPath = path
strongSelf.buildTaskNew.launch()
strongSelf.buildTaskNew.waitUntilExit()
}
}
}
18 changes: 4 additions & 14 deletions Launcher/Classes/ApplicationStateHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ class ApplicationStateHandler {
case language = "testLanguage"
case tag = "testTag"
case debugState = "debugCheckboxState"
case cucumberProfile = "cucumberProfile"
case additionalRunParameters = "additionalRunParameters"
case deviceIP = "deviceIP"
case bundleID = "bundleID"
case downloadCheckbox = "downloadCheckbox"
}

var physicalRadioButtonState: Bool {
Expand Down Expand Up @@ -91,21 +90,12 @@ class ApplicationStateHandler {
}
}

var cucumberProfile: String? {
var downloadCheckbox: String? {
get {
return defaults.string(forKey: .cucumberProfile)
return defaults.string(forKey: .downloadCheckbox)
}
set {
defaults.set(newValue, forKey: .cucumberProfile)
}
}

var additionalRunParameters: String? {
get {
return defaults.string(forKey: .additionalRunParameters)
}
set {
defaults.set(newValue, forKey: .additionalRunParameters)
defaults.set(newValue, forKey: .downloadCheckbox)
}
}

Expand Down
10 changes: 10 additions & 0 deletions Launcher/Classes/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ enum Constants {

enum Keys {
static let linkInfo = "linksInfo"
static let cucumberProfileInfo = "cucumberProfileInfo"
static let additionalFieldInfo = "additionalInfo"
static let pathToBuildInfo = "pathToBuildInfo"
static let commandFieldInfo = "commandFieldInfo"
}

enum FilePaths {
Expand All @@ -25,6 +29,9 @@ enum Constants {
static let flash = main.path(forResource: "flash", ofType: .bash)
static let appDownload = main.path(forResource: "app_download", ofType: .bash)
static let checkSimulatorType = main.path(forResource: "check_sim_type", ofType: .bash)
static let eraseSimulator = main.path(forResource: "erase_simulator", ofType: .bash)
static let appInstall = main.path(forResource: "app_install", ofType: .bash)
static let checkDuplicates = main.path(forResource: "check_for_duplicates", ofType: .bash)

// Interactive Ruby Shell
static let createIRBSession = main.path(forResource: "create_irb_session", ofType: .bash)
Expand All @@ -44,6 +51,9 @@ enum Constants {
enum Ruby {
static let helpers = main.path(forResource: "helpers", ofType: .ruby)
}
enum InternalResources {
static let defaultPlist = "/CalabashLauncherSettings.plist"
}
}

enum DeviceType {
Expand Down
Loading

0 comments on commit 9c7e592

Please sign in to comment.