[bazel] Run nodejs inside of bazel for genrules (#1948)

This commit is contained in:
Keith Smiley
2024-02-07 13:29:06 -05:00
committed by GitHub
parent f9c6c9c2be
commit 5cd2f73d77
24 changed files with 2910 additions and 179 deletions

View File

@@ -204,7 +204,7 @@ const args = (() => {
});
parser.add_argument("--root", "--r", {
help: "Directory root to place generated code",
required: true
required: false
});
parser.add_argument("--compress", "--c", {
help: "Compress shader text with zlib and output byte arrays instead of strings",
@@ -220,8 +220,9 @@ const args = (() => {
// Generate shader source headers
const shaderRoot = "shaders/";
const outputRoot = path.join((args.root ? args.root : ""), "include/mbgl/shaders");
const root = args.root ? args.root : path.dirname(__dirname);
const shaderRoot = path.join(root, "shaders");
const outputRoot = path.join(root, "include/mbgl/shaders");
let generatedHeaders = [];
let shaderNames = [];
@@ -319,4 +320,4 @@ struct ShaderSource<BuiltIn::None, gfx::Backend::Type::OpenGL> {
} // namespace mbgl
`);
console.log("Shaders generated!");
console.log("Shaders generated!");