├── .gitignore ├── .rspec ├── .rubocop.yml ├── .travis.yml ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── fastlane-plugin-rome.gemspec ├── fastlane ├── Fastfile └── Pluginfile ├── lib └── fastlane │ └── plugin │ ├── rome.rb │ └── rome │ ├── actions │ └── rome_action.rb │ ├── helper │ └── rome_helper.rb │ └── version.rb └── spec ├── rome_action_spec.rb └── spec_helper.rb /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | Gemfile.lock 3 | 4 | ## Documentation cache and generated files: 5 | /.yardoc/ 6 | /_yardoc/ 7 | /doc/ 8 | /rdoc/ 9 | fastlane/README.md 10 | fastlane/report.xml 11 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | --color 3 | --format d 4 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | # kind_of? is a good way to check a type 2 | Style/ClassCheck: 3 | EnforcedStyle: kind_of? 4 | 5 | Style/FrozenStringLiteralComment: 6 | Enabled: false 7 | 8 | # This doesn't work with older versions of Ruby (pre 2.4.0) 9 | Style/SafeNavigation: 10 | Enabled: false 11 | 12 | # This doesn't work with older versions of Ruby (pre 2.4.0) 13 | Performance/RegexpMatch: 14 | Enabled: false 15 | 16 | # .length == 0 is also good, we don't always want .zero? 17 | Style/NumericPredicate: 18 | Enabled: false 19 | 20 | # this would cause errors with long lanes 21 | Metrics/BlockLength: 22 | Enabled: false 23 | 24 | # this is a bit buggy 25 | Metrics/ModuleLength: 26 | Enabled: false 27 | 28 | # certificate_1 is an okay variable name 29 | Style/VariableNumber: 30 | Enabled: false 31 | 32 | # This is used a lot across the fastlane code base for config files 33 | Style/MethodMissingSuper: 34 | Enabled: false 35 | 36 | 37 | Style/MissingRespondToMissing: 38 | Enabled: false 39 | 40 | # 41 | # File.chmod(0777, f) 42 | # 43 | # is easier to read than 44 | # 45 | # File.chmod(0o777, f) 46 | # 47 | Style/NumericLiteralPrefix: 48 | Enabled: false 49 | 50 | # 51 | # command = (!clean_expired.nil? || !clean_pattern.nil?) ? CLEANUP : LIST 52 | # 53 | # is easier to read than 54 | # 55 | # command = !clean_expired.nil? || !clean_pattern.nil? ? CLEANUP : LIST 56 | # 57 | Style/TernaryParentheses: 58 | Enabled: false 59 | 60 | # sometimes it is usefull to have those empty methods 61 | Style/EmptyMethod: 62 | Enabled: false 63 | 64 | # It's better to be more explicit about the type 65 | Style/BracesAroundHashParameters: 66 | Enabled: false 67 | 68 | # specs sometimes have useless assignments, which is fine 69 | Lint/UselessAssignment: 70 | Exclude: 71 | - '**/spec/**/*' 72 | 73 | # We could potentially enable the 2 below: 74 | Style/IndentHash: 75 | Enabled: false 76 | 77 | Style/AlignHash: 78 | Enabled: false 79 | 80 | # HoundCI doesn't like this rule 81 | Style/DotPosition: 82 | Enabled: false 83 | 84 | # We allow !! as it's an easy way to convert ot boolean 85 | Style/DoubleNegation: 86 | Enabled: false 87 | 88 | # Sometimes we allow a rescue block that doesn't contain code 89 | Lint/HandleExceptions: 90 | Enabled: false 91 | 92 | # Cop supports --auto-correct. 93 | Lint/UnusedBlockArgument: 94 | Enabled: false 95 | 96 | # Needed for $verbose 97 | Style/GlobalVars: 98 | Enabled: false 99 | 100 | # We want to allow class Fastlane::Class 101 | Style/ClassAndModuleChildren: 102 | Enabled: false 103 | 104 | # $? Exit 105 | Style/SpecialGlobalVars: 106 | Enabled: false 107 | 108 | Metrics/AbcSize: 109 | Enabled: false 110 | 111 | Metrics/MethodLength: 112 | Enabled: false 113 | 114 | Metrics/CyclomaticComplexity: 115 | Enabled: false 116 | 117 | # The %w might be confusing for new users 118 | Style/WordArray: 119 | MinSize: 19 120 | 121 | # raise and fail are both okay 122 | Style/SignalException: 123 | Enabled: false 124 | 125 | # Better too much 'return' than one missing 126 | Style/RedundantReturn: 127 | Enabled: false 128 | 129 | # Having if in the same line might not always be good 130 | Style/IfUnlessModifier: 131 | Enabled: false 132 | 133 | # and and or is okay 134 | Style/AndOr: 135 | Enabled: false 136 | 137 | # Configuration parameters: CountComments. 138 | Metrics/ClassLength: 139 | Max: 320 140 | 141 | 142 | # Configuration parameters: AllowURI, URISchemes. 143 | Metrics/LineLength: 144 | Max: 370 145 | 146 | # Configuration parameters: CountKeywordArgs. 147 | Metrics/ParameterLists: 148 | Max: 17 149 | 150 | Metrics/PerceivedComplexity: 151 | Max: 18 152 | 153 | # Sometimes it's easier to read without guards 154 | Style/GuardClause: 155 | Enabled: false 156 | 157 | # We allow both " and ' 158 | Style/StringLiterals: 159 | Enabled: false 160 | 161 | # something = if something_else 162 | # that's confusing 163 | Style/ConditionalAssignment: 164 | Enabled: false 165 | 166 | # Better to have too much self than missing a self 167 | Style/RedundantSelf: 168 | Enabled: false 169 | 170 | # e.g. 171 | # def self.is_supported?(platform) 172 | # we may never use `platform` 173 | Lint/UnusedMethodArgument: 174 | Enabled: false 175 | 176 | # the let(:key) { ... } 177 | Lint/ParenthesesAsGroupedExpression: 178 | Exclude: 179 | - '**/spec/**/*' 180 | 181 | # This would reject is_ in front of methods 182 | # We use `is_supported?` everywhere already 183 | Style/PredicateName: 184 | Enabled: false 185 | 186 | # We allow the $ 187 | Style/PerlBackrefs: 188 | Enabled: false 189 | 190 | # Disable '+ should be surrounded with a single space' for xcodebuild_spec.rb 191 | Style/SpaceAroundOperators: 192 | Exclude: 193 | - '**/spec/actions_specs/xcodebuild_spec.rb' 194 | 195 | AllCops: 196 | Include: 197 | - '**/fastlane/Fastfile' 198 | Exclude: 199 | - '**/lib/assets/custom_action_template.rb' 200 | - './vendor/**/*' 201 | 202 | # We're not there yet 203 | Style/Documentation: 204 | Enabled: false 205 | 206 | # Added after upgrade to 0.38.0 207 | Style/MutableConstant: 208 | Enabled: false 209 | 210 | # length > 0 is good 211 | Style/ZeroLengthPredicate: 212 | Enabled: false 213 | 214 | # Adds complexity 215 | Style/IfInsideElse: 216 | Enabled: false 217 | 218 | # Sometimes we just want to 'collect' 219 | Style/CollectionMethods: 220 | Enabled: false 221 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | os: osx # enable this if you need macOS support 2 | language: ruby 3 | rvm: 4 | - 2.4.1 5 | 6 | install: 7 | - brew install blender/homebrew-tap/rome 8 | - gem install bundler 9 | 10 | script: 11 | # Run bundler and install the dependencies in vendor/bundle 12 | # so that it can be cached. 13 | - bundle install 14 | - rake 15 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec 4 | 5 | plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') 6 | eval_gemfile(plugins_path) if File.exist?(plugins_path) 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017, 2018, 2019, 2020, 2021 4 | François Benaiteau 5 | Tommaso Piazza <196761+tmspzz@users.noreply.github.com> 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rome plugin 2 | 3 | [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-rome) 4 | 5 | ## Getting Started 6 | 7 | This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-rome`, add it to your project by running: 8 | 9 | ```bash 10 | fastlane add_plugin rome 11 | ``` 12 | 13 | ## About rome 14 | 15 | A S3 cache tool for Carthage 16 | 17 | Please see more on the tool's repo: [Rome](https://github.com/blender/rome) 18 | 19 | ## Examples 20 | 21 | ```bash 22 | rome( 23 | frameworks: ["MyFramework1", "MyFramework2"], # Specify which frameworks to upload or download 24 | command: "upload", # One of: download, upload, list 25 | verbose: false, # Print rome output inline 26 | platform: "all", # Define which platform to build for (one of ‘all’, ‘Mac’, ‘iOS’, ‘watchOS’, ‘tvOS‘, or comma-separated values of the formers except for ‘all’). Can't be combined with the 'usexcframeworks' option 27 | cacheprefix: "Swift_4_2_1", # A prefix appended to the top level directories inside the caches. Useful to separate artifacts between Swift versions 28 | romefile: "~/Code/", # The path to the Romefile to use. Defaults to the \"Romefile\" in the current directory 29 | noignore: "true", # Ignore the `ignoreMap` section in the Romefile when performing the operation 30 | concurrently: "true", # Maximise concurrency while performing the operation. Might make verbose output hard to follow 31 | usexcframeworks: "true" # Search for .xcframeworks when performing the upload or download operation. Can't be combined with the 'platform' option 32 | ) 33 | ``` 34 | 35 | ```bash 36 | rome( 37 | command: "list", 38 | printformat: "JSON", # Sets list output formats: JSON or if omitted, default to Text 39 | ) 40 | ``` 41 | 42 | ## Run tests for this plugin 43 | 44 | To run both the tests, and code style validation, run 45 | 46 | ``` 47 | rake 48 | ``` 49 | 50 | To automatically fix many of the styling issues, use 51 | ``` 52 | rubocop -a 53 | ``` 54 | 55 | ## Issues and Feedback 56 | 57 | For any other issues and feedback about this plugin, please submit it to this repository. 58 | 59 | ## Troubleshooting 60 | 61 | If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide. 62 | 63 | ## Using `fastlane` Plugins 64 | 65 | For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/). 66 | 67 | ## About `fastlane` 68 | 69 | `fastlane` is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools). 70 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'bundler/gem_tasks' 2 | 3 | require 'rspec/core/rake_task' 4 | RSpec::Core::RakeTask.new 5 | 6 | require 'rubocop/rake_task' 7 | RuboCop::RakeTask.new(:rubocop) 8 | 9 | task default: [:spec, :rubocop] 10 | -------------------------------------------------------------------------------- /fastlane-plugin-rome.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path("../lib", __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require 'fastlane/plugin/rome/version' 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = 'fastlane-plugin-rome' 8 | spec.version = Fastlane::Rome::VERSION 9 | spec.authors = ['François Benaiteau', 'Tommaso Piazza'] 10 | spec.email = ['francois.benaiteau@gmail.com', 'tommaso.piazza@gmail.com'] 11 | 12 | spec.summary = %q{A cache tool for Carthage} 13 | spec.homepage = "https://github.com/OpenShelter/fastlane-plugin-rome" 14 | spec.license = "MIT" 15 | 16 | spec.files = Dir["lib/**/*"] + %w(README.md LICENSE) 17 | spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 18 | spec.require_paths = ['lib'] 19 | 20 | # Don't add a dependency to fastlane or fastlane_re 21 | # since this would cause a circular dependency 22 | 23 | # spec.add_dependency 'your-dependency', '~> 1.0.0' 24 | 25 | spec.add_development_dependency 'pry' 26 | spec.add_development_dependency 'bundler' 27 | spec.add_development_dependency 'rspec' 28 | spec.add_development_dependency 'rake' 29 | spec.add_development_dependency 'rubocop' 30 | spec.add_development_dependency 'fastlane', '>= 2.22.0' 31 | end 32 | -------------------------------------------------------------------------------- /fastlane/Fastfile: -------------------------------------------------------------------------------- 1 | lane :test do 2 | rome 3 | end 4 | -------------------------------------------------------------------------------- /fastlane/Pluginfile: -------------------------------------------------------------------------------- 1 | # Autogenerated by fastlane 2 | -------------------------------------------------------------------------------- /lib/fastlane/plugin/rome.rb: -------------------------------------------------------------------------------- 1 | require 'fastlane/plugin/rome/version' 2 | 3 | module Fastlane 4 | module Rome 5 | # Return all .rb files inside the "actions" and "helper" directory 6 | def self.all_classes 7 | Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))] 8 | end 9 | end 10 | end 11 | 12 | # By default we want to import all available actions and helpers 13 | # A plugin can contain any number of actions and plugins 14 | Fastlane::Rome.all_classes.each do |current| 15 | require current 16 | end 17 | -------------------------------------------------------------------------------- /lib/fastlane/plugin/rome/actions/rome_action.rb: -------------------------------------------------------------------------------- 1 | module Fastlane 2 | module Actions 3 | class RomeAction < Action 4 | def self.run(params) 5 | validate(params) 6 | 7 | cmd = [params[:binary_path].chomp] 8 | command_name = params[:command] 9 | 10 | if command_name == "version" 11 | cmd << "--version" 12 | elsif command_name == "help" 13 | cmd << "--help" 14 | else 15 | cmd << command_name 16 | end 17 | 18 | if (command_name == "upload" || command_name == "download") && params[:frameworks].count > 0 19 | cmd.concat params[:frameworks] 20 | elsif command_name == "list" 21 | cmd << "--missing" if params[:missing] == true 22 | cmd << "--present" if params[:present] == true 23 | end 24 | 25 | cmd << "--platform #{params[:platform]}" if params[:platform] 26 | cmd << "--cache-prefix #{params[:cacheprefix]}" if params[:cacheprefix] 27 | cmd << "--print-format #{params[:printformat]}" if params[:printformat] 28 | cmd << "--romefile #{params[:romefile]}" if params[:romefile] 29 | cmd << "--no-ignore" if params[:noignore] == true 30 | cmd << "--no-skip-current" if params[:noskipcurrent] == true 31 | cmd << "--concurrently" if params[:concurrently] == true 32 | cmd << "--use-xcframeworks" if params[:usexcframeworks] == true 33 | cmd << "-v " if params[:verbose] 34 | 35 | return Actions.sh(cmd.join(' ')) 36 | end 37 | 38 | def self.meet_minimum_version(binary_path, minimum_version) 39 | version = Actions.sh("#{binary_path} --version") # i.e. 0.12.0.31 - Romam uno die non fuisse conditam. 40 | version_number = version.split(' - ')[0] 41 | 42 | return version_is_greater_or_equal(version_number, minimum_version) 43 | end 44 | 45 | def self.version_is_greater_or_equal(lhs_version, rhs_version) 46 | 47 | lhs_parts = lhs_version.split('.') 48 | rhs_parts = rhs_version.split('.') 49 | 50 | for i in 0..lhs_parts.length do 51 | part = lhs_parts[i] || "0" 52 | min_part = rhs_parts[i] || "0" 53 | 54 | if part.to_i > min_part.to_i 55 | return true 56 | elsif part.to_i == min_part.to_i 57 | else part.to_i < min_part.to_i 58 | return false 59 | end 60 | end 61 | return true 62 | end 63 | 64 | def self.validate(params) 65 | binary_path = params[:binary_path].chomp 66 | unless binary_path.include?('rome') 67 | UI.important("Install Rome for the plugin to work") 68 | UI.important("") 69 | UI.error("Or install it using CocoaPods:") 70 | UI.error("Add `pod 'Rome'` to your Podfile, and set `binary_path` option to `Pods/Rome/rome`") 71 | UI.error("") 72 | UI.error("Install it using Homebrew:") 73 | UI.command("brew install blender/homebrew-tap/rome") 74 | UI.error("") 75 | UI.error("If you don't have homebrew, visit http://brew.sh") 76 | 77 | UI.user_error!("Install Rome and start your lane again!") 78 | end 79 | 80 | command_name = params[:command] 81 | if !(command_name == "upload" || command_name == "download") && (params[:frameworks] || []).count > 0 82 | UI.user_error!("Frameworks option is available only for 'upload'' or 'download' commands.") 83 | end 84 | 85 | if command_name != "list" && (params[:missing] || params [:present]) 86 | UI.user_error!("Missing/Present option is available only for 'list' command.") 87 | end 88 | 89 | if command_name == "list" && !(params[:printformat] == nil || params[:printformat] == "JSON" || params[:printformat] == "Text") 90 | UI.user_error!("Unsupported print format. Supported print formats are 'JSON' and 'Text'.") 91 | UI.user_error!("'printformat' option requires Rome version '0.13.0.33' or later") if !meet_minimum_version(binary_path, "0.13.0.33") 92 | end 93 | 94 | noignore = params[:noignore] 95 | if noignore != nil 96 | UI.user_error!("'noignore' option requires Rome version '0.13.1.35' or later") if !meet_minimum_version(binary_path, "0.13.1.35") 97 | end 98 | 99 | cacheprefix = params[:cacheprefix] 100 | if cacheprefix != nil 101 | UI.user_error!("'cacheprefix' option requires Rome version '0.12.0.31' or later") if !meet_minimum_version(binary_path, "0.12.0.31") 102 | end 103 | 104 | noskipcurrent = params[:noskipcurrent] 105 | if noskipcurrent != nil 106 | UI.user_error!("'noskipcurrent' option requires Rome version '0.18.0.51' or later") if !meet_minimum_version(binary_path, "0.18.0.51") 107 | end 108 | 109 | concurrently = params[:concurrently] 110 | if concurrently != nil 111 | UI.user_error!("'concurrently' option requires Rome version '0.20.0.56' or later") if !meet_minimum_version(binary_path, "0.20.0.56") 112 | end 113 | 114 | usexcframeworks = params[:usexcframeworks] 115 | if usexcframeworks != nil 116 | UI.user_error!("'usexcframeworks' option requires Rome version '0.24.0.65' or later") if !meet_minimum_version(binary_path, "0.24.0.65") 117 | end 118 | 119 | platform = params[:platform] 120 | if usexcframeworks != nil && platform != nil 121 | UI.user_error!("'usexcframeworks' option cannot be combined with 'platform' option. Only one of them can be provided.") 122 | end 123 | 124 | if command_name == "list" && concurrently != nil 125 | UI.user_error!("Concurrently option is only avalable with download or upload. Listing is performed concurrently by default.") 126 | end 127 | end 128 | 129 | def self.available_commands 130 | %w(list download upload version help) 131 | end 132 | 133 | def self.available_platforms 134 | %w(all iOS Mac tvOS watchOS) 135 | end 136 | 137 | def self.available_print_formats 138 | %w(JSON Text) 139 | end 140 | 141 | def self.description 142 | "An S3 cache tool for Carthage" 143 | end 144 | 145 | def self.authors 146 | ["François Benaiteau", "Tommaso Piazza"] 147 | end 148 | 149 | def self.details 150 | "Rome is a tool that allows developers on Apple platforms to use Amazon's S3 and/or others as a shared cache for frameworks built with Carthage." 151 | end 152 | 153 | def self.available_options 154 | [ 155 | FastlaneCore::ConfigItem.new(key: :binary_path, 156 | env_name: "FL_ROME_BINARY_PATH", 157 | description: "Rome binary path, set to `Pods/Rome/rome` if you install Rome via CocoaPods", 158 | optional: true, 159 | default_value: `which rome`), 160 | 161 | FastlaneCore::ConfigItem.new(key: :command, 162 | env_name: "FL_ROME_COMMAND", 163 | description: "Rome command (one of: #{available_commands.join(', ')})", 164 | default_value: "help", 165 | verify_block: proc do |value| 166 | UI.user_error!("Please pass a valid command. Use one of the following: #{available_commands.join(', ')}") unless available_commands.include? value 167 | end), 168 | 169 | FastlaneCore::ConfigItem.new(key: :verbose, 170 | env_name: "FL_ROME_VERBOSE", 171 | description: "Print xcodebuild output inline", 172 | is_string: false, 173 | optional: true, 174 | verify_block: proc do |value| 175 | UI.user_error!("Please pass a valid value for verbose. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass) 176 | end), 177 | 178 | FastlaneCore::ConfigItem.new(key: :noignore, 179 | env_name: "FL_ROME_NOIGNORE", 180 | description: "Ignore the `ignoreMap` section of a Romefile", 181 | is_string: false, 182 | optional: true, 183 | verify_block: proc do |value| 184 | UI.user_error!("Please pass a valid value for noignore. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass) 185 | end), 186 | 187 | FastlaneCore::ConfigItem.new(key: :platform, 188 | env_name: "FL_ROME_PLATFORM", 189 | description: "Define which platform to build for", 190 | optional: true, 191 | verify_block: proc do |value| 192 | value.split(',').each do |platform| 193 | UI.user_error!("Please pass a valid platform. Use one of the following: #{available_platforms.join(', ')}") unless available_platforms.map(&:downcase).include?(platform.downcase) 194 | end 195 | end), 196 | 197 | FastlaneCore::ConfigItem.new(key: :missing, 198 | env_name: "FL_ROME_MISSING", 199 | description: "Option to list only missing frameworks", 200 | optional: true, 201 | is_string: false, 202 | verify_block: proc do |value| 203 | UI.user_error!("Please pass a valid value for missing. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass) 204 | end), 205 | 206 | FastlaneCore::ConfigItem.new(key: :present, 207 | env_name: "FL_ROME_PRESENT", 208 | description: "Option to list only present frameworks", 209 | optional: true, 210 | is_string: false, 211 | verify_block: proc do |value| 212 | UI.user_error!("Please pass a valid value for present. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass) 213 | end), 214 | 215 | FastlaneCore::ConfigItem.new(key: :frameworks, 216 | description: "Framework name or names to upload/download, could be applied only along with the 'upload' or 'download' commands", 217 | default_value: [], 218 | is_string: false, 219 | type: Array), 220 | 221 | FastlaneCore::ConfigItem.new(key: :cacheprefix, 222 | env_name: "FL_ROME_CACHE_PREFIX", 223 | description: "Allow a prefix for top level directories to be specified for all commands. Useful to store frameworks built with different Swift versions", 224 | optional: true, 225 | is_string: true), 226 | 227 | FastlaneCore::ConfigItem.new(key: :printformat, 228 | env_name: "FL_ROME_PRINT_FORMAT", 229 | description: "Specify what format to use in the output of the list command. One of 'JSON' or 'Text'. Defaults to 'Text' if omitted", 230 | optional: true, 231 | is_string: true), 232 | 233 | FastlaneCore::ConfigItem.new(key: :romefile, 234 | env_name: "FL_ROME_ROMEFILE", 235 | description: "The path to the Romefile to use. Defaults to the \"Romefile\" in the current directory", 236 | optional: true, 237 | is_string: true), 238 | 239 | FastlaneCore::ConfigItem.new(key: :noskipcurrent, 240 | env_name: "FL_ROME_NOSKIPCURRENT", 241 | description: "Use the `currentMap` section when performing the operation", 242 | is_string: false, 243 | optional: true, 244 | verify_block: proc do |value| 245 | UI.user_error!("Please pass a valid value for noskipcurrent. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass) 246 | end), 247 | 248 | FastlaneCore::ConfigItem.new(key: :concurrently, 249 | env_name: "FL_ROME_CONCURRENTLY", 250 | description: "Maximize concurrency while performing the operation. Not needed for listing", 251 | is_string: false, 252 | optional: true, 253 | verify_block: proc do |value| 254 | UI.user_error!("Please pass a valid value for concurrently. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass) 255 | end), 256 | 257 | FastlaneCore::ConfigItem.new(key: :usexcframeworks, 258 | env_name: "FL_ROME_USEXCFRAMEWORKS", 259 | description: "Search for .xcframeworks when performing the operation. Not needed for listing", 260 | is_string: false, 261 | optional: true, 262 | verify_block: proc do |value| 263 | UI.user_error!("Please pass a valid value for concurrently. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass) 264 | end) 265 | ] 266 | end 267 | 268 | def self.is_supported?(platform) 269 | # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example) 270 | # See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md 271 | # 272 | %i(ios mac).include?(platform) 273 | end 274 | end 275 | end 276 | end 277 | -------------------------------------------------------------------------------- /lib/fastlane/plugin/rome/helper/rome_helper.rb: -------------------------------------------------------------------------------- 1 | module Fastlane 2 | module Helper 3 | class RomeHelper 4 | # class methods that you define here become available in your action 5 | # as `Helper::RomeHelper.your_method` 6 | # 7 | def self.show_message 8 | UI.message("Hello from the rome plugin helper!") 9 | end 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/fastlane/plugin/rome/version.rb: -------------------------------------------------------------------------------- 1 | module Fastlane 2 | module Rome 3 | VERSION = "0.3.9" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/rome_action_spec.rb: -------------------------------------------------------------------------------- 1 | describe Fastlane::Actions::RomeAction do 2 | describe '#run' do 3 | it 'calls the rome binary at the expected path' do 4 | path_to_rome_binary = `which rome` 5 | result = Fastlane::FastFile.new.parse("lane :test do 6 | rome(command: 'version') 7 | end").runner.execute(:test) 8 | expect(result).to eq("#{path_to_rome_binary.chomp} --version") 9 | end 10 | 11 | it 'checks minimum version correctly' do 12 | expect(Fastlane::Actions::RomeAction.version_is_greater_or_equal("0.0.0.1", "")).to be true 13 | expect(Fastlane::Actions::RomeAction.version_is_greater_or_equal("0.0.0.0", "")).to be true 14 | expect(Fastlane::Actions::RomeAction.version_is_greater_or_equal("0", "1")).to be false 15 | expect(Fastlane::Actions::RomeAction.version_is_greater_or_equal("0.18.0.51", "0.13.1.15")).to be true 16 | expect(Fastlane::Actions::RomeAction.version_is_greater_or_equal("0.13.1.15", "0.18.0.51")).to be false 17 | expect(Fastlane::Actions::RomeAction.version_is_greater_or_equal("0.18.0.51", "0")).to be true 18 | expect(Fastlane::Actions::RomeAction.version_is_greater_or_equal("0.18.0.51", "0.18.1.51")).to be false 19 | expect(Fastlane::Actions::RomeAction.version_is_greater_or_equal("0.18.1.51", "0.18.0.51")).to be true 20 | expect(Fastlane::Actions::RomeAction.version_is_greater_or_equal("0.18.0.51", "0.18.1.0")).to be false 21 | expect(Fastlane::Actions::RomeAction.version_is_greater_or_equal("0.18.0.51", "0.19.0.49")).to be false 22 | expect(Fastlane::Actions::RomeAction.version_is_greater_or_equal("0.19.0.49", "0.18.0.51")).to be true 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) 2 | 3 | # This module is only used to check the environment is currently a testing env 4 | module SpecHelper 5 | end 6 | 7 | require 'fastlane' # to import the Action super class 8 | require 'fastlane/plugin/rome' # import the actual plugin 9 | 10 | Fastlane.load_actions # load other actions (in case your plugin calls other actions or shared values) 11 | --------------------------------------------------------------------------------