2024-01-26 17:35:43 -05:00
|
|
|
#!/usr/bin/env -S deno run --allow-read --allow-write
|
2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2022-10-15 11:21:04 -04:00
|
|
|
|
2024-07-22 20:01:31 -04:00
|
|
|
import exports from "../../cli/napi/sym/symbol_exports.json" with {
|
2022-10-15 11:21:04 -04:00
|
|
|
type: "json",
|
|
|
|
};
|
|
|
|
|
2022-10-16 18:53:35 -04:00
|
|
|
const symbolExportLists = {
|
|
|
|
linux: `{ ${exports.symbols.map((s) => `"${s}"`).join("; ")}; };`,
|
|
|
|
windows: `LIBRARY\nEXPORTS\n${
|
|
|
|
exports.symbols
|
|
|
|
.map((symbol) => " " + symbol)
|
|
|
|
.join("\n")
|
|
|
|
}`,
|
|
|
|
macos: exports.symbols.map((symbol) => "_" + symbol).join("\n"),
|
|
|
|
};
|
2022-10-15 11:21:04 -04:00
|
|
|
|
2022-10-16 18:53:35 -04:00
|
|
|
for await (const [os, def] of Object.entries(symbolExportLists)) {
|
2022-10-15 11:21:04 -04:00
|
|
|
const defUrl = new URL(
|
2024-07-22 20:01:31 -04:00
|
|
|
`../../cli/napi/generated_symbol_exports_list_${os}.def`,
|
2022-10-15 11:21:04 -04:00
|
|
|
import.meta.url,
|
|
|
|
);
|
|
|
|
await Deno.writeTextFile(defUrl.pathname, def, { create: true });
|
|
|
|
}
|