You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2a098b1
Browse filesBrowse the repository at this point in the historyBrowse files
feat: the Android core comes from its release asset, pinned by version and checksum (#29)
* feat: the Android core comes from its release asset, pinned by version and checksum
The Android module took com.hotcodepush:core-android by full sha from core-android's maven branch, which every customer build read from raw.githubusercontent.com.
It now takes the Maven-layout zip of the 0.1.0 release: package.json pins its version and SHA-256 under hotcodepush.coreAndroid, and scripts/download-core-android.mjs checks the checksum and unpacks it into an ignored local Maven repository that ships in the npm package.
The script refuses a Gradle file that names another version than the pin, and the maven branch stays the development pin only.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* docs: the release asset is the path, not a stop on the way to Maven Central
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,13 +15,14 @@ ios/ the Turbo Module (Objective-C
15
15
android/src/main/java/com/hotcodepush/reactnative the Turbo Module, the runtime, the first-render listener, the bundle loader, the reader of the embedded bundle and the React host over com.hotcodepush:core-android
16
16
android/src/test/java/com/hotcodepush/reactnative the Robolectric tests of the Android runtime and the Turbo Module, which verify:android runs
17
17
android/settings.gradle the library's own build, which takes React Native's Gradle plugin and react-android's version from node_modules
18
-
android/hotcodepush.gradle the task that runs binary create for every variant, and core-android's maven branch among `:app`'s repositories; applied by the app's build.gradle
18
+
android/hotcodepush.gradle the task that runs binary create for every variant, and the package's local Maven repository among `:app`'s repositories; applied by the app's build.gradle
19
19
scripts/binary-create-xcode.sh binary create as the app's Xcode phase runs it
20
+
scripts/download-core-android.mjs the core's Maven-layout zip into the ignored android/libs/m2, which both Gradle scripts read
20
21
scripts/download-core-ios.mjs the core's XCFramework into the ignored ios/Frameworks, which the pod vendors
21
22
benchmarks/ the size and cold-start baseline, measured on the demo
22
23
```
23
24
24
-
The native cores live in `core-ios` and `core-android`. `core-ios` is the XCFramework of a release: `package.json` pins its URL and checksum under `hotcodepush.coreIos`, and `scripts/download-core-ios.mjs` unpacks it into the ignored `ios/Frameworks` for the pod's `vendored_frameworks`, so the app's Podfile names no core. The Android library comes from core-android's `maven` branch by full sha in `android/build.gradle`; a core change lands there first and arrives here as a bump of both pins.
25
+
The native cores live in `core-ios` and `core-android`. `core-ios` is the XCFramework of a release: `package.json` pins its URL and checksum under `hotcodepush.coreIos`, and `scripts/download-core-ios.mjs` unpacks it into the ignored `ios/Frameworks` for the pod's `vendored_frameworks`, so the app's Podfile names no core. The Android module is the Maven-layout zip of a release, `core-android-<version>-maven.zip`: `package.json` pins its version and the zip's SHA-256 under `hotcodepush.coreAndroid`, and `scripts/download-core-android.mjs` unpacks it into the ignored `android/libs/m2`, the local Maven repository that `android/build.gradle` and the app's `android/hotcodepush.gradle` read. A bump of the core is a new version in `package.json` and in `android/build.gradle`, which the script checks against each other, and the checksum from the summary of core-android's release job. core-android's `maven` branch, pinned by full sha, is the development pin only, for trying a core change before its release; a published build never names it.
25
26
This package keeps what is React Native's: which bundle the host loads, the reload, the readiness signal and the bridge. Nothing of the protocol lives here.
26
27
27
28
## How the SDK meets React Native
@@ -37,14 +38,14 @@ This package keeps what is React Native's: which bundle the host loads, the relo
|`npm run build`| the TypeScript into `dist/`; writes the SDK version from `package.json` into `SdkVersion.swift` and `SdkVersion.kt` and downloads the core's XCFramework, all ignored, so a fresh checkout runs it before opening the native projects |
46
-
|`npm run verify`| lint, typecheck, the Vitest tests and the build |
47
-
|`npm run verify:android`| Gradle builds, lints and unit-tests the Android library on its own, Robolectric; needs a JDK and the Android SDK |
|`npm run build`| the TypeScript into `dist/`; writes the SDK version from `package.json` into `SdkVersion.swift` and `SdkVersion.kt` and downloads the cores, the XCFramework and the Android Maven repository, all ignored, so a fresh checkout runs it before opening the native projects |
47
+
|`npm run verify`| lint, typecheck, the Vitest tests and the build |
48
+
|`npm run verify:android`| Gradle builds, lints and unit-tests the Android library on its own, Robolectric; needs a JDK and the Android SDK |
48
49
49
50
Run `npm run fmt` before every commit.
50
51
The iOS code compiles only inside an app: `ci.yml` builds the demo with the package from the commit, packed after `npm run build` so the pod carries the core; `benchmarks/prepare-demo.mjs` drops a core pod line the demo's Podfile still pins. The Android library also builds on its own: `android/settings.gradle` resolves React Native from the devDependency, so Codegen runs on the host, and `verify:android` runs its Robolectric tests in their own `ci.yml` job.
// Gradle cannot check a release asset's checksum before it resolves the core from it.
15
+
// So every build fetches the release asset that package.json pins under hotcodepush.coreAndroid, checks its checksum and unpacks it into the ignored local Maven repository that android/build.gradle and android/hotcodepush.gradle name.
0 commit comments