Class: Fastlane::Helper::CreateXcframeworkHelper
- Inherits:
-
Object
- Object
- Fastlane::Helper::CreateXcframeworkHelper
- Defined in:
- lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb
Instance Method Summary collapse
- #framework ⇒ Object
- #framework_BCSymbolMaps_path(framework_name) ⇒ Object
- #framework_dSYMs_path(framework_name) ⇒ Object
- #get_xcarchive_framework_path(framework_index, framework_name) ⇒ Object
- #get_xcframework_path(framework_name) ⇒ Object
-
#initialize(params) ⇒ CreateXcframeworkHelper
constructor
A new instance of CreateXcframeworkHelper.
- #library_identifier(framework_index) ⇒ Object
- #output_directory ⇒ Object
- #product_name ⇒ Object
- #xcarchive_BCSymbolMaps_path(framework_index) ⇒ Object
- #xcarchive_dSYMs_path(framework_index) ⇒ Object
- #xcarchive_framework_path(framework_index) ⇒ Object
- #xcarchive_frameworks_dir(framework_index) ⇒ Object
- #xcarchive_frameworks_path ⇒ Object
- #xcarchive_path ⇒ Object
- #xcarchive_path_for_destination(framework_index) ⇒ Object
- #xcframework ⇒ Object
- #xcframework_BCSymbolMaps_path ⇒ Object
- #xcframework_dSYMs_path ⇒ Object
- #xcframework_path ⇒ Object
Constructor Details
#initialize(params) ⇒ CreateXcframeworkHelper
Returns a new instance of CreateXcframeworkHelper.
4 5 6 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 4 def initialize(params) @params = params end |
Instance Method Details
#framework ⇒ Object
16 17 18 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 16 def framework "#{product_name}.framework" end |
#framework_BCSymbolMaps_path(framework_name) ⇒ Object
75 76 77 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 75 def framework_BCSymbolMaps_path(framework_name) File.("#{output_directory}/#{framework_name}.BCSymbolMaps") end |
#framework_dSYMs_path(framework_name) ⇒ Object
63 64 65 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 63 def framework_dSYMs_path(framework_name) File.("#{output_directory}/#{framework_name}.dSYMs") end |
#get_xcarchive_framework_path(framework_index, framework_name) ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 35 def get_xcarchive_framework_path(framework_index, framework_name) UI.("▸ get_xcarchive_framework_path: framework_name: `#{framework_name}`") framework_path = "#{xcarchive_path_for_destination(framework_index)}/Products/Library/Frameworks/#{framework_name}.framework" UI.("▸ get_xcarchive_framework_path: framework_path: `#{framework_path}`") return framework_path if File.exist?(framework_path) UI.user_error!("▸ get_xcarchive_framework_path: framework_name was misdefined: `#{framework_name}`. Please, provide :framework_name option") end |
#get_xcframework_path(framework_name) ⇒ Object
83 84 85 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 83 def get_xcframework_path(framework_name) File.("#{output_directory}/#{framework_name}.xcframework") end |
#library_identifier(framework_index) ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 91 def library_identifier(framework_index) framework_path = xcarchive_framework_path(framework_index) framework_basename = framework_path.split('/').last framework_root = framework_basename.split('.').first library_identifiers = Dir.chdir(xcframework_path) do Dir.glob('*').select { |f| File.directory?(f) } end library_identifier = library_identifiers.detect do |id| FileUtils.compare_file( "#{framework_path}/#{framework_root}", "#{xcframework_path}/#{id}/#{framework_basename}/#{framework_root}" ) end UI.user_error!("Error: #{xcframework_path} doesn't contain #{framework_path}") if library_identifier.nil? library_identifier end |
#output_directory ⇒ Object
87 88 89 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 87 def output_directory @params[:xcframework_output_directory] || '' end |
#product_name ⇒ Object
8 9 10 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 8 def product_name @params[:product_name] ||= @params[:scheme] end |
#xcarchive_BCSymbolMaps_path(framework_index) ⇒ Object
67 68 69 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 67 def xcarchive_BCSymbolMaps_path(framework_index) File.("#{xcarchive_path_for_destination(framework_index)}/BCSymbolMaps") end |
#xcarchive_dSYMs_path(framework_index) ⇒ Object
55 56 57 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 55 def xcarchive_dSYMs_path(framework_index) File.("#{xcarchive_path_for_destination(framework_index)}/dSYMS") end |
#xcarchive_framework_path(framework_index) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 28 def xcarchive_framework_path(framework_index) framework_path = "#{xcarchive_path_for_destination(framework_index)}/Products/Library/Frameworks/#{framework}" return framework_path if File.exist?(framework_path) UI.user_error!("▸ PRODUCT_NAME was misdefined: `#{product_name}`. Please, provide :product_name option") end |
#xcarchive_frameworks_dir(framework_index) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 44 def xcarchive_frameworks_dir(framework_index) frameworks_dir = "#{xcarchive_path_for_destination(framework_index)}/Products/Library/Frameworks" return frameworks_dir if File.exist?(frameworks_dir) UI.user_error!("▸ Frameworks directory does not exist for the given index: `#{framework_index}`.") end |
#xcarchive_frameworks_path ⇒ Object
51 52 53 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 51 def xcarchive_frameworks_path @params[:destinations].each_with_index.map { |_, i| xcarchive_framework_path(i) } end |
#xcarchive_path ⇒ Object
20 21 22 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 20 def xcarchive_path "#{output_directory}/archives" end |
#xcarchive_path_for_destination(framework_index) ⇒ Object
24 25 26 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 24 def xcarchive_path_for_destination(framework_index) "#{xcarchive_path}/#{framework_index}_#{product_name}.xcarchive" end |
#xcframework ⇒ Object
12 13 14 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 12 def xcframework "#{product_name}.xcframework" end |
#xcframework_BCSymbolMaps_path ⇒ Object
71 72 73 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 71 def xcframework_BCSymbolMaps_path File.("#{output_directory}/#{product_name}.BCSymbolMaps") end |
#xcframework_dSYMs_path ⇒ Object
59 60 61 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 59 def xcframework_dSYMs_path File.("#{output_directory}/#{product_name}.dSYMs") end |
#xcframework_path ⇒ Object
79 80 81 |
# File 'lib/fastlane/plugin/mobile_tools/helper/create_xcframework_helper.rb', line 79 def xcframework_path File.("#{output_directory}/#{xcframework}") end |