fastlane/lib/fastlane/actions/carthage.rb in fastlane_hotfix-2.165.1 vs fastlane/lib/fastlane/actions/carthage.rb in fastlane_hotfix-2.187.0

- old
+ new

@@ -31,10 +31,12 @@ cmd << "--toolchain #{params[:toolchain]}" if params[:toolchain] cmd << "--project-directory #{params[:project_directory]}" if params[:project_directory] cmd << "--cache-builds" if params[:cache_builds] cmd << "--new-resolver" if params[:new_resolver] cmd << "--log-path #{params[:log_path]}" if params[:log_path] + cmd << "--use-xcframeworks" if params[:use_xcframeworks] + cmd << "--archive" if params[:archive] Actions.sh(cmd.join(' ')) end # rubocop:enable Metrics/PerceivedComplexity @@ -48,10 +50,18 @@ end if params[:log_path] && !%w(build bootstrap update).include?(command_name) UI.user_error!("Log path option is available only for 'build', 'bootstrap', and 'update' command.") end + + if params[:use_xcframeworks] && !%w(build bootstrap update).include?(command_name) + UI.user_error!("Use XCFrameworks option is available only for 'build', 'bootstrap', and 'update' command.") + end + + if command_name != "build" && params[:archive] + UI.user_error!("Archive option is available only for 'build' command.") + end end def self.description "Runs `carthage` for your project" end @@ -74,62 +84,53 @@ UI.user_error!("Please pass a valid command. Use one of the following: #{available_commands.join(', ')}") unless available_commands.include?(value) end), FastlaneCore::ConfigItem.new(key: :dependencies, description: "Carthage dependencies to update, build or bootstrap", default_value: [], - is_string: false, type: Array), FastlaneCore::ConfigItem.new(key: :use_ssh, env_name: "FL_CARTHAGE_USE_SSH", description: "Use SSH for downloading GitHub repositories", - is_string: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :use_submodules, env_name: "FL_CARTHAGE_USE_SUBMODULES", description: "Add dependencies as Git submodules", - is_string: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :use_netrc, env_name: "FL_CARTHAGE_USE_NETRC", description: "Use .netrc for downloading frameworks", - is_string: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :use_binaries, env_name: "FL_CARTHAGE_USE_BINARIES", description: "Check out dependency repositories even when prebuilt frameworks exist", - is_string: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :no_checkout, env_name: "FL_CARTHAGE_NO_CHECKOUT", description: "When bootstrapping Carthage do not checkout", - is_string: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :no_build, env_name: "FL_CARTHAGE_NO_BUILD", description: "When bootstrapping Carthage do not build", - is_string: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :no_skip_current, env_name: "FL_CARTHAGE_NO_SKIP_CURRENT", description: "Don't skip building the Carthage project (in addition to its dependencies)", - is_string: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :derived_data, env_name: "FL_CARTHAGE_DERIVED_DATA", description: "Use derived data folder at path", optional: true), FastlaneCore::ConfigItem.new(key: :verbose, env_name: "FL_CARTHAGE_VERBOSE", description: "Print xcodebuild output inline", - is_string: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :platform, env_name: "FL_CARTHAGE_PLATFORM", description: "Define which platform to build for", @@ -140,20 +141,18 @@ end end), FastlaneCore::ConfigItem.new(key: :cache_builds, env_name: "FL_CARTHAGE_CACHE_BUILDS", description: "By default Carthage will rebuild a dependency regardless of whether it's the same resolved version as before. Passing the --cache-builds will cause carthage to avoid rebuilding a dependency if it can", - is_string: false, + type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :frameworks, description: "Framework name or names to archive, could be applied only along with the archive command", default_value: [], - is_string: false, type: Array), FastlaneCore::ConfigItem.new(key: :output, description: "Output name for the archive, could be applied only along with the archive command. Use following format *.framework.zip", - is_string: true, optional: true, verify_block: proc do |value| UI.user_error!("Please pass a valid string for output. Use following format *.framework.zip") unless value.end_with?("framework.zip") end), FastlaneCore::ConfigItem.new(key: :configuration, @@ -174,17 +173,26 @@ description: "Define the directory containing the Carthage project", optional: true), FastlaneCore::ConfigItem.new(key: :new_resolver, env_name: "FL_CARTHAGE_NEW_RESOLVER", description: "Use new resolver when resolving dependency graph", - is_string: false, optional: true, type: Boolean), FastlaneCore::ConfigItem.new(key: :log_path, env_name: "FL_CARTHAGE_LOG_PATH", description: "Path to the xcode build output", optional: true), + FastlaneCore::ConfigItem.new(key: :use_xcframeworks, + env_name: "FL_CARTHAGE_USE_XCFRAMEWORKS", + description: "Create xcframework bundles instead of one framework per platform (requires Xcode 12+)", + type: Boolean, + default_value: false), + FastlaneCore::ConfigItem.new(key: :archive, + env_name: "FL_CARTHAGE_ARCHIVE", + description: "Archive built frameworks from the current project", + type: Boolean, + default_value: false), FastlaneCore::ConfigItem.new(key: :executable, env_name: "FL_CARTHAGE_EXECUTABLE", description: "Path to the `carthage` executable on your machine", default_value: 'carthage') ] @@ -206,10 +214,10 @@ verbose: false, # Print xcodebuild output inline 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’) configuration: "Release", # Build configuration to use when building cache_builds: true, # By default Carthage will rebuild a dependency regardless of whether its the same resolved version as before. toolchain: "com.apple.dt.toolchain.Swift_2_3", # Specify the xcodebuild toolchain - new_resolver: false, # Use the new resolver to resolve depdendency graph + new_resolver: false, # Use the new resolver to resolve dependency graph log_path: "carthage.log" # Path to the xcode build output )' ] end