Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#include? "LoopFollowConfigOverride.xcconfig"
#include? "../../LoopFollowConfigOverride.xcconfig"
//#include? "LoopFollowConfigOverride.xcconfig"
//#include? "../../LoopFollowConfigOverride.xcconfig"
#include? "LoopFollowDisplayNameConfig.xcconfig"
#include? "../../LoopFollowDisplayNameConfig.xcconfig"

unique_id = ${DEVELOPMENT_TEAM}
//Bundle Identifier must be formatted like: com.$(DEVELOPMENT_TEAM).LoopFollow
//$(DEVELOPMENT_TEAM) will be replaced by the TEAMID repository secret during build phase.
BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow
//BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow.Second
//BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).LoopFollow.Third

//Version (DEFAULT)
LOOP_FOLLOW_MARKETING_VERSION = 4.4.3
4 changes: 2 additions & 2 deletions LoopFollow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2400,7 +2400,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.$(unique_id).LoopFollow$(app_suffix)";
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER)";
PRODUCT_NAME = "Loop Follow";
SUPPORTS_MACCATALYST = YES;
SWIFT_VERSION = 5.0;
Expand All @@ -2423,7 +2423,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.$(unique_id).LoopFollow$(app_suffix)";
PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER)";
PRODUCT_NAME = "Loop Follow";
SUPPORTS_MACCATALYST = YES;
SWIFT_VERSION = 5.0;
Expand Down
2 changes: 1 addition & 1 deletion LoopFollow/Helpers/AppConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation

// Class that contains general constants used in different classes
class AppConstants {
static let APP_GROUP_ID = "group.com.$(unique_id).LoopFollow"
static let APP_GROUP_ID = "group.$(BUNDLE_IDENTIFIER)"

/// Extracts the app suffix from the bundle identifier
/// Bundle identifier format: com.$(unique_id).LoopFollow$(app_suffix)
Expand Down
6 changes: 3 additions & 3 deletions LoopFollow/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<plist version="1.0">
<dict>
<key>AppGroupIdentifier</key>
<string>group.com.$(unique_id).LoopFollow$(app_suffix)</string>
<string>group.$(BUNDLE_IDENTIFIER)</string>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.$(unique_id).LoopFollow$(app_suffix)</string>
<string>$(BUNDLE_IDENTIFIER)</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
Expand All @@ -17,7 +17,7 @@
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.$(unique_id).LoopFollow$(app_suffix)</string>
<string>$(BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
47 changes: 38 additions & 9 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,37 @@ DEVICE_NAME = ENV["DEVICE_NAME"]
DEVICE_ID = ENV["DEVICE_ID"]
ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120"

# Define method to parse xcconfig file, and replace $(DEVELOPMENT_TEAM) with ENV["TEAMID"]
def parse_xcconfig_file(path)
xcconfig = {}
File.open(path).each_line do |line|
line.strip!
next if line.empty? || line.start_with?('//')
parts = line.split('=')
next if parts.length < 2 # Skip lines without '='
key, value = parts.map(&:strip)
# Replace $(DEVELOPMENT_TEAM) with ENV["TEAMID"]
value = value.gsub('$(DEVELOPMENT_TEAM)', TEAMID)
xcconfig[key] = value
end
xcconfig
end

# Path to config.xcconfig file
xcconfig_path = "#{GITHUB_WORKSPACE}/Config.xcconfig"

# Load the variables from config.xcconfig
xcconfig = parse_xcconfig_file(xcconfig_path)

# Access BUNDLE_IDENTIFIER from the xcconfig file after replacing $(DEVELOPMENT_TEAM) with ENV["TEAMID"]
ENV["BUNDLE_ID"] = xcconfig["BUNDLE_IDENTIFIER"]

platform :ios do
desc "Build Loop Follow"
lane :build_LoopFollow do
setup_ci if ENV['CI']

BUNDLE_ID = ENV["BUNDLE_ID"]

update_project_team(
path: "#{GITHUB_WORKSPACE}/LoopFollow.xcodeproj",
teamid: "#{TEAMID}"
Expand All @@ -40,7 +66,7 @@ platform :ios do
)

previous_build_number = latest_testflight_build_number(
app_identifier: "com.#{TEAMID}.LoopFollow",
app_identifier: "#{BUNDLE_ID}",
api_key: api_key,
)

Expand All @@ -55,7 +81,7 @@ platform :ios do
type: "appstore",
git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"),
app_identifier: [
"com.#{TEAMID}.LoopFollow"
"#{BUNDLE_ID}"
]
)

Expand All @@ -65,7 +91,7 @@ platform :ios do

update_code_signing_settings(
path: "#{GITHUB_WORKSPACE}/LoopFollow.xcodeproj",
profile_name: mapping["com.#{TEAMID}.LoopFollow"],
profile_name: mapping["#{BUNDLE_ID}"],
code_sign_identity: "iPhone Distribution",
targets: ["LoopFollow"]
)
Expand Down Expand Up @@ -105,7 +131,8 @@ platform :ios do
lane :identifiers do
setup_ci if ENV['CI']
ENV["MATCH_READONLY"] = false.to_s

BUNDLE_ID = ENV["BUNDLE_ID"]

app_store_connect_api_key(
key_id: "#{FASTLANE_KEY_ID}",
issuer_id: "#{FASTLANE_ISSUER_ID}",
Expand All @@ -124,7 +151,7 @@ platform :ios do
end
end

configure_bundle_id("LoopFollow", "com.#{TEAMID}.LoopFollow", [
configure_bundle_id("LoopFollow", "#{BUNDLE_ID}", [
Spaceship::ConnectAPI::BundleIdCapability::Type::PUSH_NOTIFICATIONS
])

Expand All @@ -134,7 +161,8 @@ platform :ios do
lane :certs do
setup_ci if ENV['CI']
ENV["MATCH_READONLY"] = false.to_s

BUNDLE_ID = ENV["BUNDLE_ID"]

app_store_connect_api_key(
key_id: "#{FASTLANE_KEY_ID}",
issuer_id: "#{FASTLANE_ISSUER_ID}",
Expand All @@ -147,7 +175,7 @@ platform :ios do
verbose: true,
git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"),
app_identifier: [
"com.#{TEAMID}.LoopFollow",
"#{BUNDLE_ID}",
]
)
end
Expand All @@ -156,6 +184,7 @@ platform :ios do
lane :validate_secrets do
setup_ci if ENV['CI']
ENV["MATCH_READONLY"] = true.to_s
BUNDLE_ID = ENV["BUNDLE_ID"]

app_store_connect_api_key(
key_id: "#{FASTLANE_KEY_ID}",
Expand All @@ -167,7 +196,7 @@ platform :ios do
bundle_id = Spaceship::ConnectAPI::BundleId.find(identifier)
end

find_bundle_id("com.#{TEAMID}.loopkit.LoopFollow")
find_bundle_id("#{BUNDLE_ID}")

match(
type: "appstore",
Expand Down