Compare commits
1 Commits
b24c71678e
...
d124588e70
| Author | SHA1 | Date | |
|---|---|---|---|
| d124588e70 |
243
gulpfile.js
243
gulpfile.js
@@ -1,28 +1,26 @@
|
|||||||
const gulp = require("gulp");
|
const gulp = require('gulp');
|
||||||
const gulpClean = require("gulp-clean");
|
const gulpClean = require('gulp-clean');
|
||||||
const Config = require("./config.json");
|
const Config = require('./config.json');
|
||||||
const packageInfo = require("./package.json");
|
const packageInfo = require('./package.json');
|
||||||
const { System, Sdk, Haxe, Project } = require("gulp-haxetool");
|
const {System, Sdk, Haxe, Project} = require('gulp-haxetool');
|
||||||
const dateformat = require("dateformat");
|
const dateformat = require('dateformat');
|
||||||
const argv = require("yargs").argv;
|
const argv = require('yargs').argv;
|
||||||
const publish = require("./tasks/gulp-publish");
|
const publish = require('./tasks/gulp-publish');
|
||||||
|
|
||||||
Project.useRuffle();
|
|
||||||
|
|
||||||
if (packageInfo.haxe) {
|
if (packageInfo.haxe) {
|
||||||
Haxe.VERSION = packageInfo.haxe;
|
Haxe.VERSION = packageInfo.haxe;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.SdkDir) {
|
if (Config.SdkDir) {
|
||||||
Sdk.dir = Config.SdkDir;
|
Sdk.dir = Config.SdkDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.BuildDir) {
|
if (Config.BuildDir) {
|
||||||
Haxe.buildDir = Config.BuildDir;
|
Haxe.buildDir = Config.BuildDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.clean = function clean() {
|
exports.clean = function clean() {
|
||||||
return gulp.src("target/*", { read: false }).pipe(gulpClean());
|
return gulp.src('target/*', {read: false}).pipe(gulpClean());
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.setup = function setup() {
|
exports.setup = function setup() {
|
||||||
@@ -50,146 +48,167 @@ exports.generate = function generate() {
|
|||||||
* base config
|
* base config
|
||||||
*/
|
*/
|
||||||
const config = new Project.Config({
|
const config = new Project.Config({
|
||||||
meta: {
|
meta: {
|
||||||
title: "Tank'z",
|
title: 'Tank\'z',
|
||||||
filename: "tankz",
|
filename: 'tankz',
|
||||||
icon: "src/client/resources/icon.png",
|
icon: 'src/client/resources/icon.png',
|
||||||
pack: "ru.m.tankz",
|
pack: 'ru.m.tankz',
|
||||||
author: "shmyga <shmyga.z@gmail.com>",
|
author: 'shmyga <shmyga.z@gmail.com>',
|
||||||
company: "MegaLoMania",
|
company: 'MegaLoMania',
|
||||||
version: packageInfo.version + (Config.Develop ? "-SNAPSHOT" : ""),
|
version: packageInfo.version + (Config.Develop ? '-SNAPSHOT' : ''),
|
||||||
},
|
},
|
||||||
key: Config.Key,
|
key: Config.Key,
|
||||||
libs: packageInfo.haxeDependencies,
|
libs: packageInfo.haxeDependencies,
|
||||||
sources: ["src/common/haxe", "src-gen/haxe"],
|
sources: [
|
||||||
assets: ["src/common/resources/config"],
|
'src/common/haxe',
|
||||||
flags: ["proto_debug"],
|
'src-gen/haxe',
|
||||||
macros: [
|
],
|
||||||
`CompilationOption.set('build','${dateformat(new Date(), "yyyy-mm-dd HH:MM:ss")}')`,
|
assets: [
|
||||||
],
|
'src/common/resources/config',
|
||||||
|
],
|
||||||
|
flags: [
|
||||||
|
'proto_debug',
|
||||||
|
],
|
||||||
|
macros: [
|
||||||
|
`CompilationOption.set('build','${dateformat(new Date(), 'yyyy-mm-dd HH:MM:ss')}')`,
|
||||||
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
const host = argv.host || "localhost";
|
const host = argv.host || 'localhost';
|
||||||
const port = argv.port || 5000;
|
const port = argv.port || 5000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* client
|
* client
|
||||||
*/
|
*/
|
||||||
const client = new Project(
|
const client = new Project(
|
||||||
Project.BuildSystem.OPENFL,
|
Project.BuildSystem.OPENFL,
|
||||||
[
|
[
|
||||||
Project.Platform.FLASH,
|
Project.Platform.FLASH,
|
||||||
Project.Platform.HTML5,
|
Project.Platform.HTML5,
|
||||||
Project.Platform.LINUX,
|
Project.Platform.LINUX,
|
||||||
Project.Platform.WINDOWS,
|
Project.Platform.WINDOWS,
|
||||||
Project.Platform.ANDROID,
|
Project.Platform.ANDROID,
|
||||||
],
|
|
||||||
config.branch({
|
|
||||||
name: "client",
|
|
||||||
sources: ["src/client/haxe"],
|
|
||||||
main: "ru.m.tankz.Client",
|
|
||||||
preloader: "ru.m.tankz.Preloader",
|
|
||||||
assets: ["src/common/resources/level", "src/client/resources"],
|
|
||||||
meta: {
|
|
||||||
width: 1024,
|
|
||||||
height: 576,
|
|
||||||
},
|
|
||||||
flags: [
|
|
||||||
//'proto_debug',
|
|
||||||
//'dom',
|
|
||||||
//'dev_layout',
|
|
||||||
//'bitmap_text',
|
|
||||||
],
|
],
|
||||||
macros: [
|
config.branch({
|
||||||
`CompilationOption.set('host','${host}')`,
|
name: 'client',
|
||||||
`CompilationOption.set('port',${port})`,
|
sources: [
|
||||||
],
|
'src/client/haxe',
|
||||||
}),
|
],
|
||||||
|
main: 'ru.m.tankz.Client',
|
||||||
|
preloader: 'ru.m.tankz.Preloader',
|
||||||
|
assets: [
|
||||||
|
'src/common/resources/level',
|
||||||
|
'src/client/resources',
|
||||||
|
],
|
||||||
|
meta: {
|
||||||
|
width: 1024,
|
||||||
|
height: 576,
|
||||||
|
},
|
||||||
|
flags: [
|
||||||
|
//'proto_debug',
|
||||||
|
//'dom',
|
||||||
|
//'dev_layout',
|
||||||
|
//'bitmap_text',
|
||||||
|
],
|
||||||
|
macros: [
|
||||||
|
`CompilationOption.set('host','${host}')`,
|
||||||
|
`CompilationOption.set('port',${port})`,
|
||||||
|
]
|
||||||
|
}),
|
||||||
).bind(module, gulp);
|
).bind(module, gulp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* editor
|
* editor
|
||||||
*/
|
*/
|
||||||
const editor = new Project(
|
const editor = new Project(
|
||||||
Project.BuildSystem.OPENFL,
|
Project.BuildSystem.OPENFL,
|
||||||
[Project.Platform.FLASH, Project.Platform.HTML5, Project.Platform.LINUX],
|
[
|
||||||
config.branch({
|
Project.Platform.FLASH,
|
||||||
name: "editor",
|
Project.Platform.HTML5,
|
||||||
sources: ["src/client/haxe", "src/editor/haxe"],
|
Project.Platform.LINUX,
|
||||||
main: "ru.m.tankz.editor.Editor",
|
|
||||||
preloader: "ru.m.tankz.Preloader",
|
|
||||||
assets: ["src/client/resources", "src/editor/resources"],
|
|
||||||
meta: {
|
|
||||||
filename: "editor",
|
|
||||||
pack: "ru.m.tankz.editor",
|
|
||||||
width: 1024,
|
|
||||||
height: 768,
|
|
||||||
},
|
|
||||||
flags: [
|
|
||||||
//'dev_layout',
|
|
||||||
],
|
],
|
||||||
}),
|
config.branch({
|
||||||
|
name: 'editor',
|
||||||
|
sources: [
|
||||||
|
'src/client/haxe',
|
||||||
|
'src/editor/haxe',
|
||||||
|
],
|
||||||
|
main: 'ru.m.tankz.editor.Editor',
|
||||||
|
preloader: 'ru.m.tankz.Preloader',
|
||||||
|
assets: [
|
||||||
|
'src/client/resources',
|
||||||
|
'src/editor/resources',
|
||||||
|
],
|
||||||
|
meta: {
|
||||||
|
filename: 'editor',
|
||||||
|
pack: 'ru.m.tankz.editor',
|
||||||
|
width: 1024,
|
||||||
|
height: 768,
|
||||||
|
},
|
||||||
|
flags: [
|
||||||
|
//'dev_layout',
|
||||||
|
]
|
||||||
|
})
|
||||||
).bind(module, gulp);
|
).bind(module, gulp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* server
|
* server
|
||||||
*/
|
*/
|
||||||
const server = new Project(
|
const server = new Project(
|
||||||
Project.BuildSystem.HAXE,
|
Project.BuildSystem.HAXE,
|
||||||
Project.Platform.CPP,
|
Project.Platform.CPP,
|
||||||
config.branch({
|
config.branch({
|
||||||
name: "server",
|
name: 'server',
|
||||||
sources: ["src/server/haxe"],
|
sources: ['src/server/haxe'],
|
||||||
main: "ru.m.tankz.server.Server",
|
main: 'ru.m.tankz.server.Server',
|
||||||
assets: ["src/common/resources/level"],
|
assets: [
|
||||||
}),
|
'src/common/resources/level',
|
||||||
|
]
|
||||||
|
}),
|
||||||
).bind(module, gulp);
|
).bind(module, gulp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* publish
|
* publish
|
||||||
*/
|
*/
|
||||||
module.exports.publish = publish(
|
module.exports.publish = publish(packageInfo.name, packageInfo.version, Config.PublishDir, Config.PublishUrl);
|
||||||
packageInfo.name,
|
|
||||||
packageInfo.version,
|
|
||||||
Config.PublishDir,
|
|
||||||
Config.PublishUrl,
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* default
|
* default
|
||||||
*/
|
*/
|
||||||
const defaultSeries = [
|
const defaultSeries = [
|
||||||
exports.clean,
|
exports.clean,
|
||||||
exports.generate,
|
exports.generate,
|
||||||
module.exports["client:flash:build"],
|
module.exports['client:flash:build'],
|
||||||
module.exports["client:flash:html"],
|
module.exports['client:flash:html'],
|
||||||
module.exports["client:html5:build"],
|
module.exports['client:html5:build'],
|
||||||
|
|
||||||
module.exports["editor:flash:build"],
|
module.exports['editor:flash:build'],
|
||||||
module.exports["editor:flash:html"],
|
module.exports['editor:flash:html'],
|
||||||
module.exports["editor:html5:build"],
|
module.exports['editor:html5:build'],
|
||||||
|
|
||||||
module.exports["server:cpp:build"],
|
module.exports['server:cpp:build'],
|
||||||
];
|
];
|
||||||
|
|
||||||
if (System.isLinux) {
|
if (System.isLinux) {
|
||||||
defaultSeries.push(
|
defaultSeries.push(
|
||||||
module.exports["client:linux:build"],
|
module.exports['client:linux:build'],
|
||||||
module.exports["client:linux:archive"],
|
module.exports['client:linux:archive'],
|
||||||
module.exports["client:linux:deb"],
|
module.exports['client:linux:deb'],
|
||||||
|
|
||||||
module.exports["client:android:build"],
|
module.exports['client:android:build'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (System.isWindows) {
|
if (System.isWindows) {
|
||||||
defaultSeries.push(
|
defaultSeries.push(
|
||||||
module.exports["client:windows:build"],
|
module.exports['client:windows:build'],
|
||||||
module.exports["client:windows:archive"],
|
module.exports['client:windows:archive'],
|
||||||
module.exports["client:windows:installer"],
|
module.exports['client:windows:installer'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultSeries.push(exports.publish);
|
defaultSeries.push(
|
||||||
|
exports.publish,
|
||||||
|
);
|
||||||
|
|
||||||
module.exports.default = gulp.series(defaultSeries);
|
module.exports.default = gulp.series(defaultSeries);
|
||||||
|
|||||||
14741
package-lock.json
generated
14741
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
|||||||
"gulp": "^4.0.0",
|
"gulp": "^4.0.0",
|
||||||
"gulp-add": "0.0.2",
|
"gulp-add": "0.0.2",
|
||||||
"gulp-clean": "^0.4.0",
|
"gulp-clean": "^0.4.0",
|
||||||
"gulp-haxetool": "^0.2.1",
|
"gulp-haxetool": "^0.1.9",
|
||||||
"yargs": "^13.2.4"
|
"yargs": "^13.2.4"
|
||||||
},
|
},
|
||||||
"haxeDependencies": {
|
"haxeDependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user