1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-13 02:52:54 -05:00
denoland-deno/tools/napi/generate_symbols_lists.js
David Sherret 10e4b2e140
chore: update copyright year to 2023 (#17247)
Yearly tradition of creating extra noise in git.
2023-01-02 21:00:42 +00:00

24 lines
765 B
JavaScript
Executable file

#!/usr/bin/env -S deno run --unstable --allow-read --allow-write
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import exports from "../../cli/napi/sym/symbol_exports.json" assert {
type: "json",
};
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"),
};
for await (const [os, def] of Object.entries(symbolExportLists)) {
const defUrl = new URL(
`../../cli/napi/generated_symbol_exports_list_${os}.def`,
import.meta.url,
);
await Deno.writeTextFile(defUrl.pathname, def, { create: true });
}