Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Commit 1090570

Browse files
committed
Fix generate-types.sh to use openiap-versions.json and remove FetchProductsResultAll
- Update generate-types.sh to read gql version from openiap-versions.json - Remove hardcoded version 1.0.8 from script - Remove FetchProductsResultAll from Types.kt to match upstream schema
1 parent 4fc28e9 commit 1090570

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

openiap/src/main/java/dev/hyo/openiap/Types.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,6 @@ public data class FetchProductsResultProducts(val value: List<Product>?) : Fetch
562562

563563
public data class FetchProductsResultSubscriptions(val value: List<ProductSubscription>?) : FetchProductsResult
564564

565-
public data class FetchProductsResultAll(val products: List<Product>?, val subscriptions: List<ProductSubscription>?) : FetchProductsResult
566-
567565
public data class PricingPhaseAndroid(
568566
val billingCycleCount: Int,
569567
val billingPeriod: String,

scripts/generate-types.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
VERSION="1.0.8"
4+
VERSION=""
55
SKIP_DOWNLOAD=false
66

77
while [[ $# -gt 0 ]]; do
@@ -47,7 +47,14 @@ REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
4747
TARGET_DIR="${REPO_ROOT}/openiap/src/main/java/dev/hyo/openiap"
4848
TARGET_FILE="${TARGET_DIR}/Types.kt"
4949
VERSION_FILE="${REPO_ROOT}/VERSION"
50+
VERSIONS_JSON="${REPO_ROOT}/openiap-versions.json"
5051

52+
# Try to get version from openiap-versions.json first
53+
if [[ -z "$VERSION" ]] && [[ -f "$VERSIONS_JSON" ]]; then
54+
VERSION="$(python3 -c "import json; print(json.load(open('$VERSIONS_JSON'))['gql'])" 2>/dev/null || true)"
55+
fi
56+
57+
# Fall back to VERSION file if not found
5158
if [[ -z "$VERSION" ]] && [[ -f "$VERSION_FILE" ]]; then
5259
VERSION="$(head -n1 "$VERSION_FILE" | tr -d ' \r')"
5360
fi

0 commit comments

Comments
 (0)