MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / generateDataRules

Method generateDataRules

tools/mcmanifest.js:149–178  ·  view source on GitHub ↗
(tool)

Source from the content-addressed store, hash-verified

147 this.line("");
148 }
149 generateDataRules(tool) {
150 for (var result of tool.dataFiles) {
151 var source = result.source;
152 var target = result.target;
153 if (tool.platform == "zephyr") {
154 var output = "${DATA_DIR}/" + target;
155 //@@
156 this.line("add_custom_command(");
157 this.line("\tOUTPUT " + output);
158 this.line("\tCOMMAND ${CMAKE_COMMAND} -E copy " + source + " " + output )
159 this.line("\tDEPENDS " + source);
160 this.line("\tVERBATIM)");
161 this.line("");
162 }
163 else {
164 this.line("$(DATA_DIR)", tool.slash, target, ": ", source);
165 this.echo(tool, "copy ", target);
166 if (tool.windows)
167 this.line("\tcopy /Y $** $@");
168 else
169 this.line("\tcp $< $@");
170 }
171 }
172 tool.nodeRedExtracts?.forEach((source, target) => {
173 this.line("$(DATA_DIR)", tool.slash, target, ": ", source);
174 this.echo(tool, "extract from Node-RED ", target);
175 this.line(`\tnodered2mcu -e ${target} -o $(@D) ${source}`);
176 });
177 this.line("");
178 }
179 setConfigOption(sdkconfig, option) {
180 let name = option.name;
181 let value = option.value;

Callers 1

generateRulesMethod · 0.95

Calls 2

echoMethod · 0.95
lineMethod · 0.45

Tested by

no test coverage detected