mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
34 lines
930 B
TypeScript
34 lines
930 B
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);
|
|
|
|
console.log('[*] graphql...');
|
|
execSync(
|
|
`${PackageRoot}/App/Packages/AffineGraphQL/apollo-ios-cli generate --path ${PackageRoot}/apollo-codegen-config.json`,
|
|
{ stdio: 'inherit' }
|
|
);
|
|
|
|
console.log('[*] rust...');
|
|
execSync(
|
|
'cargo build -p affine_mobile_native --lib --release --target aarch64-apple-ios',
|
|
{
|
|
stdio: 'inherit',
|
|
}
|
|
);
|
|
|
|
execSync(
|
|
`cargo run -p affine_mobile_native --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');
|