Skip to content

Commit 773ba64

Browse files
authored
refactor(google): unify horizon and play flavors with independent deps (#19)
Completely separated Horizon and Play flavors by moving all flavor-specific code to independent source sets (src/horizon and src/play), unified both flavors to use identical package names (dev.hyo.openiap) and class names (OpenIapModule), standardized constructor signatures to remove appId parameter (Horizon reads from AndroidManifest.xml instead), and replaced GlobalScope with scoped CoroutineScope for proper lifecycle management and memory safety. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * VS Code workspace: recommended extensions, launch configs, settings and tasks for iOS/Android/GraphQL. * Android ViewModel added for easier billing UI integration. * New Alternative Billing Mode to support alternative billing flows. * **Documentation** * Horizon setup updated: explicit build-flavor selection (Play default) instead of automatic detection. * **Refactor** * Billing flavor handling streamlined; Play is now the default and Horizon wiring consolidated. * **Bug Fixes** * Error messages/codes standardized for billing-related errors. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent e769f09 commit 773ba64

35 files changed

Lines changed: 1062 additions & 513 deletions

.github/workflows/ci.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ jobs:
2222
bun-version: 1.1.0
2323

2424
- name: Install dependencies
25-
run: bun install
25+
run: |
26+
# Retry bun install up to 3 times to handle transient registry errors
27+
for i in 1 2 3; do
28+
bun install && break
29+
[ $i -eq 3 ] && exit 1
30+
echo "Attempt $i failed. Retrying..."
31+
sleep 5
32+
done
2633
2734
- name: Generate types
2835
working-directory: packages/gql
@@ -56,7 +63,14 @@ jobs:
5663
bun-version: 1.1.0
5764

5865
- name: Install dependencies
59-
run: bun install
66+
run: |
67+
# Retry bun install up to 3 times to handle transient registry errors
68+
for i in 1 2 3; do
69+
bun install && break
70+
[ $i -eq 3 ] && exit 1
71+
echo "Attempt $i failed. Retrying..."
72+
sleep 5
73+
done
6074
6175
- name: Generate types
6276
working-directory: packages/google
@@ -88,7 +102,14 @@ jobs:
88102
bun-version: 1.1.0
89103

90104
- name: Install dependencies
91-
run: bun install
105+
run: |
106+
# Retry bun install up to 3 times to handle transient registry errors
107+
for i in 1 2 3; do
108+
bun install && break
109+
[ $i -eq 3 ] && exit 1
110+
echo "Attempt $i failed. Retrying..."
111+
sleep 5
112+
done
92113
93114
- name: Generate types
94115
working-directory: packages/apple
@@ -115,7 +136,14 @@ jobs:
115136
bun-version: 1.1.0
116137

117138
- name: Install dependencies
118-
run: bun install
139+
run: |
140+
# Retry bun install up to 3 times to handle transient registry errors
141+
for i in 1 2 3; do
142+
bun install && break
143+
[ $i -eq 3 ] && exit 1
144+
echo "Attempt $i failed. Retrying..."
145+
sleep 5
146+
done
119147
120148
- name: Type check
121149
working-directory: packages/docs

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ packages/apple/Sources/openiap-versions.json
1818
Thumbs.db
1919

2020
# IDE
21-
.vscode/
2221
.idea/
2322
*.swp
2423
*.swo

.vscode/extensions.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"recommendations": [
3+
"vscjava.vscode-java-pack",
4+
"vscjava.vscode-gradle",
5+
"sswg.swift-lang",
6+
"oven.bun-vscode",
7+
"dbaeumer.vscode-eslint",
8+
"esbenp.prettier-vscode"
9+
]
10+
}

.vscode/launch.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node-terminal",
6+
"request": "launch",
7+
"name": "🍎 Open Apple (iOS) in Xcode",
8+
"command": "open Example/Martie.xcodeproj",
9+
"cwd": "${workspaceFolder}/packages/apple"
10+
},
11+
{
12+
"name": "🤖 Open Google (Android) in Android Studio",
13+
"type": "node",
14+
"request": "launch",
15+
"runtimeExecutable": "bash",
16+
"runtimeArgs": [
17+
"-lc",
18+
"./scripts/open-android-studio.sh"
19+
],
20+
"cwd": "${workspaceFolder}/packages/google",
21+
"console": "integratedTerminal"
22+
},
23+
{
24+
"type": "node-terminal",
25+
"request": "launch",
26+
"name": "📝 GQL: Generate Types",
27+
"command": "bun run generate",
28+
"cwd": "${workspaceFolder}/packages/gql"
29+
},
30+
{
31+
"type": "node-terminal",
32+
"request": "launch",
33+
"name": "📚 Docs: Dev Server",
34+
"command": "bun run dev",
35+
"cwd": "${workspaceFolder}/packages/docs"
36+
}
37+
]
38+
}

.vscode/settings.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"cSpell.words": [
3+
"hyodotdev",
4+
"openiap"
5+
],
6+
"files.associations": {
7+
"*.podspec": "ruby"
8+
},
9+
"files.exclude": {
10+
"**/.build": true,
11+
"**/.gradle": true,
12+
"**/build": true,
13+
"**/node_modules": true,
14+
"**/.DS_Store": true
15+
},
16+
"search.exclude": {
17+
"**/node_modules": true,
18+
"**/.build": true,
19+
"**/.gradle": true,
20+
"**/build": true,
21+
"**/dist": true
22+
},
23+
"[typescript]": {
24+
"editor.defaultFormatter": "esbenp.prettier-vscode",
25+
"editor.formatOnSave": true
26+
},
27+
"[javascript]": {
28+
"editor.defaultFormatter": "esbenp.prettier-vscode",
29+
"editor.formatOnSave": true
30+
},
31+
"[json]": {
32+
"editor.defaultFormatter": "esbenp.prettier-vscode",
33+
"editor.formatOnSave": true
34+
},
35+
"[swift]": {
36+
"editor.tabSize": 4,
37+
"editor.insertSpaces": true
38+
},
39+
"[kotlin]": {
40+
"editor.tabSize": 4,
41+
"editor.insertSpaces": true
42+
},
43+
"java.configuration.updateBuildConfiguration": "automatic"
44+
}

0 commit comments

Comments
 (0)