mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
It would cause the napi-derive not work as expect in workspace level <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Improved internal handling and type definitions for document parsing, resulting in clearer and more maintainable data structures. - **Chores** - Introduced a new feature flag for mobile native builds, enabling conditional compilation for enhanced flexibility across Android and iOS. - Updated build scripts to support the new feature flag for both Android and iOS platforms. - Updated iOS app dependencies to newer versions, including Apollo iOS, ChidoriMenu, and swift-collections, and removed SQLite.swift. - **Tests** - Enhanced Rust linting and testing workflows to run selectively across workspace packages with the new feature flag enabled. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
34 lines
974 B
TypeScript
34 lines
974 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 --features use-as-lib --lib --release --target aarch64-apple-ios',
|
|
{
|
|
stdio: 'inherit',
|
|
}
|
|
);
|
|
|
|
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');
|