Files
AFFiNE-Mirror/packages/frontend/apps/ios/codegen.ts
T
DarkSky 5a6c65085a feat(mobile): adapt new endpoint (#14778)
#### PR Dependency Tree


* **PR #14778** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
2026-04-04 20:39:42 +08:00

36 lines
1.0 KiB
TypeScript

import { execSync } from 'node:child_process';
import { ProjectRoot } from '@affine-tools/utils/path';
import { Package } from '@affine-tools/utils/workspace';
const iosPackage = new Package('@affine/ios');
const PackageRoot = iosPackage.path;
console.log('[*] PackageRoot', PackageRoot);
const version = process.argv[2] || '1.25.4'; // Default to 1.25.4 if no version provided
console.log('[*] graphql...');
execSync(`${PackageRoot}/apollo-codegen-chore.sh "${version}"`, {
stdio: 'inherit',
});
console.log('[*] rust...');
execSync(
'cargo build -p affine_mobile_native --features use-as-lib --lib --release --target aarch64-apple-ios',
{
stdio: 'inherit',
env: { ...process.env, IPHONEOS_DEPLOYMENT_TARGET: '16.5' },
}
);
execSync(
`cargo run -p affine_mobile_native --features use-as-lib --bin uniffi-bindgen generate \
--library ${ProjectRoot}/target/aarch64-apple-ios/release/libaffine_mobile_native.a \
--language swift --out-dir ${PackageRoot}/App/App/uniffi`,
{ stdio: 'inherit' }
);
console.log('[+] codegen complete');