mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Merge pull request #3509 from vector-im/fix-ci
[Internal] [CI] Fix switcheroo logic
This commit is contained in:
commit
1ff5de918b
1 changed files with 8 additions and 3 deletions
|
@ -317,19 +317,24 @@ platform :ios do
|
||||||
kit_branch = find_branch(kit_slug, branch_pattern) || 'develop'
|
kit_branch = find_branch(kit_slug, branch_pattern) || 'develop'
|
||||||
sdk_branch = find_branch(sdk_slug, branch_pattern) || 'develop'
|
sdk_branch = find_branch(sdk_slug, branch_pattern) || 'develop'
|
||||||
|
|
||||||
|
kit_spec = { git: 'https://github.com/matrix-org/matrix-ios-kit.git', branch: kit_branch }
|
||||||
|
kit_podspec = { podspec: 'MatrixKit.edited.podspec' }
|
||||||
|
sdk_spec = { git: 'https://github.com/matrix-org/matrix-ios-sdk.git', branch: sdk_branch }
|
||||||
|
|
||||||
UI.message("✏️ Making a local copy of MatrixKit.podspec from the \`#{kit_branch}\` branch...")
|
UI.message("✏️ Making a local copy of MatrixKit.podspec from the \`#{kit_branch}\` branch...")
|
||||||
podspec_content = Net::HTTP.get(URI("https://raw.githubusercontent.com/#{kit_slug}/#{kit_branch}/MatrixKit.podspec"))
|
podspec_content = Net::HTTP.get(URI("https://raw.githubusercontent.com/#{kit_slug}/#{kit_branch}/MatrixKit.podspec"))
|
||||||
|
|
||||||
UI.message "✏️ Editing local MatrixKit podspec to remove version constaint on 'MatrixSDK*' dependencies..."
|
UI.message "✏️ Editing local MatrixKit podspec to remove version constaint on 'MatrixSDK*' dependencies..."
|
||||||
podspec_content.gsub!(%r{(\.dependency\s+(['"])MatrixSDK(\/[^'"]+)?\2).*$}, '\1')
|
podspec_content.gsub!(%r{(\.dependency\s+(['"])MatrixSDK(\/[^'"]+)?\2).*$}, '\1')
|
||||||
|
podspec_content.gsub!(%r{(\.source\s*=\s*).*$}, "\\1#{kit_spec}")
|
||||||
File.write('../MatrixKit.edited.podspec', podspec_content) # current dir is 'fastlane/' hence the '../'
|
File.write('../MatrixKit.edited.podspec', podspec_content) # current dir is 'fastlane/' hence the '../'
|
||||||
|
UI.command_output("Content of MatrixKit.edited.podspec:\n" + podspec_content)
|
||||||
|
|
||||||
UI.message "✏️ Modify Podfile to point MatrixKit to local podspec and `MatrixSDK/*` to \`#{sdk_branch}\` branch..."
|
UI.message "✏️ Modify Podfile to point MatrixKit to local podspec and `MatrixSDK/*` to \`#{sdk_branch}\` branch..."
|
||||||
podfile_content = File.read('../Podfile') # current dir is 'fastlane/' hence the '../'
|
podfile_content = File.read('../Podfile') # current dir is 'fastlane/' hence the '../'
|
||||||
kit_spec = { podspec: 'MatrixKit.edited.podspec' }
|
podfile_content.gsub!(%r{^\$matrixKitVersion\s*=\s*.*$}, "$matrixKitVersion = { #{kit_podspec} => #{sdk_spec} }")
|
||||||
sdk_spec = { git: 'https://github.com/matrix-org/matrix-ios-sdk.git', branch: sdk_branch }
|
|
||||||
podfile_content.gsub!(%r{^\$matrixKitVersion\s*=\s*.*$}, "$matrixKitVersion = { #{kit_spec} => #{sdk_spec} }")
|
|
||||||
File.write('../Podfile', podfile_content)
|
File.write('../Podfile', podfile_content)
|
||||||
|
UI.command_output("Content of modified Podfile:\n" + podfile_content)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Find the latest branch with the given name pattern in the given repo
|
# Find the latest branch with the given name pattern in the given repo
|
||||||
|
|
Loading…
Reference in a new issue