[build] fixes for windows
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"SdkDir": "C:\\sdk",
|
||||
"PublishDir": "",
|
||||
"PublishUrl": "https://shmyga.ru/repo/tankz",
|
||||
"SSH": {
|
||||
"PrivateKey": null,
|
||||
"Passphrase": null
|
||||
|
||||
39
gulpfile.js
39
gulpfile.js
@@ -4,7 +4,7 @@ const foreach = require('gulp-foreach');
|
||||
const gulpClean = require('gulp-clean');
|
||||
const Config = require('./config.json');
|
||||
const packageInfo = require('./package.json');
|
||||
const {Sdk, Haxe, Project, FlashPlayer} = require('gulp-haxetool');
|
||||
const {System, Sdk, Haxe, Project} = require('gulp-haxetool');
|
||||
const path = require('path');
|
||||
const dateformat = require('dateformat');
|
||||
const argv = require('yargs').argv;
|
||||
@@ -125,7 +125,11 @@ const editor = new Project(
|
||||
],
|
||||
config.branch({
|
||||
name: 'editor',
|
||||
sources: ['src/client/haxe', 'src/editor/haxe'],
|
||||
sources: [
|
||||
'src/fixes/haxe',
|
||||
'src/client/haxe',
|
||||
'src/editor/haxe',
|
||||
],
|
||||
main: 'ru.m.tankz.editor.Editor',
|
||||
preloader: 'ru.m.tankz.Preloader',
|
||||
assets: [
|
||||
@@ -159,27 +163,46 @@ const server = new Project(
|
||||
/**
|
||||
* publish
|
||||
*/
|
||||
module.exports.publish = publish(config.name, config.version, Config.PublishDir);
|
||||
module.exports.publish = publish(packageInfo.name, packageInfo.version, Config.PublishDir, Config.PublishUrl);
|
||||
|
||||
/**
|
||||
* default
|
||||
*/
|
||||
module.exports.default = gulp.series(
|
||||
const defaultSeries = [
|
||||
exports.clean,
|
||||
exports.levels,
|
||||
exports.generate,
|
||||
module.exports['client:flash:build'],
|
||||
module.exports['client:flash:html'],
|
||||
module.exports['client:html5:build'],
|
||||
module.exports['client:linux:build'],
|
||||
module.exports['client:linux:deb'],
|
||||
module.exports['client:linux:archive'],
|
||||
module.exports['client:android:build'],
|
||||
|
||||
module.exports['editor:flash:build'],
|
||||
module.exports['editor:flash:html'],
|
||||
module.exports['editor:html5:build'],
|
||||
|
||||
module.exports['server:neko:build'],
|
||||
];
|
||||
|
||||
if (System.isLinux) {
|
||||
defaultSeries.push(
|
||||
module.exports['client:linux:build'],
|
||||
module.exports['client:linux:archive'],
|
||||
module.exports['client:linux:deb'],
|
||||
|
||||
module.exports['client:android:build'],
|
||||
);
|
||||
}
|
||||
|
||||
if (System.isWindows) {
|
||||
defaultSeries.push(
|
||||
module.exports['client:windows:build'],
|
||||
module.exports['client:windows:archive'],
|
||||
module.exports['client:windows:installer'],
|
||||
);
|
||||
}
|
||||
|
||||
defaultSeries.push(
|
||||
exports.publish,
|
||||
);
|
||||
|
||||
module.exports.default = gulp.series(defaultSeries);
|
||||
|
||||
16
tasks/gulp-publish.js
Normal file → Executable file
16
tasks/gulp-publish.js
Normal file → Executable file
@@ -1,5 +1,6 @@
|
||||
const gulp = require('gulp');
|
||||
const fs = require('fs');
|
||||
const fse = require('fs-extra');
|
||||
const path = require('path');
|
||||
const through = require('through2');
|
||||
|
||||
@@ -20,7 +21,7 @@ class Package {
|
||||
['android', /^.*?\.apk$/],
|
||||
['debian', /^.*?\.deb$/],
|
||||
['linux', /^.*?linux\.tar\.gz$/],
|
||||
['windows', /^.*?windows\.zip$/],
|
||||
['windows', /^.*?win\.zip$/],
|
||||
['windows', /^.*?\.exe$/],
|
||||
]) {
|
||||
if (r.test(filename)) {
|
||||
@@ -64,11 +65,12 @@ class Package {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = (name, version, publishDir) => function publish(cb) {
|
||||
module.exports = (name, version, publishDir, publishUrl) => function publish(cb) {
|
||||
const packages = {};
|
||||
fse.ensureDirSync(publishDir);
|
||||
return gulp.series([
|
||||
function copy() {
|
||||
return gulp.src('target/client/@(android|archive|debian|windows)/*')
|
||||
return gulp.src('target/client/@(android|archive|debian|installer)/*')
|
||||
.pipe(through.obj(function (file, enc, cb) {
|
||||
const pack = Package.parseFilename(file.path);
|
||||
if (pack) {
|
||||
@@ -81,7 +83,7 @@ module.exports = (name, version, publishDir) => function publish(cb) {
|
||||
function generate() {
|
||||
return gulp.src(`${publishDir}/*/*`)
|
||||
.pipe(through.obj(function (file, enc, cb) {
|
||||
const path = file.path.replace(file.base + '/', '');
|
||||
const basepath = file.path.replace(file.base + path.sep, '');
|
||||
const pack = Package.parseFilename(file.path);
|
||||
if (pack) {
|
||||
if (!packages[pack.key] || packages[pack.key].version < pack.version) {
|
||||
@@ -89,9 +91,9 @@ module.exports = (name, version, publishDir) => function publish(cb) {
|
||||
platform: pack.platform,
|
||||
type: pack.type,
|
||||
version: pack.version,
|
||||
path: path,
|
||||
filename: path.split('/').pop(),
|
||||
url: `${publishDir}/${path}`,
|
||||
path: basepath,
|
||||
filename: basepath.split(path.sep).pop(),
|
||||
url: `${publishUrl}/${basepath.replace(path.sep, "/")}`,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user