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

build: update xcconfig files and dev doc require team id #732

Merged
merged 2 commits into from
Sep 28, 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
28 changes: 14 additions & 14 deletions docs/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Reviewing the template will help you understand the composition of the project.

- [`Node.js`](https://nodejs.org/)
- [`Xcode`](https://geo.itunes.apple.com/app/id497799835)
- `Developer Team ID` (i.e. Apple Account, see [Xcode section](#xcode))

# Dev

Expand All @@ -30,6 +31,10 @@ Reviewing the template will help you understand the composition of the project.

# Build

> [!NOTE]
> Before building the app with Xcode make sure you create the `.dev.xcconfig` files [below](#xcconfig) and fill in your `Developer Team ID`.
> Otherwise `App groups` related functions will not work properly.

- `npm run build:mac` [^1][^2]
- `cd ./xcode`
- `xcodebuild -scheme Mac` [^1][^2][^3] or build with `Xcode` App
Expand All @@ -42,32 +47,27 @@ Reviewing the template will help you understand the composition of the project.

# Xcode

Please note that a developer account is required, which can be a free Apple Account that has agreed to the Apple Developer Agreement. This is required to obtain a `Team ID` and use the `App groups` capability.

### Configurations

The Xcode project contains two configurations, which have independent `xcconfig` configuration files, and can run on your local at the same time without conflicts.
The Xcode project contains several configurations, which have independent `xcconfig` configuration files, and can run on your local at the same time without conflicts.

- `Vite`: for vite real-time development.

- `Debug`: No developer account is required, that is `Sign to Run Locally` by default, which will speed up the build during development. This is convenient for developers without an account, and contributors who only need to do simple local debugging.
- `Debug`: for development and debugging.

- `Release`: A developer account is required, which means it can be used for distribution as well as running on real iOS/iPadOS devices. You will need to override your developer account information in `xcconfig` to complete the build.
- `Release`: for building and distributing.

### xcconfig

All `xcconfig` files are in the [`/xcode/xcconfig/`](../xcode/xcconfig) directory. Each `.xcconfig` file can be overridden by `.dev.xcconfig` in the same path, they will be ignored by `git`, so you can override any build settings locally.

For example, you can create an `Userscripts-Release.dev.xcconfig` file to override [`Userscripts-Release.xcconfig`](../xcode/xcconfig/Userscripts-Release.xcconfig) and fill in your own developer account information there:

`Userscripts-Release.dev.xcconfig`

```
DEVELOPMENT_TEAM = XXXXXXXXXX
```

Another example, if you want `Debug` builds to be also signed, so instead of enabling `Allow Unsigned Extensions` every time in Safari, you can create:
For example, you can create an `Userscripts-Debug.dev.xcconfig` file to override [`Userscripts-Debug.xcconfig`](../xcode/xcconfig/Userscripts-Debug.xcconfig) and fill in your own developer account `Team ID` there:

`Userscripts-Debug.dev.xcconfig`

```
CODE_SIGN_IDENTITY = Apple Development
DEVELOPMENT_TEAM = XXXXXXXXXX
```

Expand All @@ -79,4 +79,4 @@ Note that all existing `.xcconfig` files already include `.dev.xcconfig` files o

# About

[Userscripts](https://github.com/quoid/userscripts) @ 2018-2023
[Userscripts](https://github.com/quoid/userscripts) @ 2018-2024
8 changes: 5 additions & 3 deletions xcode/xcconfig/Userscripts-Debug.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © Userscripts
CURRENT_PROJECT_VERSION = 1
MARKETING_VERSION = 1.0.0

// Sign to Run Locally
CODE_SIGN_IDENTITY = -
// Development
CODE_SIGN_IDENTITY = Apple Development
// Developer Team ID
DEVELOPMENT_TEAM = XXXXXXXXXX
// Organization Identifier
ORG_IDENTIFIER = dev.debug
// Application Identifier
Expand All @@ -14,7 +16,7 @@ APP_IDENTIFIER = $(ORG_IDENTIFIER).userscripts
EXT_IDENTIFIER = $(APP_IDENTIFIER).ext.safari
// App Groups and Group Containers
IOS_SHARED_GID = group.$(ORG_IDENTIFIER).userscripts
MAC_SHARED_GID = 00000.$(ORG_IDENTIFIER).userscripts
MAC_SHARED_GID = $(DEVELOPMENT_TEAM).$(ORG_IDENTIFIER).userscripts
// App URL Scheme
APP_URL_SCHEME = userscriptsdebug

Expand Down
8 changes: 5 additions & 3 deletions xcode/xcconfig/Userscripts-Vite.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ INFOPLIST_KEY_NSHumanReadableCopyright = Copyright © Userscripts
CURRENT_PROJECT_VERSION = 2
MARKETING_VERSION = 2.0.0

// Sign to Run Locally
CODE_SIGN_IDENTITY = -
// Development
CODE_SIGN_IDENTITY = Apple Development
// Developer Team ID
DEVELOPMENT_TEAM = XXXXXXXXXX
// Organization Identifier
ORG_IDENTIFIER = dev.vite
// Application Identifier
Expand All @@ -14,7 +16,7 @@ APP_IDENTIFIER = $(ORG_IDENTIFIER).userscripts
EXT_IDENTIFIER = $(APP_IDENTIFIER).ext.safari
// App Groups and Group Containers
IOS_SHARED_GID = group.$(ORG_IDENTIFIER).userscripts
MAC_SHARED_GID = 00000.$(ORG_IDENTIFIER).userscripts
MAC_SHARED_GID = $(DEVELOPMENT_TEAM).$(ORG_IDENTIFIER).userscripts
// App URL Scheme
APP_URL_SCHEME = userscripts-vite

Expand Down
Loading