[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

@@ -16,6 +16,7 @@ const Platform = {
WINDOWS: 'windows',
ANDROID: 'android',
NEKO: 'neko',
CPP: 'cpp',
};

View File

@@ -143,11 +143,22 @@ class Haxe extends Sdk {
args.push('-debug');
}
const target = path.resolve(buildDir, platform, 'bin');
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) {

View File

@@ -392,6 +392,19 @@ class LinuxRunner extends Runner {
Runner.register(Platform.LINUX, LinuxRunner);
/**
*
*/
class CPPRunner extends LinuxRunner {
constructor(config, debug) {
super(config, debug);
this.platform = Platform.CPP
}
}
Runner.register(Platform.CPP, CPPRunner);
/**
*
*/

View File

@@ -1,6 +1,6 @@
{
"name": "gulp-haxetool",
"version": "0.1.6",
"version": "0.1.7",
"description": "HaXe Tool for Gulp",
"main": "index.js",
"dependencies": {