MCPcopy Index your code
hub / github.com/Moddable-OpenSource/moddable / run

Method run

tools/mcrun.js:483–623  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

481 }
482 }
483 run() {
484 this.toolName = "mcrun";
485 this.localsName = "modLocals";
486 super.run();
487
488 if (this.manifest.preload?.length) {
489 trace("Warning: preload is unavailable in mods. These modules request preload:\n")
490 this.manifest.preload.forEach(item => trace(` ${item}\n`));
491 }
492
493 if (this.cFiles?.length) {
494 trace("Native code detected:\n")
495 this.cFiles.forEach(item => trace(` ${item.source}\n`));
496 trace("Mods cannot contain native code. Did you intend to build using mcconfig?\n")
497 throw new Error("mod cannot contain native code")
498 }
499
500 if ("URL" in this.config)
501 this.environment.URL = this.config.URL;
502
503 if (this.manifest.config) {
504 const commandLine = this.config;
505 this.config = {...this.manifest.config};
506 this.mergeProperties(this.config, commandLine);
507 }
508
509 this.filterRun(this.manifest.run);
510 this.creation = null;
511 this.defines = null;
512 this.preloads = null;
513 this.recipes = null;
514 this.strip = this.manifest.strip;
515 this.typescript = this.manifest.typescript;
516
517 let check = true;
518
519 if (this.rotation === undefined)
520 this.rotation = this.config.rotation ?? 0;
521 if (this.format === "UNDEFINED") {
522 if ("x" === this.config.format)
523 check = false;
524 this.format = (this.config.format ?? "rgb565le").toLowerCase();
525 }
526 else
527 check = "x" !== this.format;
528
529 var name = this.environment.NAME
530 this.binPath = this.createDirectories(this.outputPath, "bin", name);
531 this.tmpPath = this.createDirectories(this.outputPath, "tmp", name);
532
533 var path = this.tmpPath + this.slash + "files";
534 this.dataPath = this.modulesPath = this.resourcesPath = path;
535 this.createDirectory(path);
536 for (var folder of this.dataFolders)
537 this.createFolder(path, folder);
538 for (var folder of this.jsFolders)
539 this.createFolder(path, folder);
540 for (var folder of this.resourcesFolders)

Callers

nothing calls this directly

Calls 11

mcRunMethod · 0.95
mergePropertiesMethod · 0.80
filterRunMethod · 0.80
createFolderMethod · 0.80
findMethod · 0.80
keysMethod · 0.80
runMethod · 0.65
createDirectoriesMethod · 0.45
createDirectoryMethod · 0.45
generateMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected