agentic-mobile-kit 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/lib/init.js +14 -2
- package/package.json +1 -1
- package/stacks/react-native/template/.agents/skills/m-learn/SKILL.md +26 -0
- package/stacks/react-native/template/.agents/skills/m-learn/agents/openai.yaml +3 -0
- package/stacks/react-native/template/.agents/skills/m-release/SKILL.md +23 -0
- package/stacks/react-native/template/.agents/skills/m-release/agents/openai.yaml +3 -0
- package/stacks/react-native/template/.githooks/pre-push +1 -0
- package/stacks/react-native/template/AGENTS.md +1 -0
- package/stacks/react-native/template/cliff.toml +28 -0
- package/stacks/react-native/template/codemagic.yaml +88 -0
- package/stacks/react-native/template/docs/ai/codemagic.md +39 -0
- package/stacks/react-native/template/docs/ai/team-process.md +1 -1
- package/stacks/react-native/template/scripts/ai/release-check.js +202 -0
- package/stacks/react-native/template/scripts/ai/set-version.sh +20 -0
package/README.md
CHANGED
|
@@ -24,12 +24,15 @@ npx agentic-mobile-kit doctor
|
|
|
24
24
|
## What it adds
|
|
25
25
|
|
|
26
26
|
- **Context for every AI tool:** `AGENTS.md` (plus a one-line `CLAUDE.md`), `docs/ai/` (product, tech, structure, conventions, decisions, known issues, React Native rules) and spec templates in `specs/_templates/`.
|
|
27
|
-
- **Workflows:** the skills `m-feature`, `m-bugfix`, `m-continue`, `m-pause` and `m-
|
|
27
|
+
- **Workflows:** the skills `m-feature`, `m-bugfix`, `m-continue`, `m-pause`, `m-review`, `m-release` and `m-learn`. Invoke them with `/m-feature` in Claude Code and Antigravity, or `$m-feature` in Codex. Also Callstack's React Native skills.
|
|
28
28
|
- **Guardrails in each tool:** a guard hook that blocks destructive commands and secret files, a stop hook that asks for a handoff update, permission rules and a read-only `m-reviewer` subagent, generated with rulesync.
|
|
29
|
+
- **Releases:** `m-release` writes `CHANGELOG.md` from real commits with git-cliff, plus store and client notes, then runs `scripts/ai/release-check.js`, which catches what store review would reject. A version tag starts signed builds on Codemagic (`codemagic.yaml`, one-time setup in `docs/ai/codemagic.md`).
|
|
29
30
|
- **Checks no tool can skip:** git hooks (secrets, signing files, broken Xcode project files, lint, typecheck, tests) and GitHub Actions CI (lint, typecheck, tests, secret scan, PR size, Android and iOS builds).
|
|
30
31
|
|
|
31
32
|
Work continues across tools and machines through `specs/<id>/progress.md`: run `m-pause` in one tool, then `m-continue` in another.
|
|
32
33
|
|
|
34
|
+
For the day-to-day workflow, what's enforced, and a 1-hour training plan, see the [team guide](docs/team-guide.md).
|
|
35
|
+
|
|
33
36
|
## License
|
|
34
37
|
|
|
35
38
|
MIT
|
package/lib/init.js
CHANGED
|
@@ -76,6 +76,16 @@ function templateFiles(dir = TEMPLATE, base = '') {
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
// the app's bundle ID, for Codemagic signing; React Native's template derives it from the product name
|
|
80
|
+
function iosBundleId(cwd) {
|
|
81
|
+
const proj = fs.readdirSync(path.join(cwd, 'ios')).find(f => f.endsWith('.xcodeproj')) || '';
|
|
82
|
+
let pbx = '';
|
|
83
|
+
try { pbx = fs.readFileSync(path.join(cwd, 'ios', proj, 'project.pbxproj'), 'utf8'); } catch {}
|
|
84
|
+
const ids = [...pbx.matchAll(/PRODUCT_BUNDLE_IDENTIFIER = "?([^";]+)"?;/g)].map(m => m[1]).filter(id => !/Tests$/.test(id));
|
|
85
|
+
const id = ids.find(i => !i.includes('$(')) || ids[0] || 'com.example.app';
|
|
86
|
+
return id.replace(/\$\(PRODUCT_NAME(:rfc1034identifier)?\)/, proj.replace(/\.xcodeproj$/, '').replace(/[^A-Za-z0-9.-]/g, '-'));
|
|
87
|
+
}
|
|
88
|
+
|
|
79
89
|
function fillPlaceholders(text, values) {
|
|
80
90
|
return text.replace(/\{\{(\w+)\}\}/g, (m, k) => (k in values ? values[k] : m));
|
|
81
91
|
}
|
|
@@ -94,6 +104,7 @@ function init(cwd, opts = {}) {
|
|
|
94
104
|
NODE_VERSION: (pkg.engines && pkg.engines.node) || `${process.versions.node.split('.')[0]}`,
|
|
95
105
|
PM: pm.name,
|
|
96
106
|
PM_RUN: pm.run,
|
|
107
|
+
IOS_BUNDLE_ID: iosBundleId(cwd),
|
|
97
108
|
};
|
|
98
109
|
const report = { created: [], merged: [], skipped: [] };
|
|
99
110
|
|
|
@@ -119,7 +130,7 @@ function init(cwd, opts = {}) {
|
|
|
119
130
|
if (fs.existsSync(dest)) { report.skipped.push(rel); continue; }
|
|
120
131
|
|
|
121
132
|
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
122
|
-
if (rel === 'AGENTS.md') fs.writeFileSync(dest, kitText());
|
|
133
|
+
if (rel === 'AGENTS.md' || rel === 'codemagic.yaml') fs.writeFileSync(dest, kitText());
|
|
123
134
|
else fs.copyFileSync(src, dest);
|
|
124
135
|
// npm doesn't always keep the executable bit, and git silently skips non-executable hooks
|
|
125
136
|
const executable = rel.startsWith(`.githooks${path.sep}`) || /\.(sh|js)$/.test(rel) && rel.startsWith(`scripts${path.sep}`);
|
|
@@ -196,7 +207,8 @@ function printSummary({ report, values, tools, generated, generateError }, log =
|
|
|
196
207
|
log(' 1. Fill in docs/ai/product.md, tech.md, structure.md and conventions.md for this app.');
|
|
197
208
|
log(' 2. Commit on a branch and open a PR. Add the "large-pr" label (the vendored skills are large).');
|
|
198
209
|
log(' 3. Turn on branch protection for main: see docs/branch-protection.md in the kit repo.');
|
|
199
|
-
|
|
210
|
+
log(' 4. Signed store builds on Codemagic: one-time setup in docs/ai/codemagic.md.');
|
|
211
|
+
if (tools.includes('codex')) log(' 5. Codex users: open the project in Codex once and approve its hooks (they stay off until approved).');
|
|
200
212
|
}
|
|
201
213
|
|
|
202
214
|
module.exports = { init, printSummary, InitError, TOOLS };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-mobile-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "One setup for AI-assisted mobile development that works the same in Claude Code, Codex, Cursor, OpenCode, Kiro and Antigravity. Early development.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "prakashpro1",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: m-learn
|
|
3
|
+
description: Turn a mistake or a correction into the smallest lasting fix (a check, a docs line or a skill step) so no tool repeats it, and remove guidance that is no longer true. Run only when the user explicitly invokes m-learn.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# m-learn
|
|
8
|
+
|
|
9
|
+
Input: $ARGUMENTS (what went wrong or what the user had to correct; the error text, PR comment or session transcript if there is one).
|
|
10
|
+
|
|
11
|
+
1. **State the lesson in one sentence:** what happened, what should have happened, and why. The usual causes are missing context, an ignored rule, the wrong command, or a gap in the rules. Quote the evidence, and don't guess what an earlier session did. If the cause isn't clear, ask.
|
|
12
|
+
2. **Check whether it's already covered.** Search `AGENTS.md`, `docs/ai/` and `.agents/skills/`. If a rule exists and was ignored, writing it again won't help; enforce it instead (step 3.1).
|
|
13
|
+
3. **Pick the strongest small fix**, in this order:
|
|
14
|
+
1. A check that runs without anyone remembering it: a lint rule, a test, a git hook, a CI step, a pattern in `scripts/ai/guard.js`, or a rule in `scripts/ai/release-check.js`.
|
|
15
|
+
2. A known error: add the error text, cause, fix and prevention to `docs/ai/known-issues.md`.
|
|
16
|
+
3. Project knowledge: one line in the right `docs/ai/` file. Use `conventions.md`, `react-native.md` or `tech.md`, or `decisions.md` with the date and the reason.
|
|
17
|
+
4. A workflow step: edit the skill that should have caught it.
|
|
18
|
+
5. `AGENTS.md`: only for a rule every task needs, and keep the file under 150 lines.
|
|
19
|
+
|
|
20
|
+
Make one fix in one place. Don't copy the same rule into several files.
|
|
21
|
+
4. **Remove what's no longer true** in the file you touched: old versions, renamed scripts, bugs that are fixed. Check versions and paths against the repo before trusting a line.
|
|
22
|
+
5. **Show that it works.**
|
|
23
|
+
- For a check: show it failing on the old mistake and passing on the fixed code.
|
|
24
|
+
- For docs or a skill: show the diff, and name the task that would have gone differently.
|
|
25
|
+
6. **This project or every project?** If the lesson applies to any React Native app, say so and draft an issue for the agentic-mobile-kit repo, so every project gets the fix. Ask before opening it.
|
|
26
|
+
7. **Commit** with a message that starts with `chore(learn):` and ends with `Assisted-by: <tool>/<model>`. That prefix keeps it out of the changelog and easy to find with `git log --grep 'chore(learn)'` in the monthly review. Ask before pushing.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: m-release
|
|
3
|
+
description: Prepare a store release - version, changelog and store notes from real commits, release check, release PR, then the tag that starts the signed builds. Run only when the user explicitly invokes m-release.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# m-release
|
|
8
|
+
|
|
9
|
+
Input: $ARGUMENTS (the new version such as 1.4.0, or patch, minor or major; anything the client should hear about).
|
|
10
|
+
|
|
11
|
+
1. **Start clean:** `main`, pulled, with a clean working tree. Find the last release with `git describe --tags --abbrev=0 --match 'v*'`. If there's none, this is the first release.
|
|
12
|
+
2. **Choose the version.** Show the commits since the last release (`git log --oneline <last tag>..HEAD`). Suggest minor if there's anything new for users, patch for fixes only, and major only if the user asks. Get the user's confirmation, then create the branch `release/v<version>`.
|
|
13
|
+
3. **Changelog from real commits:** `npx -y git-cliff@2.14.2 --unreleased --tag v<version> --prepend CHANGELOG.md`. If `CHANGELOG.md` doesn't exist yet, use `-o CHANGELOG.md` instead of `--prepend CHANGELOG.md`. Don't add, merge or reword entries by hand. A misleading commit message gets fixed in the notes below, not in the changelog.
|
|
14
|
+
4. **Store and client notes** go in `release-notes/<version>/`. Write them only from the new changelog section, so every line traces back to an entry. Leave out internal changes (refactors, CI, dependency bumps) unless users notice them.
|
|
15
|
+
- `play-store.txt`: plain text for users, at most 500 characters.
|
|
16
|
+
- `app-store.txt`: plain text for users, at most 4000 characters, with no `<` or `>`.
|
|
17
|
+
- `client.md`: for the client or product owner. Cover what's new, what's fixed, what they should test or do, and known issues.
|
|
18
|
+
|
|
19
|
+
Show all three files to the user and wait for their approval.
|
|
20
|
+
5. **Version name:** `sh scripts/ai/set-version.sh <version>` sets the iOS and Android version names. Leave build numbers alone when `codemagic.yaml` sets them; otherwise ask whether to bump them. If the script stops because the project ships several apps, ask the user which version each app gets.
|
|
21
|
+
6. **Release check:** `node scripts/ai/release-check.js`. Show the output. Fix each ✗, asking first when the fix touches native config. List each ! for the user to decide.
|
|
22
|
+
7. **Release PR:** commit as `Release <version>` with `Assisted-by: <tool>/<model>`. Ask before pushing. Open a PR titled `Release <version>` with the new changelog section and the release-check output.
|
|
23
|
+
8. **Tag after the merge.** Once the PR is merged, ask the user before tagging. Then run `git switch main && git pull && git tag v<version> && git push origin v<version>`. With Codemagic set up (`docs/ai/codemagic.md`), the tag starts the signed builds, which go to TestFlight and Play's internal track.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# agentic-mobile-kit pre-push: typecheck and tests before code leaves the machine.
|
|
3
3
|
set -eu
|
|
4
|
+
[ -d node_modules ] || { echo "pre-push: dependencies aren't installed; run: sh scripts/ai/install-deps.sh" >&2; exit 1; }
|
|
4
5
|
sh scripts/ai/pm-run.sh typecheck || { echo "pre-push: fix the type errors above" >&2; exit 1; }
|
|
5
6
|
CI=true sh scripts/ai/pm-run.sh test || { echo "pre-push: fix the failing tests above" >&2; exit 1; }
|
|
@@ -18,6 +18,7 @@ Read by Claude Code (through CLAUDE.md), Codex, Cursor, OpenCode, Kiro and Antig
|
|
|
18
18
|
| iOS build (simulator, no signing) | `sh scripts/ai/ios-build.sh` |
|
|
19
19
|
| Android build | `cd android && ./gradlew assembleDebug` |
|
|
20
20
|
| Check on devices (release builds, Maestro flows, screenshots) | `sh scripts/ai/verify.sh all --spec <id>` |
|
|
21
|
+
| Check a release before tagging it (versions, permission texts, debug leftovers) | `node scripts/ai/release-check.js` |
|
|
21
22
|
|
|
22
23
|
## Definition of done
|
|
23
24
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# git-cliff config: CHANGELOG.md from commit messages (https://git-cliff.org). The m-release skill runs it.
|
|
2
|
+
# Conventional commits (feat:, fix:, perf:) get their own sections; other commit messages go under "Other".
|
|
3
|
+
|
|
4
|
+
[changelog]
|
|
5
|
+
header = "# Changelog\n"
|
|
6
|
+
body = """
|
|
7
|
+
{% if version %}## {{ version | trim_start_matches(pat="v") }} ({{ timestamp | date(format="%Y-%m-%d") }}){% else %}## Unreleased{% endif %}
|
|
8
|
+
{% for group, commits in commits | group_by(attribute="group") %}
|
|
9
|
+
### {{ group | striptags | trim }}
|
|
10
|
+
{% for commit in commits %}
|
|
11
|
+
- {% if commit.scope %}{{ commit.scope }}: {% endif %}{{ commit.message | split(pat="\n") | first | trim }}{% if commit.breaking %} (breaking){% endif %}\
|
|
12
|
+
{% endfor %}
|
|
13
|
+
{% endfor %}
|
|
14
|
+
"""
|
|
15
|
+
trim = false
|
|
16
|
+
|
|
17
|
+
[git]
|
|
18
|
+
conventional_commits = true
|
|
19
|
+
filter_unconventional = false
|
|
20
|
+
tag_pattern = "v[0-9].*"
|
|
21
|
+
commit_parsers = [
|
|
22
|
+
{ message = "^feat", group = "<!-- 0 -->New" },
|
|
23
|
+
{ message = "^fix", group = "<!-- 1 -->Fixed" },
|
|
24
|
+
{ message = "^perf", group = "<!-- 2 -->Faster" },
|
|
25
|
+
{ message = "^(chore|ci|build|test|style|docs|refactor)(\\(.*\\))?!?:", skip = true },
|
|
26
|
+
{ message = "^(Merge|Revert \"Merge)", skip = true },
|
|
27
|
+
{ message = ".*", group = "<!-- 3 -->Other" },
|
|
28
|
+
]
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Signed release builds on Codemagic (codemagic.io). One-time setup for each app: docs/ai/codemagic.md
|
|
2
|
+
# Both workflows start when a version tag is pushed (git push origin v1.2.0); you can also start them in Codemagic.
|
|
3
|
+
# Build numbers are set on the build machine only (one more than the store's latest), so the repo never needs a bump for them.
|
|
4
|
+
workflows:
|
|
5
|
+
android-release:
|
|
6
|
+
name: Android release
|
|
7
|
+
instance_type: mac_mini_m2
|
|
8
|
+
max_build_duration: 60
|
|
9
|
+
triggering: &on_version_tag
|
|
10
|
+
events:
|
|
11
|
+
- tag
|
|
12
|
+
tag_patterns:
|
|
13
|
+
- pattern: 'v*'
|
|
14
|
+
environment:
|
|
15
|
+
android_signing:
|
|
16
|
+
- upload_keystore
|
|
17
|
+
groups:
|
|
18
|
+
- google_play
|
|
19
|
+
node: 24
|
|
20
|
+
java: 17
|
|
21
|
+
scripts:
|
|
22
|
+
- name: Release check
|
|
23
|
+
script: node scripts/ai/release-check.js
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
script: sh scripts/ai/install-deps.sh
|
|
26
|
+
- name: Store release notes
|
|
27
|
+
script: cp "release-notes/${CM_TAG#v}/play-store.txt" release_notes.txt 2>/dev/null || true
|
|
28
|
+
- name: Build the signed app bundle
|
|
29
|
+
script: |
|
|
30
|
+
echo "sdk.dir=$ANDROID_SDK_ROOT" > android/local.properties
|
|
31
|
+
package=$(sed -n -E 's/.*applicationId( =)? "([^"]+)".*/\2/p' android/app/build.gradle* | head -1)
|
|
32
|
+
if last=$(google-play get-latest-build-number --package-name "$package") && [ -n "$last" ]; then code=$((last + 1)); else code=$BUILD_NUMBER; fi
|
|
33
|
+
# AGP 9 ignores injected version codes, so the number is written into build.gradle on this machine only
|
|
34
|
+
sed -i '' -E "s/versionCode( =)? [0-9]+/versionCode\1 $code/" android/app/build.gradle*
|
|
35
|
+
grep -qE "versionCode( =)? $code" android/app/build.gradle* || { echo "No versionCode number in android/app/build.gradle to set"; exit 1; }
|
|
36
|
+
# the upload key from Codemagic; build.gradle keeps debug signing for local release builds
|
|
37
|
+
cd android && ./gradlew bundleRelease \
|
|
38
|
+
-Pandroid.injected.signing.store.file="$CM_KEYSTORE_PATH" \
|
|
39
|
+
-Pandroid.injected.signing.store.password="$CM_KEYSTORE_PASSWORD" \
|
|
40
|
+
-Pandroid.injected.signing.key.alias="$CM_KEY_ALIAS" \
|
|
41
|
+
-Pandroid.injected.signing.key.password="$CM_KEY_PASSWORD"
|
|
42
|
+
artifacts:
|
|
43
|
+
- android/app/build/outputs/bundle/release/*.aab
|
|
44
|
+
publishing:
|
|
45
|
+
google_play:
|
|
46
|
+
credentials: $GOOGLE_PLAY_SERVICE_ACCOUNT_CREDENTIALS
|
|
47
|
+
track: internal
|
|
48
|
+
|
|
49
|
+
ios-release:
|
|
50
|
+
name: iOS release
|
|
51
|
+
instance_type: mac_mini_m2
|
|
52
|
+
max_build_duration: 60
|
|
53
|
+
triggering: *on_version_tag
|
|
54
|
+
integrations:
|
|
55
|
+
app_store_connect: codemagic
|
|
56
|
+
environment:
|
|
57
|
+
ios_signing:
|
|
58
|
+
distribution_type: app_store
|
|
59
|
+
bundle_identifier: {{IOS_BUNDLE_ID}}
|
|
60
|
+
vars:
|
|
61
|
+
APP_STORE_APPLE_ID: 0 # App Store Connect > the app > App Information > Apple ID
|
|
62
|
+
node: 24
|
|
63
|
+
xcode: latest
|
|
64
|
+
cocoapods: default
|
|
65
|
+
scripts:
|
|
66
|
+
- name: Release check
|
|
67
|
+
script: node scripts/ai/release-check.js
|
|
68
|
+
- name: Install dependencies
|
|
69
|
+
script: sh scripts/ai/install-deps.sh && cd ios && pod install
|
|
70
|
+
- name: Store release notes
|
|
71
|
+
script: |
|
|
72
|
+
notes="release-notes/${CM_TAG#v}/app-store.txt"
|
|
73
|
+
[ ! -f "$notes" ] || node -e 'const fs = require("fs"); fs.writeFileSync("release_notes.json", JSON.stringify([{ language: "en-US", text: fs.readFileSync(process.argv[1], "utf8").trim() }]))' "$notes"
|
|
74
|
+
- name: Use the signing files
|
|
75
|
+
script: xcode-project use-profiles
|
|
76
|
+
- name: Build the signed ipa
|
|
77
|
+
script: |
|
|
78
|
+
if last=$(app-store-connect get-latest-build-number "$APP_STORE_APPLE_ID") && [ -n "$last" ]; then build=$((last + 1)); else build=$BUILD_NUMBER; fi
|
|
79
|
+
(cd ios && agvtool new-version -all "$build")
|
|
80
|
+
workspace=$(ls -d ios/*.xcworkspace | head -1)
|
|
81
|
+
xcode-project build-ipa --workspace "$workspace" --scheme "$(basename "$workspace" .xcworkspace)"
|
|
82
|
+
artifacts:
|
|
83
|
+
- build/ios/ipa/*.ipa
|
|
84
|
+
- /tmp/xcodebuild_logs/*.log
|
|
85
|
+
publishing:
|
|
86
|
+
app_store_connect:
|
|
87
|
+
auth: integration
|
|
88
|
+
submit_to_testflight: true
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Signed release builds on Codemagic
|
|
2
|
+
|
|
3
|
+
`codemagic.yaml` has two workflows. `android-release` builds a signed app bundle and uploads it to Google Play's internal track. `ios-release` builds a signed ipa and uploads it to TestFlight. Both start when a version tag is pushed (`git push origin v1.2.0`), and you can start either one by hand in Codemagic.
|
|
4
|
+
|
|
5
|
+
Each build:
|
|
6
|
+
1. runs `node scripts/ai/release-check.js` and stops if it finds a problem;
|
|
7
|
+
2. sets the build number on the build machine: one more than the latest in the store, or Codemagic's build counter for a new app. Nothing is committed, so the repo keeps only the version name (for example 1.2.0), which you bump in the release PR;
|
|
8
|
+
3. uses `release-notes/<version>/play-store.txt` or `app-store.txt` as the store's "What's new" or TestFlight's "What to test", when the build comes from a tag;
|
|
9
|
+
4. signs with keys that Codemagic stores. The repo never holds them, and local release builds (`verify.sh`, the e2e CI) stay signed with the debug key.
|
|
10
|
+
|
|
11
|
+
## One-time setup for each app
|
|
12
|
+
|
|
13
|
+
You need admin rights in the Codemagic team (or your personal account). Menus are under **Team settings** for a team and under **Settings** for a personal account.
|
|
14
|
+
|
|
15
|
+
1. **Add the app:** Applications → Add application → choose the repository, then pick `codemagic.yaml` as the configuration.
|
|
16
|
+
2. **Android upload key:** codemagic.yaml settings → Code signing identities → Android keystores. Upload the app's upload keystore, enter its password, key alias and key password, and set the reference name to `upload_keystore`.
|
|
17
|
+
- A new app has no key yet. Create one with `keytool -genkeypair -keystore upload.jks -storetype PKCS12 -alias upload -keyalg RSA -keysize 2048 -validity 10000`, keep the file and password in your password manager, and turn on Play App Signing.
|
|
18
|
+
3. **Google Play access:**
|
|
19
|
+
- In Google Cloud, create a service account and download its JSON key.
|
|
20
|
+
- In Play Console → Users and permissions, invite it with release rights for the app.
|
|
21
|
+
- In Codemagic, open the app → Environment variables. Add `GOOGLE_PLAY_SERVICE_ACCOUNT_CREDENTIALS` with the JSON as its value, in a group named `google_play`, marked Secret.
|
|
22
|
+
- Upload the first build of a new app by hand in Play Console. If the app has never been published, add `submit_as_draft: true` under `google_play` in `codemagic.yaml`.
|
|
23
|
+
4. **App Store Connect API key:** in App Store Connect → Users and Access → Integrations → App Store Connect API, create a key with App Manager access. In Codemagic → Integrations → Developer Portal → Manage keys → Add key, name it `codemagic`, enter the Issuer ID and Key ID, and upload the `.p8` file.
|
|
24
|
+
5. **iOS certificate and profile:** codemagic.yaml settings → Code signing identities:
|
|
25
|
+
- iOS certificates → Generate certificate → Apple Distribution. Apple allows three per team, so reuse one that Codemagic created before.
|
|
26
|
+
- iOS provisioning profiles → Fetch profiles → the App Store profile for the app's bundle ID.
|
|
27
|
+
6. **Check `codemagic.yaml`:**
|
|
28
|
+
- `bundle_identifier` was filled in from the Xcode project.
|
|
29
|
+
- Set `APP_STORE_APPLE_ID` (App Store Connect → the app → App Information → Apple ID). Without it, the iOS build number falls back to Codemagic's build counter, which the store rejects if it's lower than an earlier upload.
|
|
30
|
+
|
|
31
|
+
Then start `android-release` by hand and check that the signed `.aab` appears in the build's artifacts. Do the same for `ios-release`.
|
|
32
|
+
|
|
33
|
+
## Apps with more than one target
|
|
34
|
+
|
|
35
|
+
When one repo ships several apps (for example a main app and a kiosk app, or product flavors), copy the workflow once per app. In each copy, set the bundle ID, the scheme (iOS) and the Gradle task and package (Android).
|
|
36
|
+
|
|
37
|
+
## Plan limits
|
|
38
|
+
|
|
39
|
+
The free personal plan includes 500 macOS minutes a month and runs one build at a time.
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
- Run at most 2 or 3 agents in parallel per person.
|
|
7
7
|
- Don't use "skip permissions", "YOLO" or auto-run modes in any tool.
|
|
8
8
|
- Keep secrets out of the repo folder; inject them at run time.
|
|
9
|
-
- Review the metrics and the `learn` changes once a month. Re-check `AGENTS.md` and `docs/ai/` after every React Native, Xcode or Android Gradle Plugin upgrade, and after switching AI models.
|
|
9
|
+
- Review the metrics and the `m-learn` changes (`git log --grep 'chore(learn)'`) once a month. Re-check `AGENTS.md` and `docs/ai/` after every React Native, Xcode or Android Gradle Plugin upgrade, and after switching AI models.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Release check for a bare React Native app: what App Store review, Play review or your users would catch.
|
|
3
|
+
// Usage: node scripts/ai/release-check.js [--since <git ref>]
|
|
4
|
+
// --since the previous release to compare with (default: the latest git tag)
|
|
5
|
+
// Exits 1 when something would get the release rejected or broken; warnings don't fail it.
|
|
6
|
+
'use strict';
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const { execFileSync } = require('child_process');
|
|
10
|
+
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
const argSince = args.includes('--since') ? args[args.indexOf('--since') + 1] : null;
|
|
13
|
+
|
|
14
|
+
const results = [];
|
|
15
|
+
const ok = (label, detail) => results.push({ level: 'ok', label, detail });
|
|
16
|
+
const info = (label, detail) => results.push({ level: 'info', label, detail });
|
|
17
|
+
const warn = (label, fix) => results.push({ level: 'warn', label, fix });
|
|
18
|
+
const fail = (label, fix) => results.push({ level: 'fail', label, fix });
|
|
19
|
+
|
|
20
|
+
const git = (...a) => { try { return execFileSync('git', a, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim(); } catch { return null; } };
|
|
21
|
+
const readNow = f => { try { return fs.readFileSync(f, 'utf8'); } catch { return null; } };
|
|
22
|
+
const readAt = (ref, f) => (ref ? git('show', `${ref}:${f}`) : null);
|
|
23
|
+
const stripComments = t => (t || '').replace(/\/\*[\s\S]*?\*\//g, '').replace(/(^|[^:])\/\/.*$/gm, '$1');
|
|
24
|
+
const uniq = a => [...new Set(a)];
|
|
25
|
+
const all = (re, text) => uniq([...(text || '').matchAll(re)].map(m => m[1].replace(/^"|"$/g, '').trim()));
|
|
26
|
+
const maxNum = a => Math.max(...a.map(Number).filter(n => !Number.isNaN(n)));
|
|
27
|
+
|
|
28
|
+
// a clean checkout of a release tag is that release being built (e.g. in CI): compare with the tag before it
|
|
29
|
+
const atTag = git('tag', '--points-at', 'HEAD') && git('status', '--porcelain') === '';
|
|
30
|
+
const since = argSince || git('describe', '--tags', '--abbrev=0', ...(atTag ? ['HEAD^'] : []));
|
|
31
|
+
|
|
32
|
+
// ---------- files ----------
|
|
33
|
+
const xcodeproj = (fs.readdirSync('ios', { withFileTypes: true }).find(e => e.isDirectory() && e.name.endsWith('.xcodeproj')) || {}).name;
|
|
34
|
+
const pbxPath = xcodeproj ? `ios/${xcodeproj}/project.pbxproj` : null;
|
|
35
|
+
const pbx = pbxPath ? readNow(pbxPath) : null;
|
|
36
|
+
const plists = all(/INFOPLIST_FILE = ([^;]+);/g, pbx).map(p => `ios/${p}`).filter(p => fs.existsSync(p));
|
|
37
|
+
const gradlePath = ['android/app/build.gradle', 'android/app/build.gradle.kts'].find(f => fs.existsSync(f));
|
|
38
|
+
const gradle = stripComments(readNow(gradlePath));
|
|
39
|
+
const manifestPath = 'android/app/src/main/AndroidManifest.xml';
|
|
40
|
+
const pkg = JSON.parse(readNow('package.json') || '{}');
|
|
41
|
+
// this kit's codemagic.yaml sets build numbers and the Android upload key on the build machine
|
|
42
|
+
const codemagic = readNow('codemagic.yaml') || '';
|
|
43
|
+
const ciBuildNumber = { iOS: /agvtool new-version/.test(codemagic), Android: /versionCode[^\n]*\$code/.test(codemagic) };
|
|
44
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
45
|
+
|
|
46
|
+
// ---------- 1. versions ----------
|
|
47
|
+
const iosVersions = t => all(/MARKETING_VERSION = ([^;]+);/g, t);
|
|
48
|
+
const iosBuilds = t => all(/CURRENT_PROJECT_VERSION = ([^;]+);/g, t);
|
|
49
|
+
const androidVersions = t => all(/versionName\s*=?\s*"([^"]+)"/g, stripComments(t));
|
|
50
|
+
const androidBuilds = t => all(/versionCode\s*=?\s*(\d+)/g, stripComments(t));
|
|
51
|
+
|
|
52
|
+
function compare(platform, now, before, kind) {
|
|
53
|
+
if (kind === 'build number' && ciBuildNumber[platform]) { info(`${platform} build number: set by Codemagic at build time`); return; }
|
|
54
|
+
if (!now.length) { warn(`${platform} ${kind}: couldn't read it`, 'check it by hand before you ship'); return; }
|
|
55
|
+
if (!before) { info(`${platform} ${kind}: ${now.join(', ')}`); return; }
|
|
56
|
+
if (!before.length || now.join() !== before.join()) {
|
|
57
|
+
if (kind === 'build number' && before.length && maxNum(now) < maxNum(before)) {
|
|
58
|
+
fail(`${platform} build number went down (${before.join(', ')} → ${now.join(', ')})`, 'stores reject a build number lower than the last upload');
|
|
59
|
+
} else ok(`${platform} ${kind}`, `${before.join(', ') || '?'} → ${now.join(', ')}`);
|
|
60
|
+
} else if (kind === 'build number') {
|
|
61
|
+
warn(`${platform} build number unchanged since ${since} (${now.join(', ')})`, 'bump it, unless your CI sets it (for example Codemagic); stores reject a repeated build number');
|
|
62
|
+
} else {
|
|
63
|
+
warn(`${platform} version unchanged since ${since} (${now.join(', ')})`, 'fine for a re-upload of the same version; otherwise bump it');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (!since) info('No previous release found (no git tag)', 'tag each release, e.g. v1.4.0, or pass --since <ref>, so the next check can compare');
|
|
68
|
+
if (pbx) {
|
|
69
|
+
compare('iOS', iosVersions(pbx), since && iosVersions(readAt(since, pbxPath)), 'version');
|
|
70
|
+
compare('iOS', iosBuilds(pbx), since && iosBuilds(readAt(since, pbxPath)), 'build number');
|
|
71
|
+
}
|
|
72
|
+
if (gradle) {
|
|
73
|
+
compare('Android', androidVersions(gradle), since && androidVersions(readAt(since, gradlePath)), 'version');
|
|
74
|
+
compare('Android', androidBuilds(gradle), since && androidBuilds(readAt(since, gradlePath)), 'build number');
|
|
75
|
+
}
|
|
76
|
+
if (pbx && gradle) {
|
|
77
|
+
const a = iosVersions(pbx), b = androidVersions(gradle);
|
|
78
|
+
if (a.length && b.length && !a.some(v => b.includes(v))) {
|
|
79
|
+
warn(`iOS shows version ${a.join(', ')}, Android shows ${b.join(', ')}`, 'users and support see different numbers; align them unless that\'s intended');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// ---------- 2. iOS privacy manifest ----------
|
|
84
|
+
if (pbx) {
|
|
85
|
+
const manifests = fs.readdirSync('ios', { withFileTypes: true })
|
|
86
|
+
.filter(e => e.isDirectory() && fs.existsSync(`ios/${e.name}/PrivacyInfo.xcprivacy`)).map(e => `ios/${e.name}/PrivacyInfo.xcprivacy`);
|
|
87
|
+
if (!manifests.length) fail('No PrivacyInfo.xcprivacy in the iOS app', 'Apple requires a privacy manifest; React Native\'s template ships one in ios/<App>/');
|
|
88
|
+
else if (!/PrivacyInfo\.xcprivacy/.test(pbx)) fail(`${manifests[0]} isn't in the Xcode project`, 'add it to the app target in Xcode so it ships in the build');
|
|
89
|
+
else ok('iOS privacy manifest', manifests.join(', '));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ---------- 3. iOS permission texts ----------
|
|
93
|
+
// libraries that make iOS ask for a permission, and the Info.plist text each one needs
|
|
94
|
+
const NEEDS = {
|
|
95
|
+
'react-native-vision-camera': ['NSCameraUsageDescription'],
|
|
96
|
+
'react-native-image-picker': ['NSCameraUsageDescription', 'NSPhotoLibraryUsageDescription'],
|
|
97
|
+
'react-native-image-crop-picker': ['NSCameraUsageDescription', 'NSPhotoLibraryUsageDescription'],
|
|
98
|
+
'@react-native-camera-roll/camera-roll': ['NSPhotoLibraryUsageDescription'],
|
|
99
|
+
'react-native-geolocation-service': ['NSLocationWhenInUseUsageDescription'],
|
|
100
|
+
'@react-native-community/geolocation': ['NSLocationWhenInUseUsageDescription'],
|
|
101
|
+
'react-native-location': ['NSLocationWhenInUseUsageDescription'],
|
|
102
|
+
'react-native-contacts': ['NSContactsUsageDescription'],
|
|
103
|
+
'react-native-ble-plx': ['NSBluetoothAlwaysUsageDescription'],
|
|
104
|
+
'react-native-ble-manager': ['NSBluetoothAlwaysUsageDescription'],
|
|
105
|
+
'react-native-kontaktio': ['NSBluetoothAlwaysUsageDescription', 'NSLocationWhenInUseUsageDescription'],
|
|
106
|
+
'react-native-nfc-manager': ['NFCReaderUsageDescription'],
|
|
107
|
+
'react-native-biometrics': ['NSFaceIDUsageDescription'],
|
|
108
|
+
'react-native-touch-id': ['NSFaceIDUsageDescription'],
|
|
109
|
+
'react-native-audio-recorder-player': ['NSMicrophoneUsageDescription'],
|
|
110
|
+
'@react-native-voice/voice': ['NSMicrophoneUsageDescription', 'NSSpeechRecognitionUsageDescription'],
|
|
111
|
+
};
|
|
112
|
+
const PLACEHOLDER = /^\s*$|\b(todo|tbd|lorem|placeholder|description here|your text)\b/i;
|
|
113
|
+
const usageTexts = f => Object.fromEntries([...(readNow(f) || '').matchAll(/<key>(\w+UsageDescription)<\/key>\s*<string>([^<]*)<\/string>/g)].map(m => [m[1], m[2]]));
|
|
114
|
+
const textsByPlist = Object.fromEntries(plists.map(f => [f, usageTexts(f)]));
|
|
115
|
+
const needed = Object.entries(NEEDS).filter(([lib]) => deps[lib]).flatMap(([lib, keys]) => keys.map(key => ({ lib, key })));
|
|
116
|
+
for (const plistPath of plists) {
|
|
117
|
+
const texts = textsByPlist[plistPath];
|
|
118
|
+
const problems = [];
|
|
119
|
+
for (const { lib, key } of needed) {
|
|
120
|
+
if (key in texts) continue;
|
|
121
|
+
// with several app targets (e.g. a kiosk app), one may legitimately not use a library
|
|
122
|
+
const elsewhere = plists.filter(p => p !== plistPath && key in textsByPlist[p]);
|
|
123
|
+
if (elsewhere.length) warn(`${plistPath}: no ${key}, which ${elsewhere[0]} has (${lib})`, `if this app uses ${lib}, add it; otherwise ignore`);
|
|
124
|
+
else problems.push(`${key} (${lib})`);
|
|
125
|
+
}
|
|
126
|
+
if (problems.length) fail(`${plistPath}: missing permission texts: ${uniq(problems).join(', ')}`, 'add each key with a sentence that says why the app needs it; without it iOS crashes on the permission request and review rejects the app (guideline 5.1.1)');
|
|
127
|
+
const neededKeys = needed.map(n => n.key);
|
|
128
|
+
for (const [key, text] of Object.entries(texts).filter(([, t]) => PLACEHOLDER.test(t))) {
|
|
129
|
+
if (neededKeys.includes(key)) fail(`${plistPath}: ${key} is ${text.trim() ? `a placeholder ("${text.trim()}")` : 'empty'}`, 'write a real reason users can understand');
|
|
130
|
+
else warn(`${plistPath}: ${key} is ${text.trim() ? 'a placeholder' : 'empty'}`, 'remove the key if the app doesn\'t use this permission; otherwise write a real reason');
|
|
131
|
+
}
|
|
132
|
+
if (!problems.length && !Object.values(texts).some(t => PLACEHOLDER.test(t))) ok(`${plistPath}: permission texts`, `${Object.keys(texts).length} present`);
|
|
133
|
+
const plist = readNow(plistPath);
|
|
134
|
+
if (/<key>NSAllowsArbitraryLoads<\/key>\s*<true\s*\/>/.test(plist)) {
|
|
135
|
+
warn(`${plistPath}: NSAllowsArbitraryLoads is true (any HTTP allowed)`, 'App Review may ask why; allow only the domains that need it (NSExceptionDomains)');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// ---------- 4. Android permissions ----------
|
|
140
|
+
const SENSITIVE = /\.(ACCESS_(FINE|COARSE|BACKGROUND)_LOCATION|CAMERA|RECORD_AUDIO|READ_CONTACTS|WRITE_CONTACTS|READ_EXTERNAL_STORAGE|WRITE_EXTERNAL_STORAGE|READ_MEDIA_\w+|BLUETOOTH_SCAN|BLUETOOTH_CONNECT|POST_NOTIFICATIONS|READ_PHONE_STATE|BODY_SENSORS|READ_CALENDAR|WRITE_CALENDAR|ACCESS_MEDIA_LOCATION)$/;
|
|
141
|
+
const perms = t => all(/<uses-permission[^>]*android:name="([^"]+)"/g, t);
|
|
142
|
+
const permsNow = perms(readNow(manifestPath));
|
|
143
|
+
if (since && readAt(since, manifestPath) !== null) {
|
|
144
|
+
const before = perms(readAt(since, manifestPath));
|
|
145
|
+
const added = permsNow.filter(p => !before.includes(p));
|
|
146
|
+
const removed = before.filter(p => !permsNow.includes(p));
|
|
147
|
+
if (added.some(p => SENSITIVE.test(p))) {
|
|
148
|
+
warn(`New Android permissions since ${since}: ${added.join(', ')}`, 'update the Play Console data safety form, and explain the permission in the app before asking');
|
|
149
|
+
} else if (added.length) info(`New Android permissions since ${since}: ${added.join(', ')}`);
|
|
150
|
+
else ok('No new Android permissions', removed.length ? `removed: ${removed.join(', ')}` : '');
|
|
151
|
+
} else if (permsNow.some(p => SENSITIVE.test(p))) {
|
|
152
|
+
info('Android permissions that the Play data safety form must cover', permsNow.filter(p => SENSITIVE.test(p)).map(p => p.split('.').pop()).join(', '));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// ---------- 5. debug leftovers ----------
|
|
156
|
+
// the body of `name { … }` inside text, found by matching braces (Gradle blocks nest)
|
|
157
|
+
function block(text, name) {
|
|
158
|
+
const m = new RegExp(`(^|\\W)${name}\\s*\\{`).exec(text || '');
|
|
159
|
+
if (!m) return '';
|
|
160
|
+
let depth = 0;
|
|
161
|
+
for (let i = m.index + m[0].length - 1; i < text.length; i++) {
|
|
162
|
+
if (text[i] === '{') depth++;
|
|
163
|
+
else if (text[i] === '}' && --depth === 0) return text.slice(m.index + m[0].length, i);
|
|
164
|
+
}
|
|
165
|
+
return '';
|
|
166
|
+
}
|
|
167
|
+
const releaseBlock = block(block(gradle, 'buildTypes'), 'release');
|
|
168
|
+
if (/debuggable\s*=?\s*true/.test(releaseBlock)) fail('Android release build is debuggable', 'remove "debuggable true" from buildTypes.release; Play rejects debuggable apps');
|
|
169
|
+
if (/android\.injected\.signing/.test(codemagic)) ok('Android release signing', 'Codemagic signs with the upload key');
|
|
170
|
+
else if (/signingConfig\s*=?\s*signingConfigs\.debug/.test(releaseBlock)) {
|
|
171
|
+
warn('Android release build is signed with the debug key', 'fine only if your release pipeline (for example Codemagic) re-signs it; Play rejects debug-signed uploads');
|
|
172
|
+
}
|
|
173
|
+
if (/android:usesCleartextTraffic="true"/.test(readNow(manifestPath) || '')) {
|
|
174
|
+
warn('Android allows cleartext (HTTP) traffic', 'allow only the domains that need it (network security config)');
|
|
175
|
+
}
|
|
176
|
+
const debuggers = (git('grep', '-n', '-E', '^[[:space:]]*debugger;?[[:space:]]*$', '--', '*.js', '*.jsx', '*.ts', '*.tsx') || '').split('\n').filter(Boolean);
|
|
177
|
+
if (debuggers.length) fail(`"debugger" statements left in code: ${debuggers.slice(0, 3).join(', ')}${debuggers.length > 3 ? ' …' : ''}`, 'remove them');
|
|
178
|
+
else ok('No "debugger" statements');
|
|
179
|
+
|
|
180
|
+
// ---------- 6. store notes ----------
|
|
181
|
+
const LIMITS = { 'play-store': 500, 'app-store': 4000 };
|
|
182
|
+
const noteFiles = fs.existsSync('release-notes') ? (git('ls-files', '--others', '--cached', '--exclude-standard', 'release-notes') || '').split('\n').filter(Boolean) : [];
|
|
183
|
+
for (const f of noteFiles) {
|
|
184
|
+
const kind = Object.keys(LIMITS).find(k => path.basename(f).startsWith(k));
|
|
185
|
+
if (!kind) continue;
|
|
186
|
+
const len = [...readNow(f).trim()].length;
|
|
187
|
+
if (len > LIMITS[kind]) fail(`${f} is ${len} characters (limit ${LIMITS[kind]})`, 'shorten it; the store rejects longer release notes');
|
|
188
|
+
else ok(`${f}`, `${len}/${LIMITS[kind]} characters`);
|
|
189
|
+
}
|
|
190
|
+
if (!noteFiles.length) info('No store release notes yet', 'run the m-release skill to write them from the changelog');
|
|
191
|
+
|
|
192
|
+
// ---------- report ----------
|
|
193
|
+
const icon = { ok: '✓', info: '·', warn: '!', fail: '✗' };
|
|
194
|
+
console.log(`Release check${since ? ` (compared with ${since})` : ''}`);
|
|
195
|
+
for (const r of results) {
|
|
196
|
+
console.log(` ${icon[r.level]} ${r.label}${r.detail ? ` (${r.detail})` : ''}`);
|
|
197
|
+
if (r.fix) console.log(` → ${r.fix}`);
|
|
198
|
+
}
|
|
199
|
+
const failures = results.filter(r => r.level === 'fail').length;
|
|
200
|
+
const warnings = results.filter(r => r.level === 'warn').length;
|
|
201
|
+
console.log(`\n${failures} problem(s), ${warnings} warning(s).`);
|
|
202
|
+
process.exitCode = failures ? 1 : 0;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Sets the version users see on both platforms: iOS MARKETING_VERSION and Android versionName.
|
|
3
|
+
# Build numbers are left alone (codemagic.yaml sets them at build time).
|
|
4
|
+
# Usage: sh scripts/ai/set-version.sh 1.4.0
|
|
5
|
+
set -eu
|
|
6
|
+
v=${1:-}
|
|
7
|
+
echo "$v" | grep -qE '^[0-9]+\.[0-9]+(\.[0-9]+)?$' || { echo "usage: sh scripts/ai/set-version.sh <version, e.g. 1.4.0>" >&2; exit 1; }
|
|
8
|
+
pbx=$(ls ios/*.xcodeproj/project.pbxproj | head -1)
|
|
9
|
+
gradle=$(ls android/app/build.gradle android/app/build.gradle.kts 2>/dev/null | head -1)
|
|
10
|
+
|
|
11
|
+
# several apps in one project (targets or flavors with their own versions): a person decides each one
|
|
12
|
+
[ -z "$(grep -oE 'MARKETING_VERSION = [^;]+' "$pbx" | sort -u | sed -n 2p)" ] || { echo "$pbx has several app versions; set each one in Xcode" >&2; exit 1; }
|
|
13
|
+
[ -z "$(grep -oE 'versionName( =)? "[^"]+"' "$gradle" | sort -u | sed -n 2p)" ] || { echo "$gradle has several versionName values; set each one by hand" >&2; exit 1; }
|
|
14
|
+
|
|
15
|
+
sed -i '' -E "s/MARKETING_VERSION = [^;]+;/MARKETING_VERSION = $v;/" "$pbx"
|
|
16
|
+
sed -i '' -E "s/versionName( =)? \"[^\"]+\"/versionName\1 \"$v\"/" "$gradle"
|
|
17
|
+
grep -q "MARKETING_VERSION = $v;" "$pbx" || { echo "No MARKETING_VERSION in $pbx; set the version in Xcode" >&2; exit 1; }
|
|
18
|
+
grep -qE "versionName( =)? \"$v\"" "$gradle" || { echo "No versionName in $gradle; set it by hand" >&2; exit 1; }
|
|
19
|
+
plutil -lint -s "$pbx"
|
|
20
|
+
echo "Version $v set in $pbx and $gradle."
|