← スキル一覧に戻る

setup-variants
by DanhDue
A Digital Wallet App base on the Clean Architecture.
⭐ 0🍴 0📅 2026年1月25日
SKILL.md
name: setup-variants description: Automates the setup of build variants (flavors) for Android and iOS in a default Flutter project, including signing and VS Code launch configuration.
Setup Variants Skill
This skill configures dev, stg, and prd build variants for both Android and iOS in a standard Flutter project.
Reference Guide: Setup Development Environments Guide
Prerequisites
- A standard Flutter project structure
secureFilesdirectory with signing keys and flavor configurations (json)
Steps
1. Android Setup
- Modify
android/app/build.gradle.kts:- Apply the flavor and signing configuration.
- Use the template from local resources:
.agent/skills/setup_variants/resources/android/build_gradle_flavors.kts. - Ensure
signingConfigsmap tosecureFilescorrectly.
- Update .gitignore:
- Add
keystore.propertiestoandroid/.gitignore(defensive, in case it is copied locally).
- Add
- Verify Android Build:
- Run
./gradlew bundleRelease(orassembleRelease) to ensure gradle syncs and builds correctly.
- Run
2. iOS Setup
- Clean Default Scheme:
- Remove
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme.
- Remove
- Copy Scripts:
- Copy
extract_dart_defines.shtoios/scripts/. - Copy
update_project.pyandupdate_project_runner_tests.pytoios/scripts/. - Copy
copy_google_service_plist.shtoios/scripts/. - Make
extract_dart_defines.shandcopy_google_service_plist.shexecutable (chmod +x).
- Copy
- Run Automation Scripts:
- Run
python3 ios/scripts/update_project.py --app-name <your_app_name>(e.g.python3 ios/scripts/update_project.py --app-name Wallet) to create Build Configurations. - Run
python3 ios/scripts/update_project_runner_tests.pyto fix RunnerTests targets.
- Run
- Create XCConfigs:
- Create
ios/Flutter/{app_name}-defaults.xcconfigusing the resource templateApp-defaults.xcconfig. - Create flavor
.xcconfigfiles (e.g.{app_name}-dev.xcconfig,{app_name}.xcconfig) inios/Flutter/that import{app_name}.xcconfigand generated Pods configs. - Note: Ensure your Xcode Build Phase that runs
extract_dart_defines.shpasses{app_name}as the first argument.
- Create
- Update .gitignore:
- Add
Flutter/{app_name}.xcconfigtoios/.gitignoreas it is a generated file.
- Add
- Update Info.plist:
- Set
CFBundleDisplayNameto$(DART_DEFINES_APP_NAME). - Set
CFBundleIdentifierto$(PRODUCT_BUNDLE_IDENTIFIER)$(DART_DEFINES_APP_ID_SUFFIX).
- Set
- Create Schemes:
- (Already handled by
update_project.pylogic or manual xml creation if needed - Note: current script does not create schemes xml, only config. You may need to create scheme XMLs defined in previous steps if not present). - Actually, for this skill, ensure
dev,stg,prdschemes exist inxcshareddata.
- (Already handled by
- Update Podfile:
- Map the new configurations to
:debugand:release. - Ensure
platform :ios, '13.0'(or higher) is set. - Enforce
IPHONEOS_DEPLOYMENT_TARGETinpost_install.
- Map the new configurations to
- GoogleService-Info.plist Setup:
- Prerequisite: Run the
@copy_secure_configurationsskill first to copy your validGoogleService-Info.plistfiles toios/Runner/Firebase/.- This ensures files like
GoogleService-Info.dev.plistexist.
- This ensures files like
- In Xcode, add a new "Run Script" Build Phase after "Copy Bundle Resources".
- Name it "Copy GoogleService-Info.plist".
- Script:
"${SRCROOT}/scripts/copy_google_service_plist.sh"
- Prerequisite: Run the
- Verify iOS Build:
- Run
pod installinios/.
- Run
3. VS Code Configuration
- Create
launch.json:- Create
.vscode/launch.jsonusing the template from resources.
- Create
4. Verification
Run the following commands to verify the setup for each environment. These match the configurations in .vscode/launch.json.
Dev Environment:
flutter run --flavor dev --dart-define-from-file=secureFiles/dev/environment-configs.json
Staging Environment:
flutter run --flavor stg --dart-define-from-file=secureFiles/stg/environment-configs.json
Production Environment:
flutter run --flavor prd --dart-define-from-file=secureFiles/prd/environment-configs.json
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です