mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-11 14:34:40 +00:00
add warning after compile for files without a compatible compiler
This commit is contained in:
parent
6647c31d38
commit
7d8c7b119c
@ -7,9 +7,10 @@ class Compiler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compile_contracts(contractFiles, cb) {
|
compile_contracts(contractFiles, cb) {
|
||||||
|
const self = this;
|
||||||
let available_compilers = {};
|
let available_compilers = {};
|
||||||
|
|
||||||
let pluginCompilers = this.plugins.getPluginsProperty('compilers', 'compilers');
|
let pluginCompilers = self.plugins.getPluginsProperty('compilers', 'compilers');
|
||||||
pluginCompilers.forEach(function (compilerObject) {
|
pluginCompilers.forEach(function (compilerObject) {
|
||||||
available_compilers[compilerObject.extension] = compilerObject.cb;
|
available_compilers[compilerObject.extension] = compilerObject.cb;
|
||||||
});
|
});
|
||||||
@ -18,10 +19,13 @@ class Compiler {
|
|||||||
|
|
||||||
async.eachObject(available_compilers,
|
async.eachObject(available_compilers,
|
||||||
function (extension, compiler, callback) {
|
function (extension, compiler, callback) {
|
||||||
// TODO: warn about files it doesn't know how to compile
|
|
||||||
let matchingFiles = contractFiles.filter(function (file) {
|
let matchingFiles = contractFiles.filter(function (file) {
|
||||||
let fileMatch = file.filename.match(/\.[0-9a-z]+$/);
|
let fileMatch = file.filename.match(/\.[0-9a-z]+$/);
|
||||||
return (fileMatch && (fileMatch[0] === extension));
|
if (fileMatch && (fileMatch[0] === extension)) {
|
||||||
|
file.compiled = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
compiler.call(compiler, matchingFiles || [], function (err, compileResult) {
|
compiler.call(compiler, matchingFiles || [], function (err, compileResult) {
|
||||||
@ -30,6 +34,12 @@ class Compiler {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
function (err) {
|
function (err) {
|
||||||
|
contractFiles.forEach(file => {
|
||||||
|
if (!file.compiled) {
|
||||||
|
self.logger.warn(`${file.filename} doesn't have a compatible contract compiler. Maybe a plugin exists for it.`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
cb(err, compiledObject);
|
cb(err, compiledObject);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user