From 24373aa85a248fe41ff05e29f3b037cec4c10f78 Mon Sep 17 00:00:00 2001 From: shmyga Date: Sun, 28 Jan 2018 14:20:41 +0300 Subject: [PATCH] [build] up haxe dependencies --- build/prepare.js | 13 ++----------- config/deploy.rb | 2 +- package.json | 9 +++++++++ project.xml | 8 +++++--- src/client/haxe/ru/m/tankz/Client.hx | 2 +- tasks/haxe.js | 17 ++++++++++++++++- 6 files changed, 34 insertions(+), 17 deletions(-) diff --git a/build/prepare.js b/build/prepare.js index c9485ff..91e0bf0 100755 --- a/build/prepare.js +++ b/build/prepare.js @@ -1,23 +1,14 @@ const AdobeAir = require('../tasks/adobeAir'); const Haxe = require('../tasks/haxe'); const FlashPlayer = require('../tasks/flashplayer'); - -const packages = [ - {name:'openfl', version:'6.5.3'}, - {name:'lime', version:'5.9.1'}, - {name:'promhx', version:'1.1.0'}, - {name:'protohx', version:'0.4.6'}, - {name:'yaml', version:'1.3.0'}, - {name:'haxework', git:'git@bitbucket.org:shmyga/haxework.git'}, - {name:'orm', version:'2.1.0'}, -]; +const packageInfo = require('../package.json'); const prepareOne = (value) => { switch (value) { case Haxe.ID: const haxe = new Haxe(); - return haxe.prepare().then(() => haxe.install(packages)); + return haxe.prepare().then(() => haxe.install(packageInfo.haxeDependencies)); case AdobeAir.ID: return new AdobeAir().prepare(); case FlashPlayer.ID: diff --git a/config/deploy.rb b/config/deploy.rb index fa74c84..a09244b 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -6,7 +6,7 @@ user = 'holop' # git set :application, app -set :repo_url, "git@bitbucket.org:shmyga/#{app}.git" +set :repo_url, "git@bitbucket.org:infernalgames/#{app}.git" set :user, user set :deploy_to, "/home/#{user}/repo/#{app}" diff --git a/package.json b/package.json index ea8da24..ad3769d 100755 --- a/package.json +++ b/package.json @@ -26,5 +26,14 @@ "unzip-stream": "^0.2.1", "vinyl-fs": "^3.0.1", "yargs": "^10.0.3" + }, + "haxeDependencies": { + "lime": "6.0.1", + "openfl": "7.0.0", + "promhx": "1.1.0", + "protohx": "0.4.6", + "yaml": "1.3.0", + "haxework": "git@bitbucket.org:shmyga/haxework.git", + "orm": "2.1.0" } } diff --git a/project.xml b/project.xml index f2e7708..c75e7da 100755 --- a/project.xml +++ b/project.xml @@ -6,10 +6,12 @@ - - + + + + - + diff --git a/src/client/haxe/ru/m/tankz/Client.hx b/src/client/haxe/ru/m/tankz/Client.hx index 4257b0e..cb26644 100755 --- a/src/client/haxe/ru/m/tankz/Client.hx +++ b/src/client/haxe/ru/m/tankz/Client.hx @@ -61,7 +61,7 @@ class Client implements IConnectionHandler { Provider.set(IConnection, new ru.m.connect.js.JsConnection("localhost", 5001)); #end - Provider.get(IConnection).handler.addListener(this); + //Provider.get(IConnection).handler.addListener(this); view = new MainView(); Provider.set(IFrameSwitcher, view.switcher); diff --git a/tasks/haxe.js b/tasks/haxe.js index 3c889c7..d015314 100755 --- a/tasks/haxe.js +++ b/tasks/haxe.js @@ -76,6 +76,11 @@ class Haxe extends Sdk { return this.haxelib(args); }; + if (!Array.isArray(packages)) { + packages = Object.entries(packages).map(([k, v]) => ({name: k, version: v})); + } + console.log('packages', packages); + for (let pack of packages) { const args = []; let version = null; @@ -83,6 +88,11 @@ class Haxe extends Sdk { args.push('install', pack); } else if (typeof pack === 'object') { version = pack.version; + console.log('z', version.substr(0, 3)); + if (version.substr(0, 3) === 'git') { + pack.git = version; + version = null; + } if (pack.git) { args.push('git', pack.name, pack.git); if (pack.branch) args.push(pack.branch); @@ -93,7 +103,12 @@ class Haxe extends Sdk { args.push('--always'); } let path = `${this.path}/lib/${args[1]}`; - if (version) path += `/${version.replace(/\./g, ',')}`; + if (version) { + path += `/${version.replace(/\./g, ',')}`; + } else if (pack.git) { + path += '/git'; + } + console.log('p', path); if (!fs.existsSync(path)) { promise = promise.then(next(args)); }