Skip to content

Commit

Permalink
Revert "Revert "添加 iOS APP 入口 (#839)""
Browse files Browse the repository at this point in the history
This reverts commit 88da839.
  • Loading branch information
Him188 committed Aug 30, 2024
1 parent 88da839 commit 818400a
Show file tree
Hide file tree
Showing 25 changed files with 795 additions and 34 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ jobs:
strategy:
fail-fast: false
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners
os:
- windows-2019
- ubuntu-20.04
- macos-12 # x86_64
- macos-14 # aarch64
- windows-2019 # 7 GB
- ubuntu-20.04 # 7 GB
- macos-13 # x86_64, 14 GB
- macos-14 # aarch64, 7 GB
include:
# matrix properties can be booleans. Check for plain true and false.
- os: windows-2019
Expand All @@ -31,22 +32,25 @@ jobs:
anitorrent_separate_build: false # windows 单线程构建 anitorrent, 要一起跑节约时间
compose_resource_triple: windows-x64
run_tests: true
gradleArgs: '"-Dorg.gradle.jvmargs=-Xmx4096m" "-Dfile.encoding=UTF-8" "-Dkotlin.daemon.jvm.options=-Xmx4096M"'
- os: ubuntu-20.04
name: Ubuntu x86_64
uploadApk: false
arch: x64
anitorrent: false
anitorrent_separate_build: false
compose_resource_triple: linux-x64
run_tests: false
- os: macos-12
run_tests: false # 只编译, 因为 test 不支持 linux
gradleArgs: '-Dorg.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options=-Xmx4096M'
- os: macos-13
name: macOS x86_64
uploadApk: false
arch: x64
anitorrent: true
anitorrent_separate_build: true # macOS 构建快, 先构建 anitorrent, 再 assemble
compose_resource_triple: macos-x64
run_tests: true
gradleArgs: '-Dorg.gradle.jvmargs=-Xmx6000m -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options=-Xmx8192M -Porg.gradle.parallel=false'
- os: macos-14
name: macOS aarch64
uploadApk: true
Expand All @@ -55,12 +59,12 @@ jobs:
anitorrent_separate_build: true
compose_resource_triple: macos-arm64
run_tests: true
gradleArgs: '-Dorg.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options=-Xmx4096M -Dani.build.framework=false'
env:
enableLocalPublishingTest: 'false'
gradleArgs: >-
--scan
"-Dorg.gradle.jvmargs=-Xmx4096m"
"-Dfile.encoding=UTF-8"
${{ matrix.gradleArgs }}
--no-configuration-cache
"-Pbangumi.oauth.client.android.appId=${{ secrets.BANGUMI_OAUTH_CLIENT_ANDROID_ID }}"
"-Pbangumi.oauth.client.android.secret=${{ secrets.BANGUMI_OAUTH_CLIENT_ANDROID_SECRET }}"
Expand Down
11 changes: 11 additions & 0 deletions .run/Run iOS Debug.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run iOS Debug" type="KmmRunConfiguration"
factoryName="iOS Application" CONFIG_VERSION="1"
EXEC_TARGET_ID="06647B08-BE84-4AB2-B2AC-131B5420C727"
XCODE_PROJECT="$PROJECT_DIR$/app/ios/iosApp.xcodeproj" XCODE_CONFIGURATION="Debug"
XCODE_SCHEME="iosApp">
<method v="2">
<option name="com.jetbrains.kmm.ios.BuildIOSAppTask" enabled="true" />
</method>
</configuration>
</component>
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,11 @@ Android Studio 的调试器同时支持调试 Kotlin 和 C++ 代码 (torrent 部

### 运行 iOS APP

TODO
只有 macOS 才能运行 iOS APP. 需要先在 App Store 安装 Xcode 并打开一次同意 Xcode 的协议.

如果提示找不到模拟器, 请安装一个 iPhone 15 模拟器.

在 Android Studio 中, 选择运行配置 `Run iOS Debug`, 点击按钮运行即可.

### 常见构建和运行问题

Expand Down
1 change: 1 addition & 0 deletions app/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -352,5 +352,6 @@ idea {
excludeDirs.add(file("appResources/macos-arm64/lib"))
excludeDirs.add(file("appResources/macos-arm64/plugins"))
excludeDirs.add(file("appResources/windows-x64/lib"))
excludeDirs.add(file("test-sandbox"))
}
}
1 change: 1 addition & 0 deletions app/gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../gradlew embedAndSignAppleFrameworkForXcode
2 changes: 2 additions & 0 deletions app/ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
iosApp.xcodeproj/project.xcworkspace
iosApp.xcodeproj/xcuserdata
3 changes: 3 additions & 0 deletions app/ios/Configuration/Config.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TEAM_ID=
BUNDLE_ID=me.him188.ani.Ani
APP_NAME=Ani
3 changes: 3 additions & 0 deletions app/ios/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# iOS APP

要运行, 阅读 [CONTRIBUTING.md](../../CONTRIBUTING.md) 中的 "运行 iOS APP" 部分.
Loading

0 comments on commit 818400a

Please sign in to comment.