call compiler through a request
This commit is contained in:
parent
af8a720e90
commit
16eaacbd54
|
@ -1,7 +1,6 @@
|
||||||
let toposort = require('toposort');
|
let toposort = require('toposort');
|
||||||
let async = require('async');
|
let async = require('async');
|
||||||
|
|
||||||
let Compiler = require('./compiler.js');
|
|
||||||
let utils = require('../utils/utils.js');
|
let utils = require('../utils/utils.js');
|
||||||
const constants = require('../constants');
|
const constants = require('../constants');
|
||||||
|
|
||||||
|
@ -36,8 +35,7 @@ class ContractsManager {
|
||||||
let self = this;
|
let self = this;
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function compileContracts(callback) {
|
function compileContracts(callback) {
|
||||||
let compiler = new Compiler({plugins: self.plugins, logger: self.logger});
|
self.events.request("compiler:contracts", self.contractFiles, function (err, compiledObject) {
|
||||||
compiler.compile_contracts(self.contractFiles, function (err, compiledObject) {
|
|
||||||
self.compiledContracts = compiledObject;
|
self.compiledContracts = compiledObject;
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,6 +4,7 @@ const Events = require('./events.js');
|
||||||
const Logger = require('./logger.js');
|
const Logger = require('./logger.js');
|
||||||
const Config = require('./config.js');
|
const Config = require('./config.js');
|
||||||
const Blockchain = require('../contracts/blockchain.js');
|
const Blockchain = require('../contracts/blockchain.js');
|
||||||
|
const Compiler = require('../contracts/compiler.js');
|
||||||
const ContractsManager = require('../contracts/contracts.js');
|
const ContractsManager = require('../contracts/contracts.js');
|
||||||
const DeployManager = require('../contracts/deploy_manager.js');
|
const DeployManager = require('../contracts/deploy_manager.js');
|
||||||
const CodeGenerator = require('../contracts/code_generator.js');
|
const CodeGenerator = require('../contracts/code_generator.js');
|
||||||
|
@ -192,6 +193,11 @@ class Engine {
|
||||||
deploymentService(options) {
|
deploymentService(options) {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
|
let compiler = new Compiler({plugins: self.plugins, logger: self.logger});
|
||||||
|
this.events.setCommandHandler("compiler:contracts", function(contractFiles, cb) {
|
||||||
|
compiler.compile_contracts(contractFiles, cb);
|
||||||
|
});
|
||||||
|
|
||||||
this.registerModule('solidity', {
|
this.registerModule('solidity', {
|
||||||
contractDirectories: self.config.contractDirectories
|
contractDirectories: self.config.contractDirectories
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue