Class: Fastlane::Helper::IonicIntegrationHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/ionic_integration/helper/ionic_integration_helper.rb

Constant Summary collapse

HELPER_PATH =
File.expand_path(File.dirname(__FILE__))
IOS_RESOURCES_PATH =
File.expand_path("#{HELPER_PATH}/../resources/ios")

Class Method Summary collapse

Class Method Details

.copy_ios_sample_tests(scheme_name) ⇒ Object



24
25
26
27
28
# File 'lib/fastlane/plugin/ionic_integration/helper/ionic_integration_helper.rb', line 24

def self.copy_ios_sample_tests(scheme_name)
  source_folder = "#{IOS_RESOURCES_PATH}/#{IonicIntegration::IONIC_DEFAULT_UNIT_TEST_NAME}"
  dest_folder = "#{IonicIntegration::IONIC_IOS_CONFIG_UITESTS_PATH}/#{scheme_name}"
  copy_ios_ui_test_code(source_folder, dest_folder)
end

.copy_ios_ui_test_code(src_folder, project_folder) ⇒ Object

Copy over to the xcode project our pre-configured UI Test Code



13
14
15
16
17
18
19
20
21
22
# File 'lib/fastlane/plugin/ionic_integration/helper/ionic_integration_helper.rb', line 13

def self.copy_ios_ui_test_code(src_folder, project_folder)
  if src_folder && Dir.exist?(src_folder)
    dest_folder = project_folder.to_s
    UI.message "Copying iOS UI Tests from #{src_folder} to #{dest_folder}"
    Dir.exist?(dest_folder) || FileUtils.mkdir_p(dest_folder)
    FileUtils.cp_r(src_folder + "/.", dest_folder)
  elsif
    UI.user_error! "Copying iOS UI Test Files: #{src_folder} does not exist."
  end
end

.find_default_ios_xcode_workspaceObject

Find any existing Xcode Workspace generated by Ionic/Cordova



33
34
35
# File 'lib/fastlane/plugin/ionic_integration/helper/ionic_integration_helper.rb', line 33

def self.find_default_ios_xcode_workspace
  Dir["#{IonicIntegration::IONIC_IOS_BUILD_PATH}/*.xcodeproj"].last || nil
end