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