diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index c105f7ebf..f170a1fd1 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -23,12 +23,12 @@ body: - type: textarea id: result attributes: - label: What happened? + label: Outcome placeholder: Tell us what went wrong value: | - ### What did you expect? + #### What did you expect? - ### What happened? + #### What happened instead? validations: required: true - type: input diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index c86de1d80..24e8ab2e6 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -4,7 +4,6 @@ on: # Triggers the workflow on any pull request and push to develop push: branches: [ develop ] - pull_request: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -17,6 +16,8 @@ jobs: build: name: Build runs-on: macos-11 + + # Concurrency group not needed as this workflow only runs on develop which we always want to test. steps: - uses: actions/checkout@v2 @@ -36,9 +37,9 @@ jobs: restore-keys: | ${{ runner.os }}-gems- - # Make sure we use the latest version of MatrixKit - - name: Reset MatrixKit pod - run: rm -rf Pods/MatrixKit + # Make sure we use the latest version of MatrixSDK + - name: Reset MatrixSDK pod + run: rm -rf Pods/MatrixSDK # Common setup # Note: GH actions do not support yaml anchor yet. We need to duplicate this for every job @@ -46,7 +47,7 @@ jobs: run: | bundle config path vendor/bundle bundle install --jobs 4 --retry 3 - - name: Use right MatrixKit and MatrixSDK versions + - name: Use right MatrixSDK versions run: bundle exec fastlane point_dependencies_to_related_branches # Main step diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 65846be15..00d4fa2f9 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -17,6 +17,12 @@ jobs: tests: name: Tests runs-on: macos-11 + + concurrency: + # When running on develop, use the sha to allow all runs of this workflow to run concurrently. + # Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs. + group: ${{ github.ref == 'refs/heads/develop' && format('tests-develop-{0}', github.sha) || format('tests-{0}', github.ref) }} + cancel-in-progress: true steps: - uses: actions/checkout@v2 @@ -36,9 +42,9 @@ jobs: restore-keys: | ${{ runner.os }}-gems- - # Make sure we use the latest version of MatrixKit - - name: Reset MatrixKit pod - run: rm -rf Pods/MatrixKit + # Make sure we use the latest version of MatrixSDK + - name: Reset MatrixSDK pod + run: rm -rf Pods/MatrixSDK # Common setup # Note: GH actions do not support yaml anchor yet. We need to duplicate this for every job @@ -46,7 +52,7 @@ jobs: run: | bundle config path vendor/bundle bundle install --jobs 4 --retry 3 - - name: Use right MatrixKit and MatrixSDK versions + - name: Use right MatrixSDK versions run: bundle exec fastlane point_dependencies_to_related_branches # Main step diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index ed175fe20..dfbd7ac6a 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -16,6 +16,11 @@ jobs: build: name: Release runs-on: macos-11 + + concurrency: + # Only allow a single run of this workflow on each branch, automatically cancelling older runs. + group: alpha-${{ github.head_ref }} + cancel-in-progress: true steps: - uses: actions/checkout@v2 @@ -38,9 +43,9 @@ jobs: restore-keys: | ${{ runner.os }}-gems- - # Make sure we use the latest version of MatrixKit - - name: Reset MatrixKit pod - run: rm -rf Pods/MatrixKit + # Make sure we use the latest version of MatrixSDK + - name: Reset MatrixSDK pod + run: rm -rf Pods/MatrixSDK # Common setup # Note: GH actions do not support yaml anchor yet. We need to duplicate this for every job @@ -49,7 +54,7 @@ jobs: bundle config path vendor/bundle bundle install --jobs 4 --retry 3 - - name: Use right MatrixKit and MatrixSDK versions + - name: Use right MatrixSDK versions run: bundle exec fastlane point_dependencies_to_related_branches # Import alpha release private signing certificate diff --git a/.github/workflows/triage-incoming.yml b/.github/workflows/triage-incoming.yml index 40d550741..4ecc82442 100644 --- a/.github/workflows/triage-incoming.yml +++ b/.github/workflows/triage-incoming.yml @@ -8,7 +8,7 @@ jobs: automate-project-columns: runs-on: ubuntu-latest steps: - - uses: alex-page/github-project-automation-plus@v0.8.1 + - uses: alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488 with: project: Issue triage column: Incoming diff --git a/.github/workflows/triage-move-labelled.yml b/.github/workflows/triage-move-labelled.yml new file mode 100644 index 000000000..e82c227de --- /dev/null +++ b/.github/workflows/triage-move-labelled.yml @@ -0,0 +1,134 @@ +name: Move labelled issues to correct boards and columns + +on: + issues: + types: [labeled] + +jobs: + move_needs_info_issues: + name: X-Needs-Info issues to Need info column on triage board + runs-on: ubuntu-latest + steps: + - uses: konradpabjan/move-labeled-or-milestoned-issue@219d384e03fa4b6460cd24f9f37d19eb033a4338 + with: + action-token: "${{ secrets.ELEMENT_BOT_TOKEN }}" + project-url: "https://github.com/vector-im/element-ios/projects/12" + column-name: "Need info" + label-name: "X-Needs-Info" + + add_priority_design_issues_to_project: + name: P1 X-Needs-Design to Design project board + runs-on: ubuntu-latest + if: > + contains(github.event.issue.labels.*.name, 'X-Needs-Design') && + (contains(github.event.issue.labels.*.name, 'S-Critical') && + (contains(github.event.issue.labels.*.name, 'O-Frequent') || + contains(github.event.issue.labels.*.name, 'O-Occasional')) || + contains(github.event.issue.labels.*.name, 'S-Major') && + contains(github.event.issue.labels.*.name, 'O-Frequent') || + contains(github.event.issue.labels.*.name, 'A11y') && + contains(github.event.issue.labels.*.name, 'O-Frequent')) + steps: + - uses: octokit/graphql-action@v2.x + id: add_to_project + with: + headers: '{"GraphQL-Features": "projects_next_graphql"}' + query: | + mutation add_to_project($projectid:String!,$contentid:String!) { + addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) { + projectNextItem { + id + } + } + } + projectid: ${{ env.PROJECT_ID }} + contentid: ${{ github.event.issue.node_id }} + env: + PROJECT_ID: "PN_kwDOAM0swc0sUA" + GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} + + spaces_issues_to_old_board: + name: Spaces issues to old Delight project board + runs-on: ubuntu-latest + if: > + contains(github.event.issue.labels.*.name, 'A-Spaces') || + contains(github.event.issue.labels.*.name, 'A-Space-Settings') || + contains(github.event.issue.labels.*.name, 'A-Subspaces') + steps: + - uses: konradpabjan/move-labeled-or-milestoned-issue@219d384e03fa4b6460cd24f9f37d19eb033a4338 + with: + action-token: "${{ secrets.ELEMENT_BOT_TOKEN }}" + project-url: "https://github.com/orgs/vector-im/projects/6" + column-name: "📥 Inbox" + label-name: "A-Spaces" + + spaces_issues_to_new_board: + name: Spaces issues to new Delight project board + runs-on: ubuntu-latest + if: > + contains(github.event.issue.labels.*.name, 'A-Spaces') || + contains(github.event.issue.labels.*.name, 'A-Space-Settings') || + contains(github.event.issue.labels.*.name, 'A-Subspaces') + steps: + - uses: octokit/graphql-action@v2.x + with: + headers: '{"GraphQL-Features": "projects_next_graphql"}' + query: | + mutation add_to_project($projectid:String!,$contentid:String!) { + addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) { + projectNextItem { + id + } + } + } + projectid: ${{ env.PROJECT_ID }} + contentid: ${{ github.event.issue.node_id }} + env: + PROJECT_ID: "PN_kwDOAM0swc1HvQ" + GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} + + move_voice-message_issues: + name: A-Voice Messages to voice message board + runs-on: ubuntu-latest + if: > + contains(github.event.issue.labels.*.name, 'A-Voice Messages') + steps: + - uses: octokit/graphql-action@v2.x + with: + headers: '{"GraphQL-Features": "projects_next_graphql"}' + query: | + mutation add_to_project($projectid:String!,$contentid:String!) { + addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) { + projectNextItem { + id + } + } + } + projectid: ${{ env.PROJECT_ID }} + contentid: ${{ github.event.issue.node_id }} + env: + PROJECT_ID: "PN_kwDOAM0swc2KCw" + GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} + + move_threads_issues: + name: A-Threads to Thread board + runs-on: ubuntu-latest + if: > + contains(github.event.issue.labels.*.name, 'A-Threads') + steps: + - uses: octokit/graphql-action@v2.x + with: + headers: '{"GraphQL-Features": "projects_next_graphql"}' + query: | + mutation add_to_project($projectid:String!,$contentid:String!) { + addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) { + projectNextItem { + id + } + } + } + projectid: ${{ env.PROJECT_ID }} + contentid: ${{ github.event.issue.node_id }} + env: + PROJECT_ID: "PN_kwDOAM0swc0rRA" + GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/.github/workflows/triage-move-unlabelled.yml b/.github/workflows/triage-move-unlabelled.yml new file mode 100644 index 000000000..94bd049b9 --- /dev/null +++ b/.github/workflows/triage-move-unlabelled.yml @@ -0,0 +1,35 @@ +name: Move unlabelled from needs info columns to triaged + +on: + issues: + types: [unlabeled] + +jobs: + Move_Unabeled_Issue_On_Project_Board: + name: Move no longer X-Needs-Info issues to Triaged + runs-on: ubuntu-latest + if: > + ${{ + !contains(github.event.issue.labels.*.name, 'X-Needs-Info') }} + env: + BOARD_NAME: "Issue triage" + OWNER: ${{ github.repository_owner }} + REPO: ${{ github.event.repository.name }} + ISSUE: ${{ github.event.issue.number }} + steps: + - name: Check if issue is already in "${{ env.BOARD_NAME }}" + run: | + if curl -i -H 'Content-Type: application/json' -H "Authorization: bearer ${{ secrets.GITHUB_TOKEN }}" -X POST -d '{"query": "query($issue: Int!, $owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { issue(number: $issue) { projectCards { nodes { project { name } } } } } } ", "variables" : "{ \"issue\": '${ISSUE}', \"owner\": \"'${OWNER}'\", \"repo\": \"'${REPO}'\" }" }' https://api.github.com/graphql | grep "\b$BOARD_NAME\b"; then + echo "Issue is already in Project '$BOARD_NAME', proceeding"; + echo "ALREADY_IN_BOARD=true" >> $GITHUB_ENV + else + echo "Issue is not in project '$BOARD_NAME', cancelling this workflow" + echo "ALREADY_IN_BOARD=false" >> $GITHUB_ENV + fi + - name: Move issue + uses: alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488 + if: ${{ env.ALREADY_IN_BOARD == 'true' }} + with: + project: Issue triage + column: Triaged + repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/.github/workflows/triage-needs-info.yml b/.github/workflows/triage-needs-info.yml deleted file mode 100644 index 4a4a6a7c0..000000000 --- a/.github/workflows/triage-needs-info.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Move X-Needs-Info into Need info column in the Issue triage board - -on: - issues: - types: [labeled] - -jobs: - Move_Labeled_Issue_On_Project_Board: - runs-on: ubuntu-latest - steps: - - uses: konradpabjan/move-labeled-or-milestoned-issue@v2.0 - with: - action-token: ${{ secrets.GITHUB_TOKEN }} - project-url: "https://github.com/vector-im/element-ios/projects/12" - column-name: "Need info" - label-name: "X-Needs-Info" diff --git a/.github/workflows/triage-priority-bugs.yml b/.github/workflows/triage-priority-bugs.yml new file mode 100644 index 000000000..0a4d1c49f --- /dev/null +++ b/.github/workflows/triage-priority-bugs.yml @@ -0,0 +1,55 @@ +name: Move P1 bugs to boards + +on: + issues: + types: [labeled, unlabeled] + +jobs: + p1_issues_to_team_workboard: + runs-on: ubuntu-latest + if: > + (!contains(github.event.issue.labels.*.name, 'A-E2EE') && + !contains(github.event.issue.labels.*.name, 'A-E2EE-Cross-Signing') && + !contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') && + !contains(github.event.issue.labels.*.name, 'A-E2EE-Key-Backup') && + !contains(github.event.issue.labels.*.name, 'A-E2EE-SAS-Verification') && + !contains(github.event.issue.labels.*.name, 'A-Spaces') && + !contains(github.event.issue.labels.*.name, 'A-Spaces-Settings') && + !contains(github.event.issue.labels.*.name, 'A-Subspaces')) && + (contains(github.event.issue.labels.*.name, 'T-Defect') && + contains(github.event.issue.labels.*.name, 'S-Critical') && + (contains(github.event.issue.labels.*.name, 'O-Frequent') || + contains(github.event.issue.labels.*.name, 'O-Occasional')) || + contains(github.event.issue.labels.*.name, 'S-Major') && + contains(github.event.issue.labels.*.name, 'O-Frequent') || + contains(github.event.issue.labels.*.name, 'A11y') && + contains(github.event.issue.labels.*.name, 'O-Frequent')) + steps: + - uses: alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488 + with: + project: iOS App Team + column: P1 + repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }} + + P1_issues_to_crypto_team_workboard: + runs-on: ubuntu-latest + if: > + (contains(github.event.issue.labels.*.name, 'A-E2EE') || + contains(github.event.issue.labels.*.name, 'A-E2EE-Cross-Signing') || + contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') || + contains(github.event.issue.labels.*.name, 'A-E2EE-Key-Backup') || + contains(github.event.issue.labels.*.name, 'A-E2EE-SAS-Verification')) && + (contains(github.event.issue.labels.*.name, 'T-Defect') && + contains(github.event.issue.labels.*.name, 'S-Critical') && + (contains(github.event.issue.labels.*.name, 'O-Frequent') || + contains(github.event.issue.labels.*.name, 'O-Occasional')) || + contains(github.event.issue.labels.*.name, 'S-Major') && + contains(github.event.issue.labels.*.name, 'O-Frequent') || + contains(github.event.issue.labels.*.name, 'A11y') && + contains(github.event.issue.labels.*.name, 'O-Frequent')) + steps: + - uses: alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488 + with: + project: Crypto Team + column: Ready + repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/CHANGES.md b/CHANGES.md index 53518bf12..813f8f297 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,40 @@ +## Changes in 1.6.9 (2021-12-07) + +✨ Features + +- Allow audio file attachments to be played back inline by reusing the existing voice message UI. Prevent unnecessary conversions if final file already exists on disk. ([#4753](https://github.com/vector-im/element-ios/issues/4753)) +- SpaceExploreRoomViewModel: Support pagination in the Space Summary API ([#4893](https://github.com/vector-im/element-ios/issues/4893)) +- Adds clientPermalinkBaseUrl for a custom permalink base url. ([#4981](https://github.com/vector-im/element-ios/issues/4981)) +- Remember keyboard layout per room and restore it when opening the room again. ([#5067](https://github.com/vector-im/element-ios/issues/5067)) + +🙌 Improvements + +- Upgrade MatrixSDK version ([v0.20.13](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.20.13)). +- Forward original message content and remove the need to re-upload media. ([#5014](https://github.com/vector-im/element-ios/issues/5014)) +- Use DTCoreText's callback option to sanitise formatted messages ([#5165](https://github.com/vector-im/element-ios/issues/5165)) + +🐛 Bugfixes + +- Remove duplicate sources for some strings files in Riot/target.yml. ([#3908](https://github.com/vector-im/element-ios/issues/3908)) +- Invalid default value set for clientPermalinkBaseUrl. ([#5098](https://github.com/vector-im/element-ios/issues/5098)) +- Ignore badge updates from virtual rooms. ([#5155](https://github.com/vector-im/element-ios/issues/5155)) +- Fix rooms that should be hidden(such as virtual rooms) from showing. ([#5185](https://github.com/vector-im/element-ios/issues/5185)) +- Improve generated Swift header imports. ([#5194](https://github.com/vector-im/element-ios/issues/5194)) +- Fix bug where VoIP calls would not connect reliably after signout/signin. ([#5199](https://github.com/vector-im/element-ios/issues/5199)) + +🧱 Build + +- Only run Build CI on develop, as it is already covered by Tests and Alpha. ([#5112](https://github.com/vector-im/element-ios/pull/5112)) +- Add concurrency to the GitHub workflows to auto-cancel older runs of each action for PRs. ([#5039](https://github.com/vector-im/element-ios/issues/5039)) + +Others + +- Improve the Obj-C Generated Interface Header Name definition ([#4722](https://github.com/vector-im/element-ios/issues/4722)) +- Fix redundancy in heading in the bug report issue form ([#4984](https://github.com/vector-im/element-ios/issues/4984)) +- Update automation for issue triage ([#5153](https://github.com/vector-im/element-ios/issues/5153)) +- Improve issue automation workflows ([#5235](https://github.com/vector-im/element-ios/issues/5235)) + + ## Changes in 1.6.8 (2021-11-17) 🙌 Improvements diff --git a/Config/AppConfiguration.swift b/Config/AppConfiguration.swift index 597876852..52b041656 100644 --- a/Config/AppConfiguration.swift +++ b/Config/AppConfiguration.swift @@ -15,7 +15,6 @@ // import Foundation -import MatrixKit /// AppConfiguration is CommonConfiguration plus configurations dedicated to the app class AppConfiguration: CommonConfiguration { diff --git a/Config/AppVersion.xcconfig b/Config/AppVersion.xcconfig index 4b18e27d3..d414d01ef 100644 --- a/Config/AppVersion.xcconfig +++ b/Config/AppVersion.xcconfig @@ -15,5 +15,5 @@ // // Version -MARKETING_VERSION = 1.6.8 -CURRENT_PROJECT_VERSION = 1.6.8 +MARKETING_VERSION = 1.6.9 +CURRENT_PROJECT_VERSION = 1.6.9 diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift index bb1b25a0a..0919c08fd 100644 --- a/Config/BuildSettings.swift +++ b/Config/BuildSettings.swift @@ -16,8 +16,6 @@ import Foundation -import MatrixKit - /// BuildSettings provides settings computed at build time. /// In future, it may be automatically generated from xcconfig files @objcMembers @@ -118,9 +116,9 @@ final class BuildSettings: NSObject { "https://element.io/help" - // MARk: - Matrix permalinks - // Paths for URLs that will considered as Matrix permalinks. Those permalinks are opened within the app - static let matrixPermalinkPaths: [String: [String]] = [ + // MARK: - Permalinks + // Hosts/Paths for URLs that will considered as valid permalinks. Those permalinks are opened within the app. + static let permalinkSupportedHosts: [String: [String]] = [ "app.element.io": [], "staging.element.io": [], "develop.element.io": [], @@ -133,8 +131,16 @@ final class BuildSettings: NSObject { // Official Matrix ones "matrix.to": ["/"], "www.matrix.to": ["/"], + // Client Permalinks (for use with `BuildSettings.clientPermalinkBaseUrl`) +// "example.com": ["/"], +// "www.example.com": ["/"], ] + // For use in clients that use a custom base url for permalinks rather than matrix.to. + // This baseURL is used to generate permalinks within the app (E.g. timeline message permalinks). + // Optional String that when set is used as permalink base, when nil matrix.to format is used. + // Example value would be "https://www.example.com", note there is no trailing '/'. + static let clientPermalinkBaseUrl: String? = nil // MARK: - VoIP static var allowVoIPUsage: Bool { @@ -146,7 +152,6 @@ final class BuildSettings: NSObject { } static let stunServerFallbackUrlString: String? = "stun:turn.matrix.org" - // MARK: - Public rooms Directory #warning("Unused build setting: should this be implemented in ShowDirectory?") static let publicRoomsAllowServerChange: Bool = true @@ -280,6 +285,13 @@ final class BuildSettings: NSObject { static let roomScreenAllowMediaLibraryAction: Bool = true static let roomScreenAllowStickerAction: Bool = true static let roomScreenAllowFilesAction: Bool = true + static var roomScreenAllowPollsAction: Bool { + guard #available(iOS 14, *) else { + return false + } + + return false + } /// Allow split view detail view stacking static let allowSplitViewDetailsScreenStacking: Bool = true diff --git a/Config/CommonConfiguration.swift b/Config/CommonConfiguration.swift index b6aa77dad..5edcacc37 100644 --- a/Config/CommonConfiguration.swift +++ b/Config/CommonConfiguration.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixKit +import MatrixSDK /// CommonConfiguration is the central point to setup settings for MatrixSDK, MatrixKit and common configurations for all targets. class CommonConfiguration: NSObject, Configurable { @@ -75,6 +75,7 @@ class CommonConfiguration: NSObject, Configurable { // Disable key backup on common sdkOptions.enableKeyBackupWhenStartingMXCrypto = false + sdkOptions.clientPermalinkBaseUrl = BuildSettings.clientPermalinkBaseUrl // Configure key provider delegate MXKeyProvider.sharedInstance().delegate = EncryptionKeyManager.shared } diff --git a/Config/Configurable.swift b/Config/Configurable.swift index a5a6d980e..acfb97605 100644 --- a/Config/Configurable.swift +++ b/Config/Configurable.swift @@ -15,9 +15,7 @@ // import Foundation - -import Foundation -import MatrixKit +import MatrixSDK /// Configurable expose settings app and its entensions must use. @objc protocol Configurable { diff --git a/DesignKit/Source/FontsSwiftUI.swift b/DesignKit/Source/FontsSwiftUI.swift index 223936286..ddf6a1754 100644 --- a/DesignKit/Source/FontsSwiftUI.swift +++ b/DesignKit/Source/FontsSwiftUI.swift @@ -22,6 +22,9 @@ import SwiftUI */ @available(iOS 14.0, *) public struct FontSwiftUI: Fonts { + + public let uiFonts: ElementFonts + public var largeTitle: Font public var largeTitleB: Font @@ -63,6 +66,8 @@ public struct FontSwiftUI: Fonts { public var caption2SB: Font public init(values: ElementFonts) { + self.uiFonts = values + self.largeTitle = Font(values.largeTitle) self.largeTitleB = Font(values.largeTitleB) self.title1 = Font(values.title1) @@ -85,4 +90,3 @@ public struct FontSwiftUI: Fonts { self.caption2SB = Font(values.caption2SB) } } - diff --git a/INSTALL.md b/INSTALL.md index b10f6c609..667f308f4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -44,35 +44,35 @@ $ gem install bundler ## Choose Matrix SDKs version to build -To choose the [MatrixKit](https://github.com/matrix-org/matrix-ios-kit) version (and depending MatrixSDK and OLMKit) you want to develop and build against you will have to modify the right definitions of `$matrixKitVersion` variable in the `Podfile`. +To choose the [MatrixSDK](https://github.com/matrix-org/matrix-ios-sdk) version (and depending OLMKit) you want to develop and build against you will have to modify the right definitions of `$matrixSDKVersion` variable in the `Podfile`. ### Determine your needs -To select which `$matrixKitVersion` value to use you have to determine your needs: +To select which `$matrixSDKVersion` value to use you have to determine your needs: - **Build an App Store release version** -To build the last published App Store code you just need to checkout master branch. If you want to build an older App Store version just checkout the tag of the corresponding version. You have nothing to modify in the `Podfile`. In this case `$matrixKitVersion` will be set to a specific version of the MatrixKit already published on CocoaPods repository. +To build the last published App Store code you just need to checkout master branch. If you want to build an older App Store version just checkout the tag of the corresponding version. You have nothing to modify in the `Podfile`. In this case `$matrixSDKVersion` will be set to a specific version of the MatrixSDK already published on CocoaPods repository. - **Build last development code and modify Element project only** -If you want to build last development code you have to checkout the develop branch and use `$matrixKitVersion = {'develop' => 'develop'}` in the `Podfile`. This will also use MatrixKit and MatrixSDK develop branches. +If you want to build last development code you have to checkout the `develop` branch and use `$matrixSDKVersion = {:branch => 'develop'}` in the `Podfile`. This will also use MatrixSDK develop branch. -- **Build specific branch of Kit and SDK and modify Element project only** +- **Build specific branch of SDK and modify Element project only** -If you want to build a specific branch for the MatrixKit and the MatrixSDK you have to indicate them using a dictionary like this: `$matrixKitVersion = {'kit_branch_name' => 'sdk_branch_name'}`. +If you want to build a specific branch for the MatrixSDK you have to indicate it using a dictionary like this: `$matrixSDKVersion = {:branch => 'sdk_branch_name'}`. -- **Build any branch and be able to modify MatrixKit and MatrixSDK locally** +- **Build any branch and be able to modify MatrixSDK locally** -If you want to modify MatrixKit and/or MatrixSDK locally and see the result in Element project you have to uncommment `$matrixKitVersion = :local` in the `Podfile`. -But before you have to checkout [MatrixKit](https://github.com/matrix-org/matrix-ios-kit) repository in `../matrix-ios-kit` and [MatrixSDK](https://github.com/matrix-org/matrix-ios-sdk) in `../matrix-ios-sdk` locally relatively to your Element iOS project folder. -Be sure to use compatible branches for Element iOS, MatrixKit and MatrixSDK. For example, if you want to modify Element iOS from develop branch, use MatrixKit and MatrixSDK develop branches and then make your modifications. +If you want to modify MatrixSDK locally and see the result in Element project you have to uncommment `$matrixSDKVersion = :local` in the `Podfile`. +But before you have to checkout [MatrixSDK](https://github.com/matrix-org/matrix-ios-sdk) in `../matrix-ios-sdk` locally relatively to your Element iOS project folder. +Be sure to use compatible branches for Element iOS and MatrixSDK. For example, if you want to modify Element iOS from develop branch, use MatrixSDK develop branch and then make your modifications. **Important**: By working with [XcodeGen](https://github.com/yonaskolb/XcodeGen) you will need to use the _New Build System_ in Xcode, to have your some of the xcconfig variables taken into account. It should be enabled by default on the latest Xcode versions, but if you need to enable it go to Xcode menu and select `File > Workspace Settings… > Build System` and then choose `New Build System`. -### `$matrixKitVersion` Modification +### `$matrixSDKVersion` Modification -Every time you change the `$matrixKitVersion` variable in the `Podfile`, you have to run the `pod install` command again. +Every time you change the `$matrixSDKVersion` variable in the `Podfile`, you have to run the `pod install` command again. ## Build @@ -110,8 +110,7 @@ Or if you prefer to use directly CocoaPods: $ pod install ``` -This will load all dependencies for the Element source code, including [MatrixKit](https://github.com/matrix-org/matrix-ios-kit) -and [MatrixSDK](https://github.com/matrix-org/matrix-ios-sdk). +This will load all dependencies for the Element source code, including [MatrixSDK](https://github.com/matrix-org/matrix-ios-sdk). ### Open workspace diff --git a/Podfile b/Podfile index 9c04e8912..6c868bca4 100644 --- a/Podfile +++ b/Podfile @@ -6,43 +6,60 @@ platform :ios, '12.1' # Use frameforks to allow usage of pod written in Swift (like PiwikTracker) use_frameworks! -# Different flavours of pods to MatrixKit. Can be one of: -# - a String indicating an official MatrixKit released version number +# Different flavours of pods to MatrixSDK. Can be one of: +# - a String indicating an official MatrixSDK released version number # - `:local` (to use Development Pods) -# - `{'kit branch name' => 'sdk branch name'}` to depend on specific branches of each repo -# - `{ {kit spec hash} => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for each repo. Used by Fastfile during CI +# - `{ :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 -$matrixKitVersion = '= 0.16.10' -# $matrixKitVersion = :local -# $matrixKitVersion = {'develop' => 'develop'} +$matrixSDKVersion = '= 0.20.13' +# $matrixSDKVersion = :local +# $matrixSDKVersion = { :branch => 'develop'} +# $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } } ######################################## -case $matrixKitVersion +case $matrixSDKVersion when :local -$matrixKitVersionSpec = { :path => '../matrix-ios-kit/MatrixKit.podspec' } $matrixSDKVersionSpec = { :path => '../matrix-ios-sdk/MatrixSDK.podspec' } -when Hash # kit branch name => sdk branch name – or {kit spec Hash} => {sdk spec Hash} -kit_spec, sdk_spec = $matrixKitVersion.first # extract first and only key/value pair; key is kit_spec, value is sdk_spec -kit_spec = { :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => kit_spec.to_s } unless kit_spec.is_a?(Hash) -sdk_spec = { :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => sdk_spec.to_s } unless sdk_spec.is_a?(Hash) -$matrixKitVersionSpec = kit_spec +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 MatrixKit released version -$matrixKitVersionSpec = $matrixKitVersion -$matrixSDKVersionSpec = {} +when String # specific MatrixSDK released version +$matrixSDKVersionSpec = $matrixSDKVersion end -# Method to import the MatrixKit -def import_MatrixKit +# Method to import the MatrixSDK +def import_MatrixSDK pod 'MatrixSDK', $matrixSDKVersionSpec pod 'MatrixSDK/JingleCallStack', $matrixSDKVersionSpec - pod 'MatrixKit', $matrixKitVersionSpec end ######################################## +def import_MatrixKit_pods + pod 'HPGrowingTextView', '~> 1.1' + pod 'libPhoneNumber-iOS', '~> 0.9.13' + pod 'DTCoreText', '~> 1.6.25' + #pod 'DTCoreText/Extension', '~> 1.6.25' + pod 'Down', '~> 0.11.0' +end + +def import_SwiftUI_pods + pod 'Introspect', '~> 0.1' +end + abstract_target 'RiotPods' do pod 'GBDeviceInfo', '~> 6.6.0' @@ -62,7 +79,11 @@ abstract_target 'RiotPods' do pod 'SwiftLint', '~> 0.44.0' target "Riot" do - import_MatrixKit + import_MatrixSDK + import_MatrixKit_pods + + import_SwiftUI_pods + pod 'DGCollectionViewLeftAlignFlowLayout', '~> 1.0.4' pod 'KTCenterFlowLayout', '~> 1.3.1' pod 'ZXingObjC', '~> 3.6.5' @@ -73,7 +94,7 @@ abstract_target 'RiotPods' do pod 'SideMenu', '~> 6.5' pod 'DSWaveformImage', '~> 6.1.1' pod 'ffmpeg-kit-ios-audio', '~> 4.5' - + pod 'FLEX', '~> 4.5.0', :configurations => ['Debug'] target 'RiotTests' do @@ -82,15 +103,26 @@ abstract_target 'RiotPods' do end target "RiotShareExtension" do - import_MatrixKit + import_MatrixSDK + import_MatrixKit_pods end + target "RiotSwiftUI" do + import_SwiftUI_pods + end + + target "RiotSwiftUITests" do + import_SwiftUI_pods + end + target "SiriIntents" do - import_MatrixKit + import_MatrixSDK + import_MatrixKit_pods end target "RiotNSE" do - import_MatrixKit + import_MatrixSDK + import_MatrixKit_pods end end diff --git a/Podfile.lock b/Podfile.lock index b5a2aee51..d0d2d36bb 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -16,7 +16,7 @@ PODS: - AFNetworking/NSURLSession - BlueCryptor (1.0.32) - BlueECC (1.2.5) - - BlueRSA (1.0.34) + - BlueRSA (1.0.200) - DGCollectionViewLeftAlignFlowLayout (1.0.4) - Down (0.11.0) - DSWaveformImage (6.1.1) @@ -39,12 +39,13 @@ PODS: - DTFoundation/Core - ffmpeg-kit-ios-audio (4.5) - FLEX (4.5.0) - - FlowCommoniOS (1.12.0) + - FlowCommoniOS (1.12.2) - GBDeviceInfo (6.6.0): - GBDeviceInfo/Core (= 6.6.0) - GBDeviceInfo/Core (6.6.0) - GZIP (1.3.0) - HPGrowingTextView (1.1) + - Introspect (0.1.3) - JitsiMeetSDK (3.10.2) - KeychainAccess (4.2.2) - KituraContracts (1.2.1): @@ -58,29 +59,16 @@ PODS: - MatomoTracker (7.4.1): - MatomoTracker/Core (= 7.4.1) - MatomoTracker/Core (7.4.1) - - MatrixKit (0.16.10): - - Down (~> 0.11.0) - - DTCoreText (~> 1.6.25) - - HPGrowingTextView (~> 1.1) - - libPhoneNumber-iOS (~> 0.9.13) - - MatrixKit/Core (= 0.16.10) - - MatrixSDK (= 0.20.10) - - MatrixKit/Core (0.16.10): - - Down (~> 0.11.0) - - DTCoreText (~> 1.6.25) - - HPGrowingTextView (~> 1.1) - - libPhoneNumber-iOS (~> 0.9.13) - - MatrixSDK (= 0.20.10) - - MatrixSDK (0.20.10): - - MatrixSDK/Core (= 0.20.10) - - MatrixSDK/Core (0.20.10): + - MatrixSDK (0.20.13): + - MatrixSDK/Core (= 0.20.13) + - MatrixSDK/Core (0.20.13): - AFNetworking (~> 4.0.0) - GZIP (~> 1.3.0) - libbase58 (~> 0.1.4) - OLMKit (~> 3.2.5) - Realm (= 10.16.0) - SwiftyBeaver (= 1.9.5) - - MatrixSDK/JingleCallStack (0.20.10): + - MatrixSDK/JingleCallStack (0.20.13): - JitsiMeetSDK (= 3.10.2) - MatrixSDK/Core - OLMKit (3.2.5): @@ -99,7 +87,7 @@ PODS: - Reusable/View (4.1.2) - SideMenu (6.5.0) - SwiftBase32 (0.9.0) - - SwiftGen (6.4.0) + - SwiftGen (6.5.1) - SwiftJWT (3.6.200): - BlueCryptor (~> 1.0) - BlueECC (~> 1.1) @@ -116,17 +104,21 @@ PODS: DEPENDENCIES: - DGCollectionViewLeftAlignFlowLayout (~> 1.0.4) + - Down (~> 0.11.0) - DSWaveformImage (~> 6.1.1) + - DTCoreText (~> 1.6.25) - ffmpeg-kit-ios-audio (~> 4.5) - FLEX (~> 4.5.0) - FlowCommoniOS (~> 1.12.0) - GBDeviceInfo (~> 6.6.0) + - HPGrowingTextView (~> 1.1) + - Introspect (~> 0.1) - KeychainAccess (~> 4.2.2) - KTCenterFlowLayout (~> 1.3.1) + - libPhoneNumber-iOS (~> 0.9.13) - MatomoTracker (~> 7.4.1) - - MatrixKit (= 0.16.10) - - MatrixSDK - - MatrixSDK/JingleCallStack + - MatrixSDK (= 0.20.13) + - MatrixSDK/JingleCallStack (= 0.20.13) - OLMKit - ReadMoreTextView (~> 3.0.1) - Reusable (~> 4.1) @@ -156,6 +148,7 @@ SPEC REPOS: - GBDeviceInfo - GZIP - HPGrowingTextView + - Introspect - JitsiMeetSDK - KeychainAccess - KituraContracts @@ -165,7 +158,6 @@ SPEC REPOS: - LoggerAPI - Logging - MatomoTracker - - MatrixKit - MatrixSDK - OLMKit - ReadMoreTextView @@ -185,7 +177,7 @@ SPEC CHECKSUMS: AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce BlueCryptor: b0aee3d9b8f367b49b30de11cda90e1735571c24 BlueECC: 0d18e93347d3ec6d41416de21c1ffa4d4cd3c2cc - BlueRSA: 6f9776d62d9773502415a7db3bcbb2bbb3f71fc3 + BlueRSA: dfeef51db96bcc4edec654956c1581adbda4e6a3 DGCollectionViewLeftAlignFlowLayout: a0fa58797373ded039cafba8133e79373d048399 Down: b6ba1bc985c9d2f4e15e3b293d2207766fa12612 DSWaveformImage: 3c718a0cf99291887ee70d1d0c18d80101d3d9ce @@ -193,10 +185,11 @@ SPEC CHECKSUMS: DTFoundation: a53f8cda2489208cbc71c648be177f902ee17536 ffmpeg-kit-ios-audio: 8c44d93054e1a9743a7014ec3dd26cd1ad8f2a59 FLEX: e51461dd6f0bfb00643c262acdfea5d5d12c596b - FlowCommoniOS: e9ecbc97fb9ce5c593fb3da0e1073b65a3902026 + FlowCommoniOS: ca92071ab526dc89905495a37844fd7e78d1a7f2 GBDeviceInfo: ed0db16230d2fa280e1cbb39a5a7f60f6946aaec GZIP: 416858efbe66b41b206895ac6dfd5493200d95b3 HPGrowingTextView: 88a716d97fb853bcb08a4a08e4727da17efc9b19 + Introspect: 2be020f30f084ada52bb4387fff83fa52c5c400e JitsiMeetSDK: 2f118fa770f23e518f3560fc224fae3ac7062223 KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51 KituraContracts: e845e60dc8627ad0a76fa55ef20a45451d8f830b @@ -206,15 +199,14 @@ SPEC CHECKSUMS: LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d Logging: beeb016c9c80cf77042d62e83495816847ef108b MatomoTracker: 24a846c9d3aa76933183fe9d47fd62c9efa863fb - MatrixKit: c3f0bb056ceeb015e2f1688543ac4dbcf88bef2f - MatrixSDK: 0e2ed8fc6f004cac4b4ab46f038a86fe49ce4007 + MatrixSDK: 945f082654830d7ae3a6e1e068b6dc22b2eae932 OLMKit: 9fb4799c4a044dd2c06bda31ec31a12191ad30b5 ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d Realm: b6027801398f3743fc222f096faa85281b506e6c Reusable: 6bae6a5e8aa793c9c441db0213c863a64bce9136 SideMenu: f583187d21c5b1dd04c72002be544b555a2627a2 SwiftBase32: 9399c25a80666dc66b51e10076bf591e3bbb8f17 - SwiftGen: 67860cc7c3cfc2ed25b9b74cfd55495fc89f9108 + SwiftGen: a6d22010845f08fe18fbdf3a07a8e380fd22e0ea SwiftJWT: 88c412708f58c169d431d344c87bc79a87c830ae SwiftLint: e96c0a8c770c7ebbc4d36c55baf9096bb65c4584 SwiftyBeaver: 84069991dd5dca07d7069100985badaca7f0ce82 @@ -222,6 +214,6 @@ SPEC CHECKSUMS: zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb -PODFILE CHECKSUM: 675c24e5fcaf580998f32fde709fc3be1b2bde22 +PODFILE CHECKSUM: f58da67b86ec3b34619f1c61a33ce9a8ed35e28f COCOAPODS: 1.11.2 diff --git a/README.md b/README.md index 31edf7a51..704f07064 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ![GitHub](https://img.shields.io/github/license/vector-im/element-ios) [![Twitter URL](https://img.shields.io/twitter/url?label=Element&url=https%3A%2F%2Ftwitter.com%2Felement_hq)](https://twitter.com/element_hq) -Element iOS is an iOS [Matrix](https://matrix.org/) client provided by [Element](https://element.io/). It is based on [MatrixKit](https://github.com/matrix-org/matrix-ios-kit) and [MatrixSDK](https://github.com/matrix-org/matrix-ios-sdk). +Element iOS is an iOS [Matrix](https://matrix.org/) client provided by [Element](https://element.io/). It is based on [MatrixSDK](https://github.com/matrix-org/matrix-ios-sdk).

@@ -34,7 +34,7 @@ $ pod install # Create the xcworkspace with all project dependenci $ open Riot.xcworkspace # Open Xcode ``` -Else, you can visit our [installation guide](./INSTALL.md). This guide also offers more details and advanced usage like using [MatrixSDK](https://github.com/matrix-org/matrix-ios-sdk) and [MatrixKit](https://github.com/matrix-org/matrix-ios-kit) in their development versions. +Else, you can visit our [installation guide](./INSTALL.md). This guide also offers more details and advanced usage like using [MatrixSDK](https://github.com/matrix-org/matrix-ios-sdk) in its development version. ## Contributing diff --git a/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme b/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme index a9bea1d96..84ecb908a 100644 --- a/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme +++ b/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme @@ -4,8 +4,7 @@ version = "1.3"> + buildImplicitDependencies = "YES"> This application is making use of the following third party softwares:

-