Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Cocoapods #1179

Merged
merged 8 commits into from
Feb 29, 2024
Merged
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
3 changes: 0 additions & 3 deletions .github/scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function finish() {
trap finish EXIT

SDK="${SDK:-iphoneos}"
WORKSPACE="${WORKSPACE:-Mastodon.xcworkspace}"
SCHEME="${SCHEME:-Mastodon}"
CONFIGURATION=${CONFIGURATION:-Release}

Expand Down Expand Up @@ -41,12 +40,10 @@ echo "GITHUB_TAG_NAME=build-$CURRENT_PROJECT_VERSION" >> $GITHUB_ENV
agvtool new-version -all $CURRENT_PROJECT_VERSION

xcrun xcodebuild clean \
-workspace "${WORKSPACE}" \
-scheme "${SCHEME}" \
-configuration "${CONFIGURATION}"

xcrun xcodebuild archive \
-workspace "${WORKSPACE}" \
-scheme "${SCHEME}" \
-configuration "${CONFIGURATION}" \
-destination generic/platform=iOS \
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eo pipefail
# build with SwiftPM:
# https://developer.apple.com/documentation/swift_packages/building_swift_packages_or_apps_that_use_them_in_continuous_integration_workflows

xcodebuild -workspace Mastodon.xcworkspace \
xcodebuild \
-scheme Mastodon \
-destination "platform=iOS Simulator,name=iPhone SE (3rd generation)" \
clean \
Expand Down
6 changes: 2 additions & 4 deletions .github/scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# workaround https://github.com/CocoaPods/CocoaPods/issues/11355
# sed -i '' $'1s/^/source "https:\\/\\/github.com\\/CocoaPods\\/Specs.git"\\\n\\\n/' Podfile
brew install [email protected]
brew install [email protected]

# Install Ruby Bundler
gem install bundler:2.3.11
Expand All @@ -11,5 +11,3 @@ bundle install

# Setup notification endpoint
bundle exec arkana

bundle exec pod install
41 changes: 23 additions & 18 deletions Documentation/Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,25 @@
- Swift 5.7+
- iOS 14.0+


Install the latest version of Xcode from the App Store or Apple Developer Download website. Also, we assert you have the [Homebrew](https://brew.sh) package manager.

This guide may not suit your machine and actually setup procedure may change in the future. Please file the issue or Pull Request if there are any problems.
This guide may not suit your machine and actually setup procedure may change in the future. Please file an issue or open a Pull Request if there are any problems.

### Swiftgen and Sourcery

## CocoaPods
The app use [CocoaPods]() and [Arkana](https://github.com/rogerluan/arkana). Ruby Gems are managed through Bundler. Make sure you have [Rosetta](https://support.apple.com/en-us/HT211861) installed if you are using the M1 Mac.
This app uses [SwiftGen](https://github.com/SwiftGen/SwiftGen) and [Sourcery](https://github.com/krzysztofzablocki/Sourcery) for Code Generation.

> [!NOTE]
> Both tools are optional. Using the following command will install them system wide:

```zsh
brew install swiftgen
brew install sourcery
```

### Arkana

The app uses [Arkana](https://github.com/rogerluan/arkana). Ruby Gems are managed through Bundler. Make sure you have [Rosetta](https://support.apple.com/en-us/HT211861) installed if you are using the M1 Mac.

```zsh
# install the rbenv
Expand All @@ -38,29 +50,21 @@ bundle install
## Bootstrap

```zsh
# make a clean build
bundle install
bundle exec pod clean

# setup arkana
# please check the `.env.example` to create your's or use the empty example directly
bundle exec arkana -e ./env/.env

# clean pods
bundle exec pod clean

# make install
bundle exec pod install --repo-update

# open workspace
open Mastodon.xcworkspace
# open project
xed .
```

The Arkana plugin will setup the push notification endpoint. You can use the empty template from `./env/.env` or use your own `.env` file. To setup the push notification. Please check section `Push Notification` below.

The app requires the `App Group` capability. To make sure it works for your developer membership. Please check [AppSecret.swift](../MastodonSDK/Sources/MastodonCore/AppSecret.swift) file and set another unique `groupID` and update `App Group` settings.

#### Push Notification (Optional)

The app is compatible with [toot-relay](https://github.com/DagAgren/toot-relay) APNs. You can set your push notification endpoint via Arkana. There are two endpoints:
- NotificationEndpointDebug: for `DEBUG` usage. e.g. `https://<your.domin>/relay-to/development`
- NotificationEndpointRelease: for `RELEASE` usage. e.g. `https://<your.domin>/relay-to/production`
Expand All @@ -72,11 +76,12 @@ Note:
Please check and set the `notification.Topic` to the app BundleID in [toot-relay.go](https://github.com/DagAgren/toot-relay/blob/f9d6894040509881fee845972cd38ec6cd8f5a11/toot-relay.go#L112). The server needs use a reverse proxy to port this relay on 443 port with valid domain and HTTPS certificate.

## Start
1. Open `Mastodon.xcworkspace`
2. Wait for the Swift Package Dependencies resolved.

1. Open `Mastodon.xcodeproj`
2. Wait for the Swift Package Dependencies to be resolved.
2. Check the signing settings make sure to choose a team. [More info…](https://help.apple.com/xcode/mac/current/#/dev23aab79b4)
3. Select `Mastodon` scheme and device then run it. (Command + R)

## What's next

We welcome contributions! And if you have an interest to contribute codes. Here is a document that describes the app architecture and what's tech stack it uses.
We welcome contributions! And if you have an interest to contribute code, [here is a document](How-it-works.md) that describes the app architecture and what tech stack it uses.
3 changes: 0 additions & 3 deletions Documentation/Snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ xcodebuild \
test \
-showdestinations \
-derivedDataPath '~/Downloads/MastodonBuild/Derived' \
-workspace Mastodon.xcworkspace \
-scheme 'Mastodon - Snapshot'

# output
Expand All @@ -47,7 +46,6 @@ TEST_RUNNER_login_domain='<Domain>' \
xcodebuild \
test \
-derivedDataPath '~/Downloads/MastodonBuild/Derived' \
-workspace Mastodon.xcworkspace \
-scheme 'Mastodon - Snapshot' \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 13 Pro Max' \
Expand Down Expand Up @@ -88,7 +86,6 @@ TEST_RUNNER_login_domain='<domain.com>' \
xcodebuild \
test \
-derivedDataPath '~/Downloads/MastodonBuild/Derived' \
-workspace Mastodon.xcworkspace \
-scheme 'Mastodon - Snapshot' \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 13 Pro Max' \
Expand Down
Loading
Loading