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

feat: buildConfig に flavor を追加 #290

Merged
merged 1 commit into from
Mar 11, 2024
Merged

feat: buildConfig に flavor を追加 #290

merged 1 commit into from
Mar 11, 2024

Conversation

tatsutakein
Copy link
Member

@tatsutakein tatsutakein commented Mar 11, 2024

Issue

  • close #ISSUE_NUMBER 🦕

概要

buildConfig に flavor を追加します.

レビュー観点

レビューレベル

  • Lv0: まったく見ないで Approve する
  • Lv1: ぱっとみて違和感がないかチェックして Approve する
  • Lv2: 仕様レベルまで理解して、仕様通りに動くかある程度検証して Approve する
  • Lv3: 実際に環境で動作確認したうえで Approve する

レビュー優先度

  • すぐに見てもらいたい ( hotfix など ) 🚀
  • 今日中に見てもらいたい 🚗
  • 今日〜明日中で見てもらいたい 🚶
  • 数日以内で見てもらいたい 🐢

参考リンク

スクリーンショット

Before After

Summary by CodeRabbit

  • 新機能
    • アプリのフレーバー(開発用または本番用)を設定する機能を追加しました。
  • リファクタ
    • iOSとAndroidのプラットフォームでフレーバーを扱うためのコードを追加・更新しました。
  • 依存関係の更新
    • 複数の依存関係のバージョンを更新しました。

Copy link

coderabbitai bot commented Mar 11, 2024

Walkthrough

この変更は、AndroidとiOSのアプリケーションにおいて、開発(Dev)と製品(Prod)の二つの異なるフレーバーを扱うための設定とロジックを導入しています。それぞれのプラットフォームにおいて、フレーバーに基づく条件分岐をサポートするためのコードと設定ファイルが追加または更新されています。

Changes

ファイルのパス 変更の要約
app/android/.../AppModule.kt Flavorのインポート追加、AppBuildConfig.FLAVORに基づくフレーバー処理の実装
app/ios/.../Dev/Info.plist, app/ios/.../Prod/Info.plist フレーバー(dev, prod)の設定追加
app/ios/.../Nito.xcodeproj/project.pbxproj Info.plistの参照追加、グループ構造の更新、ProdDevの設定パス修正
app/ios/.../Nito.xcodeproj/project.xcworkspace/.../Package.resolved, app/ios/Modules/Package.resolved 依存関係のリビジョンとバージョンの更新
app/ios/Modules/.../Container.swift AppBuildConfigクラスにflavorプロパティ追加
core/model/.../BuildConfig.kt BuildConfigインターフェースにflavorプロパティ追加、EmptyBuildConfigクラスでの実装
core/model/.../Flavor.kt Flavor enumクラスの導入(Dev, Prod)

🐇✨
フレーバー分けた、このコードの旅、
DevProd、道は二つに。
ビルドの森を駆け巡りながら、
未来へと続く、開発の軌跡。
🌟🐾

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@github-actions github-actions bot added @app/ios iOS development @core/model @app/android Android development labels Mar 11, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between de21732 and 3923a08.
Files selected for processing (9)
  • app/android/src/androidMain/kotlin/club/nito/app/AppModule.kt (2 hunks)
  • app/ios/App/Nito/Dev/Info.plist (1 hunks)
  • app/ios/App/Nito/Nito.xcodeproj/project.pbxproj (7 hunks)
  • app/ios/App/Nito/Nito.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (2 hunks)
  • app/ios/App/Nito/Prod/Info.plist (1 hunks)
  • app/ios/Modules/Package.resolved (2 hunks)
  • app/ios/Modules/Sources/KmpContainer/Container.swift (2 hunks)
  • core/model/src/commonMain/kotlin/club/nito/core/model/BuildConfig.kt (2 hunks)
  • core/model/src/commonMain/kotlin/club/nito/core/model/Flavor.kt (1 hunks)
Files skipped from review due to trivial changes (1)
  • core/model/src/commonMain/kotlin/club/nito/core/model/Flavor.kt
Additional comments: 18
app/ios/App/Nito/Dev/Info.plist (1)
  • 5-6: Info.plistFlavorキーとその値としてdevを追加することで、開発ビルドを識別できるようになりました。この変更は、アプリケーションが開発環境で実行されているかどうかをプログラムで判断するために使用できます。
app/ios/App/Nito/Prod/Info.plist (1)
  • 5-6: Info.plistFlavorキーとその値としてprodを追加することで、本番ビルドを識別できるようになりました。この変更は、アプリケーションが本番環境で実行されているかどうかをプログラムで判断するために使用できます。
app/android/src/androidMain/kotlin/club/nito/app/AppModule.kt (2)
  • 4-4: Flavor enumをclub.nito.core.modelからインポートしました。これにより、アプリケーションのビルドフレーバーに基づいて異なる動作を実装できるようになります。
  • 14-18: AppBuildConfig.FLAVORプロパティに基づいて、flavorプロパティの値を設定しています。このロジックにより、ビルドフレーバー(開発または本番)に基づいてアプリケーションの設定を動的に変更できます。デフォルトのフレーバーとしてFlavor.Devを使用することは、未知のフレーバー値が設定された場合の安全なフォールバックとして機能します。
core/model/src/commonMain/kotlin/club/nito/core/model/BuildConfig.kt (2)
  • 22-22: BuildConfigインターフェースに新しい公開プロパティflavorを追加しました。これにより、アプリケーションのビルドフレーバーを表すことができるようになります。
  • 37-37: EmptyBuildConfigクラスにflavorプロパティの実装を追加し、デフォルト値としてFlavor.Devを設定しました。これは、ビルド設定が明示的に提供されない場合に、開発フレーバーをデフォルトとする合理的な選択です。
app/ios/Modules/Sources/KmpContainer/Container.swift (2)
  • 28-28: AppBuildConfigクラスに新しいプロパティflavorを追加しました。これは、iOSアプリケーションがビルドフレーバーを識別できるようにするための重要な変更です。
  • 41-48: Info.plistファイルからFlavorキーの値を読み取り、それに基づいてflavorプロパティを初期化しています。このアプローチにより、アプリケーションのビルドフレーバーを動的に設定でき、開発と本番の環境を区別できます。
app/ios/Modules/Package.resolved (2)
  • 35-36: swift-dependenciesのリビジョンとバージョンを更新しました。これは、プロジェクトの依存関係を最新の状態に保つための重要な変更です。
  • 53-54: xctest-dynamic-overlayのリビジョンとバージョンを更新しました。テストフレームワークの依存関係を最新に保つことは、安定したテスト環境を維持する上で重要です。
app/ios/App/Nito/Nito.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (3)
  • 17-18: swift-clocksのリビジョンとバージョンを更新しました。依存関係の更新は、プロジェクトが最新のライブラリ機能を利用できるようにするために重要です。
  • 26-27: swift-concurrency-extrasのリビジョンとバージョンを更新しました。非同期プログラミングをサポートするライブラリの最新バージョンを使用することは、アプリケーションのパフォーマンスと安定性に貢献します。
  • 44-45: swift-syntaxのリビジョンとバージョンを更新しました。Swiftの構文解析を扱うライブラリの更新は、コード生成や解析機能の改善につながります。
app/ios/App/Nito/Nito.xcodeproj/project.pbxproj (5)
  • 30-31: Info.plistファイルの参照を2つ追加しました。これにより、Xcodeプロジェクトが新しいビルドフレーバーに対応するInfo.plistファイルを認識できるようになります。
  • 77-77: Prodビルド設定のINFOPLIST_FILEパスを更新しました。これにより、本番ビルド用の正しいInfo.plistファイルが参照されるようになります。
  • 103-103: Devビルド設定のINFOPLIST_FILEパスを更新しました。これにより、開発ビルド用の正しいInfo.plistファイルが参照されるようになります。
  • 383-383: ProdターゲットのINFOPLIST_FILE設定をProd/Info.plistに更新しました。これは、本番ビルドの設定を正しく指定するための重要な変更です。
  • 452-452: DevターゲットのINFOPLIST_FILE設定をDev/Info.plistに更新しました。これは、開発ビルドの設定を正しく指定するための重要な変更です。

@tatsutakein tatsutakein merged commit 95d9d45 into main Mar 11, 2024
8 checks passed
@tatsutakein tatsutakein deleted the rt/add-flavor branch March 11, 2024 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@app/android Android development @app/ios iOS development @core/model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant