Skip to content

feat: add distribution flavor dimension (direct/googleplay)#62

Open
KoheiYamashita wants to merge 2 commits into
mainfrom
feat/distribution-flavor-foundation
Open

feat: add distribution flavor dimension (direct/googleplay)#62
KoheiYamashita wants to merge 2 commits into
mainfrom
feat/distribution-flavor-foundation

Conversation

@KoheiYamashita

Copy link
Copy Markdown
Member

📝 Description

Issue #53 Phase 1 — Android ビルドフレーバーに distribution 次元(direct / googleplay)を追加し、Google Play 配布をサポートする基盤を構築。

  • variant × distribution の 2 軸フレーバーマトリクス導入(termuxGoogleplay は除外)
  • DistributionModule(direct / googleplay)を新規追加し、DI に統合
  • GatewayProcessManagerextraEnv パラメータを追加
  • 全 CI ワークフロー(android-pr, android-build, android-aab, release)をフレーバー対応に更新
  • README / CLAUDE.md のドキュメントを更新

🗣️ Type of Change

  • ✨ New feature (non-breaking change which adds functionality)

🔗 Linked Issue

Closes #53

📚 Technical Context (Skip for Docs)

  • Reasoning: Google Play 配布向けに direct(APK 直接配布)と googleplay(Play Store 配布)を分離するための基盤。termuxGoogleplay は意味がないため beforeVariants で除外。

🧪 Test Environment & Hardware

  • Hardware: N/A (CI workflow changes)
  • OS: Ubuntu (GitHub Actions)
  • Model/Provider: N/A
  • Channels: N/A

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

🤖 Generated with Claude Code

…id builds

Add a second flavor dimension `distribution` (direct/googleplay) alongside
existing `variant` (embedded/termux) to support Google Play distribution.
Exclude `termuxGoogleplay` combination. Update all CI workflows, docs, and
DI modules accordingly.

Closes #53

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 19, 2026 18:17
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

このプルリクエストは、AndroidアプリケーションのGoogle Play配布をサポートするための基盤を構築します。既存のビルドフレーバーに加えて、direct(直接配布)とgoogleplay(Google Playストア配布)という新しいdistributionディメンションを導入することで、配布チャネルに応じたビルドの柔軟性を高めます。これにより、将来的に配布チャネル固有の機能や設定を容易に組み込めるようになります。

Highlights

  • Androidビルドフレーバーの拡張: Androidビルドにdistributionフレーバーディメンション(direct/googleplay)を追加しました。
  • 2軸フレーバーマトリクスの導入: variantdistributionの2軸フレーバーマトリクスを導入し、termuxGoogleplayバリアントを明示的に除外しました。
  • DIへのDistributionModuleの追加: 配布チャネル固有の設定を注入できるよう、KoinにDistributionModuleを新規追加しました。
  • GatewayProcessManagerの機能強化: GatewayProcessManagerextraEnvパラメータを追加し、環境変数を動的に設定できるようにしました。
  • CIワークフローの更新: 全てのCIワークフロー(android-pr, android-build, android-aab, release)を新しいフレーバーディメンションに対応させました。
  • ドキュメントの更新: READMEおよび開発者向けドキュメント(CLAUDE.md, .claude/rules/android.md)を新しいビルド設定に合わせて更新しました。

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (4)
    • .github/workflows/android-aab.yml
    • .github/workflows/android-build.yml
    • .github/workflows/android-pr.yml
    • .github/workflows/release.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

このプルリクエストは、Androidビルドに distribution フレーバー次元(direct / googleplay)を追加し、Google Playストアへの配布に向けた基盤を整備するものです。主な変更点として、build.gradle.ktsでのフレーバー設定、フレーバーごとのソースセットとDIモジュールの追加、CIワークフローとドキュメントの更新が含まれています。全体的に変更は適切で、将来の拡張性も考慮されています。1点、DistributionModule.ktdirectgoogleplay の両フレーバーで重複しているため、これを共通化することでメンテナンス性を向上させる提案をしました。

Comment on lines +1 to +8
package io.clawdroid.di

import org.koin.core.qualifier.named
import org.koin.dsl.module

val distributionModule = module {
single<Map<String, String>>(named("distributionEnv")) { emptyMap() }
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

direct フレーバー用の DistributionModule.kt と内容が完全に同一であり、コードが重複しています。

現状では両フレーバーで提供する内容に差異がないため、このモジュールを src/main/java ソースセットに配置して共通化することをお勧めします。これにより、コードの重複が解消され、メンテナンス性が向上します。将来的にフレーバー固有の実装が必要になった時点で、それぞれのソースセットにファイルを作成すれば上書きが可能です。

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Android flavor dimension for distribution targets (direct vs googleplay) to support Google Play builds, wiring the new dimension through DI and CI workflows while documenting the new build matrix.

Changes:

  • Introduces distribution flavor dimension (direct / googleplay) alongside existing variant flavors and excludes termuxGoogleplay.
  • Adds a new DistributionModule and passes distribution-specific env vars into GatewayProcessManager.
  • Updates GitHub Actions workflows and docs to use the new variant task/output names.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
android/backend/loader/src/main/java/io/clawdroid/backend/loader/GatewayProcessManager.kt Adds extraEnv support and merges it into the process environment when starting the gateway.
android/app/src/main/java/io/clawdroid/ClawDroidApp.kt Registers distributionModule in Koin module list.
android/app/src/googleplay/java/io/clawdroid/di/DistributionModule.kt Adds distribution-scoped Koin module (currently provides empty env map).
android/app/src/direct/java/io/clawdroid/di/DistributionModule.kt Adds distribution-scoped Koin module (currently provides empty env map).
android/app/src/embedded/java/io/clawdroid/di/FlavorModule.kt Injects distributionEnv into GatewayProcessManager for embedded builds.
android/app/build.gradle.kts Defines the 2D flavor matrix, adds source sets for distribution flavors, and disables termuxGoogleplay.
README.md Updates installation/build instructions for the new flavor/task names.
README.ja.md Updates installation/build instructions for the new flavor/task names (Japanese).
CLAUDE.md Updates documented Gradle commands for new flavor matrix tasks.
.github/workflows/release.yml Updates release workflow to build/upload artifacts for new flavor combinations, including Google Play AAB.
.github/workflows/android-pr.yml Updates PR CI to lint/test the new flavor combinations.
.github/workflows/android-build.yml Updates build CI matrix and artifact paths for new flavor combinations.
.github/workflows/android-aab.yml Updates AAB workflow to build the embedded Google Play AAB variant.
.claude/rules/android.md Updates internal Android build notes to reflect the new flavor matrix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment on lines +580 to +582
# Embedded Google Play
./gradlew assembleEmbeddedGoogleplayDebug

Comment thread README.ja.md

# Termux 版(バックエンドなし)
./gradlew assembleTermuxDebug
# 組み込み版 Google Play
Comment thread .claude/rules/android.md
1. `cd android && ./gradlew lint` — Lint チェック
2. `cd android && ./gradlew test` — ユニットテスト実行
3. `cd android && ./gradlew assembleEmbeddedDebug` — ビルド確認
3. `cd android && ./gradlew assembleEmbeddedGoogleplayDebug` — Google Play 向け Embedded ビルド確認
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task] Google Play ストア公開に向けたコンプライアンス対応

2 participants