From aa237d93cb820e5dd467ae9a5add22308d4c5c9e Mon Sep 17 00:00:00 2001 From: Nikita Mikryukov <97m.nik@gmail.com> Date: Tue, 25 Mar 2025 15:36:55 +0300 Subject: [PATCH] added AdHoc type --- xcode/commonFastfile | 2 +- .../lib/touchlane/configuration_type.rb | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 9ebb1b3..220e45d 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -70,7 +70,7 @@ end private_lane :addShield do |options| buildNumber = options[:buildNumber] buildDescription = options[:lane_name] # EnterpriseCustomerDev1WithoutSSLPinningRelease - .split(/(?=[A-Z])/) # -> ["Enterprise", "Customer", "Dev1", "Without", "S", "S", "L", "Pinning", "Release"] + .split(/(?=[A-Z])/) # -> ["Enterprise", "Customer", "Dev1", "Without", "S", "S", "L", "Pinning", "Release", "Adhoc"] .map { |v| v.gsub(/[[:lower:]]+/, "") }[1..2] # -> ["E", "C", "D1", "W", "S", "S", "L", "P", "R"] -> ["C", "D1"] .join # -> "CD1" diff --git a/xcode/fastlane/touchlane/lib/touchlane/configuration_type.rb b/xcode/fastlane/touchlane/lib/touchlane/configuration_type.rb index d5e5a55..a49eac4 100644 --- a/xcode/fastlane/touchlane/lib/touchlane/configuration_type.rb +++ b/xcode/fastlane/touchlane/lib/touchlane/configuration_type.rb @@ -3,13 +3,15 @@ module Touchlane DEVELOPMENT = "development" ENTERPRISE = "enterprise" APP_STORE = "appstore" + ADHOC = "adhoc" DEVELOPMENT_PREFIX = "Standard" ENTERPRISE_PREFIX = "Enterprise" APP_STORE_PREFIX = "AppStore" + ADHOC_PREFIX = "AdHoc" - private_constant :DEVELOPMENT, :ENTERPRISE, :APP_STORE - private_constant :DEVELOPMENT_PREFIX, :ENTERPRISE_PREFIX, :APP_STORE_PREFIX + private_constant :DEVELOPMENT, :ENTERPRISE, :APP_STORE, :ADHOC + private_constant :DEVELOPMENT_PREFIX, :ENTERPRISE_PREFIX, :APP_STORE_PREFIX, :ADHOC def initialize(type) @type = type @@ -30,6 +32,10 @@ module Touchlane @export_method = "app-store" @configuration = "AppStore" @prefix = APP_STORE_PREFIX + when ADHOC + @export_method = type + @export_method = "ad-hoc" + @prefix = ADHOC_PREFIX else raise "Unknown type passed #{type}" end @@ -47,9 +53,11 @@ module Touchlane from_type(APP_STORE) when lane_name.start_with?(DEVELOPMENT_PREFIX) from_type(DEVELOPMENT) + when lane_name.start_with?(ADHOC_PREFIX) + from_type(ADHOC) else raise "Unable to map #{lane_name} to #{ConfigurationType.class}." - + "Available prefixes: #{DEVELOPMENT_PREFIX}, #{ENTERPRISE_PREFIX}, #{APP_STORE_PREFIX}" + + "Available prefixes: #{DEVELOPMENT_PREFIX}, #{ENTERPRISE_PREFIX}, #{APP_STORE_PREFIX}, #{ADHOC_PREFIX}" end end @@ -65,9 +73,11 @@ module Touchlane from_type(ENTERPRISE) when APP_STORE_PREFIX from_type(APP_STORE) + when ADHOC_PREFIX + from_type(ADHOC) else raise "Unable to map #{account_type} to #{ConfigurationType.class}." - + "Available account types: #{DEVELOPMENT_PREFIX}, #{ENTERPRISE_PREFIX}, #{APP_STORE_PREFIX}" + + "Available account types: #{DEVELOPMENT_PREFIX}, #{ENTERPRISE_PREFIX}, #{APP_STORE_PREFIX}, #{ADHOC_PREFIX}" end end