[project] add cpp target

This commit is contained in:
2020-03-25 21:03:46 +03:00
parent 90f1a9b77f
commit 1bd18caa9a
4 changed files with 28 additions and 3 deletions

View File

@@ -143,11 +143,22 @@ class Haxe extends Sdk {
args.push('-debug');
}
const target = path.resolve(buildDir, platform, 'bin');
fse.emptyDirSync(target);
if (platform !== 'cpp') {
fse.emptyDirSync(target);
}
for (const asset of config.assets) {
fse.copySync(asset, path.join(target, asset.split("/").pop()));
}
return this.haxe(args).then(() => vfs.src(`${target}/**/*`));
const result = {
'cpp': `${config.meta.filename}/${config.main.split('.').pop()}${debug ? '-debug' : ''}`,
}[platform] || '**/*';
return this.haxe(args).then(() => {
let r = vfs.src(`${target}/${result}`);
if (platform === 'cpp') {
r = r.pipe(rename(config.meta.filename));
}
return r;
});
}
install(packages) {