-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport.mjs
More file actions
executable file
·26 lines (21 loc) · 867 Bytes
/
export.mjs
File metadata and controls
executable file
·26 lines (21 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env zx
import {python} from './common.mjs';
await fs.emptyDir('dist')
// Copy headers.
const headers = await glob([
'executorch/extension/data_loader/**/*.h',
'executorch/extension/module/**/*.h',
'executorch/extension/tensor/**/*.h',
'executorch/runtime/**/*.h',
'executorch/schema/**/*.h',
])
await Promise.all(headers.map(h => fs.copy(h, `dist/include/${h}`)))
// Copy static libs.
const libs = await glob('out/**/*.a')
await Promise.all(libs.map(l => fs.copy(l, `dist/libs/${path.basename(l)}`)))
// Zip files.
const [ config, targetArch, targetOs ] = String(await fs.readFile('out/.stamp')).split('\n')
const name = `executorch-full-${config.toLowerCase()}-${targetOs}-${targetArch}`
await fs.copy('out/.stamp', 'dist/.stamp')
await $`${python} -c "import shutil; shutil.make_archive('${name}', 'zip', 'dist')"`
await fs.remove('dist')