added yoga properties to all widgets

This commit is contained in:
Atul R
2019-06-07 20:13:09 +02:00
parent 50dd2ff823
commit 98494f50d6
31 changed files with 2177 additions and 119 deletions
+39
View File
@@ -0,0 +1,39 @@
const path = require("path");
const fs = require("fs");
const process = require("child_process");
const parseMocGypi = () => {
const MOC_GYPI_PATH = path.resolve(__dirname, "../config/moc.gypi");
const fileText = fs.readFileSync(MOC_GYPI_PATH);
return JSON.parse(fileText);
};
const main = () => {
const includeFilePath = path.resolve(
__dirname,
"../src/cpp/core/YogaWidget/yogawidget.h"
);
const config = parseMocGypi();
const mocFiles = config["target_defaults"]["sources"];
mocFiles.forEach(eachMocFilePath => {
const parsed = path.parse(eachMocFilePath);
const possibleOriginalHeaderFile = path.format({
...parsed,
name: parsed.name.replace("_moc", ""),
ext: ".h",
base: undefined
});
const infile = path.resolve(__dirname, possibleOriginalHeaderFile);
const outfile = path.resolve(__dirname, eachMocFilePath);
const command = `moc ${infile} -o ${outfile} --include ${includeFilePath}`;
console.log(command);
process.exec(command, (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
});
});
};
main();