Skip to content

Commit b92425e

Browse files
Skip pod lint when targeting a branch for stream-chat-swift (#535)
* Skip pod lint when targeting a branch for stream-chat-swift Co-authored-by: Alexey Alter-Pesotskiy <[email protected]>
1 parent 8940a8c commit b92425e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

fastlane/Fastfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ derived_data_path = 'derived_data'
1515
source_packages_path = 'spm_cache'
1616
buildcache_xcargs = 'CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++'
1717
is_localhost = !is_ci
18+
project_package_resolved = "#{xcode_project}/project.xcworkspace/xcshareddata/swiftpm/Package.resolved"
1819
@force_check = false
1920

2021
before_all do |lane|
@@ -125,7 +126,18 @@ private_lane :appstore_api_key do
125126
end
126127

127128
lane :pod_lint do
128-
pod_lib_lint(podspec: 'StreamChatSwiftUI.podspec', allow_warnings: true)
129+
lint_required = true
130+
Dir.chdir('..') do
131+
sh("xcodebuild -resolvePackageDependencies -clonedSourcePackagesDirPath #{source_packages_path}")
132+
dependencies = JSON.parse(File.read(project_package_resolved))
133+
lint_required = dependencies['pins'].none? { |dependency| dependency['identity'] == 'stream-chat-swift' && dependency['state']['branch'] }
134+
end
135+
136+
if lint_required
137+
pod_lib_lint(podspec: 'StreamChatSwiftUI.podspec', allow_warnings: true)
138+
else
139+
UI.important('Pod linting skipped: stream-chat-swift targets a development branch')
140+
end
129141
end
130142

131143
desc "If `readonly: true` (by default), installs all Certs and Profiles necessary for development and ad-hoc.\nIf `readonly: false`, recreates all Profiles necessary for development and ad-hoc, updates them locally and remotely."

0 commit comments

Comments
 (0)