Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e0eddbcab5 | |||
| 1bd18caa9a |
@@ -16,6 +16,7 @@ const Platform = {
|
|||||||
WINDOWS: 'windows',
|
WINDOWS: 'windows',
|
||||||
ANDROID: 'android',
|
ANDROID: 'android',
|
||||||
NEKO: 'neko',
|
NEKO: 'neko',
|
||||||
|
CPP: 'cpp',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -143,11 +143,22 @@ class Haxe extends Sdk {
|
|||||||
args.push('-debug');
|
args.push('-debug');
|
||||||
}
|
}
|
||||||
const target = path.resolve(buildDir, platform, 'bin');
|
const target = path.resolve(buildDir, platform, 'bin');
|
||||||
fse.emptyDirSync(target);
|
if (platform !== 'cpp') {
|
||||||
|
fse.emptyDirSync(target);
|
||||||
|
}
|
||||||
for (const asset of config.assets) {
|
for (const asset of config.assets) {
|
||||||
fse.copySync(asset, path.join(target, asset.split("/").pop()));
|
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) {
|
install(packages) {
|
||||||
|
|||||||
@@ -392,6 +392,19 @@ class LinuxRunner extends Runner {
|
|||||||
|
|
||||||
Runner.register(Platform.LINUX, LinuxRunner);
|
Runner.register(Platform.LINUX, LinuxRunner);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class CPPRunner extends LinuxRunner {
|
||||||
|
|
||||||
|
constructor(config, debug) {
|
||||||
|
super(config, debug);
|
||||||
|
this.platform = Platform.CPP
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Runner.register(Platform.CPP, CPPRunner);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gulp-haxetool",
|
"name": "gulp-haxetool",
|
||||||
"version": "0.1.6",
|
"version": "0.1.8",
|
||||||
"description": "HaXe Tool for Gulp",
|
"description": "HaXe Tool for Gulp",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
-lib <%=item.name%>:<%=item.version.split('@').shift()%><% }); %>
|
-lib <%=item.name%>:<%=item.version.split('@').shift()%><% }); %>
|
||||||
<% macros.forEach(function(item) { %>
|
<% macros.forEach(function(item) { %>
|
||||||
--macro "<%=item%>"<% }); %>
|
--macro "<%=item%>"<% }); %>
|
||||||
|
<% flags.forEach(function(item) { %>
|
||||||
|
-D <%=item%><% }); %>
|
||||||
|
|
||||||
-main <%=main%>
|
-main <%=main%>
|
||||||
-<%=out%> "<%=buildDir%>/<%=platform%>/bin/<%=meta.filename%><%=ext%>"
|
-<%=out%> "<%=buildDir%>/<%=platform%>/bin/<%=meta.filename%><%=ext%>"
|
||||||
|
|||||||
Reference in New Issue
Block a user