mirror of https://github.com/embarklabs/embark.git
Merge pull request #757 from embark-framework/fix-passing-compiler-options
Fix passing compiler options
This commit is contained in:
commit
6122b69a03
|
@ -165,7 +165,7 @@ class Engine {
|
|||
deploymentService(options) {
|
||||
let self = this;
|
||||
|
||||
this.registerModule('compiler', {plugins: self.plugins});
|
||||
this.registerModule('compiler', {plugins: self.plugins, disableOptimizations: options.disableOptimizations});
|
||||
this.registerModule('solidity', {ipc: self.ipc, useDashboard: this.useDashboard});
|
||||
this.registerModule('vyper');
|
||||
this.registerModule('profiler');
|
||||
|
|
|
@ -7,6 +7,8 @@ class Compiler {
|
|||
this.events = embark.events;
|
||||
this.logger = embark.logger;
|
||||
|
||||
this.disableOptimizations = options.disableOptimizations;
|
||||
|
||||
this.events.setCommandHandler("compiler:contracts", function(contractFiles, options, cb) {
|
||||
self.compile_contracts(contractFiles, options, cb);
|
||||
});
|
||||
|
@ -27,6 +29,10 @@ class Compiler {
|
|||
|
||||
let compiledObject = {};
|
||||
|
||||
let compilerOptions = {
|
||||
disableOptimizations: this.disableOptimizations || options.disableOptimizations
|
||||
};
|
||||
|
||||
async.eachObject(available_compilers,
|
||||
function (extension, compiler, callback) {
|
||||
let matchingFiles = contractFiles.filter(function (file) {
|
||||
|
@ -41,7 +47,7 @@ class Compiler {
|
|||
if (!matchingFiles || !matchingFiles.length) {
|
||||
return callback();
|
||||
}
|
||||
compiler.call(compiler, matchingFiles, options, function (err, compileResult) {
|
||||
compiler.call(compiler, matchingFiles, compilerOptions, function (err, compileResult) {
|
||||
Object.assign(compiledObject, compileResult);
|
||||
callback(err, compileResult);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue