Skip to content

Commit

Permalink
Make the matrix-ios-sdk a submodule and use it as a local pod inste…
Browse files Browse the repository at this point in the history
…ad of a published one.
  • Loading branch information
stefanceriu committed Jun 10, 2024
1 parent f38a422 commit 857b806
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 88 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Use right MatrixSDK versions
run: bundle exec fastlane point_dependencies_to_related_branches
# Main step
- name: Build iOS simulator
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ jobs:
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Use right MatrixSDK versions
run: bundle exec fastlane point_dependencies_to_related_branches
# Main step
- name: Unit tests
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ci-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Use right MatrixSDK versions
run: bundle exec fastlane point_dependencies_to_related_branches
# Main step
- name: UI tests
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ jobs:
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Use right MatrixSDK versions
run: bundle exec fastlane point_dependencies_to_related_branches
# Import alpha release private signing certificate
- name: Import signing certificate
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "matrix-ios-sdk"]
path = matrix-ios-sdk
url = [email protected]:matrix-org/matrix-ios-sdk.git
38 changes: 2 additions & 36 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,10 @@ inhibit_all_warnings!
# Use frameworks to allow usage of pods written in Swift
use_frameworks!

# Different flavours of pods to MatrixSDK. Can be one of:
# - a String indicating an official MatrixSDK released version number
# - `:local` (to use Development Pods)
# - `{ :branch => 'sdk branch name'}` to depend on specific branch of MatrixSDK repo
# - `{ :specHash => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for MatrixSDK repo. Used by Fastfile during CI
#
# Warning: our internal tooling depends on the name of this variable name, so be sure not to change it
$matrixSDKVersion = '= 0.27.8'
# $matrixSDKVersion = :local
# $matrixSDKVersion = { :branch => 'develop'}
# $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } }

########################################

case $matrixSDKVersion
when :local
$matrixSDKVersionSpec = { :path => '../matrix-ios-sdk/MatrixSDK.podspec' }
when Hash
spec_mode, sdk_spec = $matrixSDKVersion.first # extract first and only key/value pair; key is spec_mode, value is sdk_spec

case spec_mode
when :branch
# :branch => sdk branch name
sdk_spec = { :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => sdk_spec.to_s } unless sdk_spec.is_a?(Hash)
when :specHash
# :specHash => {sdk spec Hash}
sdk_spec = sdk_spec
end

$matrixSDKVersionSpec = sdk_spec
when String # specific MatrixSDK released version
$matrixSDKVersionSpec = $matrixSDKVersion
end

# Method to import the MatrixSDK
def import_MatrixSDK
pod 'MatrixSDK', $matrixSDKVersionSpec, :inhibit_warnings => false
pod 'MatrixSDK/JingleCallStack', $matrixSDKVersionSpec, :inhibit_warnings => false
pod 'MatrixSDK', :path => 'matrix-ios-sdk/MatrixSDK.podspec', :inhibit_warnings => false
pod 'MatrixSDK/JingleCallStack', :path => 'matrix-ios-sdk/MatrixSDK.podspec', :inhibit_warnings => false
end

########################################
Expand Down
11 changes: 7 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ DEPENDENCIES:
- KeychainAccess (~> 4.2.2)
- KTCenterFlowLayout (~> 1.3.1)
- libPhoneNumber-iOS (~> 0.9.13)
- MatrixSDK (= 0.27.8)
- MatrixSDK/JingleCallStack (= 0.27.8)
- MatrixSDK (from `matrix-ios-sdk/MatrixSDK.podspec`)
- MatrixSDK/JingleCallStack (from `matrix-ios-sdk/MatrixSDK.podspec`)
- OLMKit
- ReadMoreTextView (~> 3.0.1)
- Reusable (~> 4.1)
Expand Down Expand Up @@ -142,7 +142,6 @@ SPEC REPOS:
- libPhoneNumber-iOS
- LoggerAPI
- Logging
- MatrixSDK
- MatrixSDKCrypto
- OLMKit
- ReadMoreTextView
Expand All @@ -162,6 +161,10 @@ SPEC REPOS:
- zxcvbn-ios
- ZXingObjC

EXTERNAL SOURCES:
MatrixSDK:
:path: matrix-ios-sdk/MatrixSDK.podspec

SPEC CHECKSUMS:
AFNetworking: 3bd23d814e976cd148d7d44c3ab78017b744cd58
BlueCryptor: b0aee3d9b8f367b49b30de11cda90e1735571c24
Expand Down Expand Up @@ -204,6 +207,6 @@ SPEC CHECKSUMS:
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5

PODFILE CHECKSUM: 3bbda8faf037705f421dad839d6f5b1aef399f99
PODFILE CHECKSUM: b622ffadc1a0fe5442787bd9023ca3d110384814

COCOAPODS: 1.15.2
40 changes: 0 additions & 40 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,6 @@ platform :ios do
end


desc "Point MatrixSDK to the related branches if such ones exist"
lane :point_dependencies_to_related_branches do
current_branch = mx_git_branch
UI.message("Current branch: #{current_branch}")
if current_branch.start_with?("release/")
point_dependencies_to_pending_releases
else
point_dependencies_to_same_feature
end
end

desc "Point MatrixSDK to release/*/release branch if it exists, master otherwise"
lane :point_dependencies_to_pending_releases do
edit_podfile(branch_pattern: "release/*/release", default_branch: "master")
end

desc "Point MatrixSDK to the branch with the same name as the current branch if such one exist, develop otherwise"
lane :point_dependencies_to_same_feature do
edit_podfile(branch_pattern: mx_git_branch) unless mx_git_branch.to_s.empty?
end

desc "Use an app variant. An app variant overwrite default project configuration or ressource files with custom values"
lane :setup_app_variant do |options|
appVariantScript = "../Variants/setup_app_variant.sh"
Expand Down Expand Up @@ -473,25 +452,6 @@ platform :ios do
preprocessor_definitions
end

desc "Edit the Podfile in order to point MatrixSDK to the appropriate branches."
private_lane :edit_podfile do |options|
require 'net/http'

branch_pattern = options[:branch_pattern]
sdk_slug = "matrix-org/matrix-ios-sdk"

default_branch = options[:default_branch] || 'develop'
sdk_branch = find_branch(sdk_slug, branch_pattern) || default_branch

sdk_spec = { git: 'https://github.com/matrix-org/matrix-ios-sdk.git', branch: sdk_branch }

UI.message "✏️ Modify Podfile to point `MatrixSDK/*` to \`#{sdk_branch}\` branch..."
podfile_content = File.read('../Podfile') # current dir is 'fastlane/' hence the '../'
podfile_content.gsub!(%r{^\$matrixSDKVersion\s*=\s*.*$}, "$matrixSDKVersion = { :specHash => #{sdk_spec} }")
File.write('../Podfile', podfile_content)
UI.command_output("Content of modified Podfile:\n" + podfile_content)
end

desc "Upload dsym files to Sentry to symbolicate crashes"
private_lane :upload_dsyms_to_sentry do
UI.user_error!("'SENTRY_AUTH_TOKEN' environment variable should be set to use this lane") unless !ENV["SENTRY_AUTH_TOKEN"].to_s.empty?
Expand Down
1 change: 1 addition & 0 deletions matrix-ios-sdk
Submodule matrix-ios-sdk added at f03778

0 comments on commit 857b806

Please sign in to comment.