Class: Fastlane::SwiftFastlaneAPIGenerator
- Inherits:
-
SwiftAPIGenerator
- Object
- SwiftAPIGenerator
- Fastlane::SwiftFastlaneAPIGenerator
- Defined in:
- fastlane/lib/fastlane/swift_fastlane_api_generator.rb
Constant Summary
Constants inherited from SwiftAPIGenerator
Fastlane::SwiftAPIGenerator::DEFAULT_API_VERSION_STRING
Instance Attribute Summary
Attributes inherited from SwiftAPIGenerator
#action_options_to_ignore, #actions_not_supported, #fastlane_swift_api_path, #generated_paths, #target_filename, #target_output_path, #tools_option_files
Instance Method Summary collapse
- #extend_content(file_content, tool_details) ⇒ Object
-
#initialize(target_output_path: "swift") ⇒ SwiftFastlaneAPIGenerator
constructor
A new instance of SwiftFastlaneAPIGenerator.
Methods inherited from SwiftAPIGenerator
#autogen_version_warning_text, #determine_api_version, #find_api_version_string, #generate_default_implementations, #generate_lanefile_parsing_functions, #generate_lanefile_tool_objects, #generate_swift, #generate_tool_protocol, #ignore_param?, #increment_api_version_string, #process_action, #write_lanefile
Constructor Details
#initialize(target_output_path: "swift") ⇒ SwiftFastlaneAPIGenerator
Returns a new instance of SwiftFastlaneAPIGenerator.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'fastlane/lib/fastlane/swift_fastlane_api_generator.rb', line 20 def initialize(target_output_path: "swift") @target_filename = "Fastlane.swift" @target_output_path = File.(target_output_path) @generated_paths = [] super() self.actions_not_supported = ["import", "import_from_git"].to_set self. = { "precheck" => [ "negative_apple_sentiment", "placeholder_text", "other_platforms", "future_functionality", "test_words", "curse_words", "custom_text", "copyright_date", "unreachable_urls" ].to_set } end |
Instance Method Details
#extend_content(file_content, tool_details) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'fastlane/lib/fastlane/swift_fastlane_api_generator.rb', line 44 def extend_content(file_content, tool_details) file_content << "" # newline because we're adding an extension file_content << "// These are all the parsing functions needed to transform our data into the expected types" file_content << generate_lanefile_parsing_functions tool_objects = generate_lanefile_tool_objects(classes: tool_details.map(&:swift_class)) file_content << tool_objects old_file_content = File.read(fastlane_swift_api_path) new_file_content = file_content.join("\n") # compare old file content to potential new file content api_version = determine_api_version(new_file_content: new_file_content, old_file_content: old_file_content) old_api_version = find_api_version_string(content: old_file_content) # if there is a change, we need to write out the new file if api_version != old_api_version file_content << autogen_version_warning_text(api_version: api_version) else file_content = nil end return file_content end |