From 3dd4b2ada93552afd9031c6683ef227c4e1a5a4c Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Sat, 26 May 2018 12:58:55 -0400 Subject: [PATCH 1/7] Verify that compiler for extension hasn't been loaded --- lib/contracts/compiler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index e6c4fc23e..75ce08f95 100644 --- a/lib/contracts/compiler.js +++ b/lib/contracts/compiler.js @@ -16,7 +16,8 @@ class Compiler { let pluginCompilers = self.plugins.getPluginsProperty('compilers', 'compilers'); pluginCompilers.forEach(function (compilerObject) { - available_compilers[compilerObject.extension] = compilerObject.cb; + if(available_compilers[compilerObject.extension] === undefined) + available_compilers[compilerObject.extension] = compilerObject.cb; }); let compiledObject = {}; From a058fbd349361e11adb97d6143d1805ab8b9f1dd Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Sat, 26 May 2018 13:06:48 -0400 Subject: [PATCH 2/7] Removing warning from appveyor --- lib/contracts/compiler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index 75ce08f95..f682d214e 100644 --- a/lib/contracts/compiler.js +++ b/lib/contracts/compiler.js @@ -16,8 +16,9 @@ class Compiler { let pluginCompilers = self.plugins.getPluginsProperty('compilers', 'compilers'); pluginCompilers.forEach(function (compilerObject) { - if(available_compilers[compilerObject.extension] === undefined) + if(available_compilers[compilerObject.extension] === undefined){ available_compilers[compilerObject.extension] = compilerObject.cb; + } }); let compiledObject = {}; From 02de6089ed8360a2a0e79b2e91d0be23141a1686 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 30 May 2018 15:54:37 -0400 Subject: [PATCH 3/7] Changed code to allow registering more than one compiler for same ext. --- lib/contracts/compiler.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index f682d214e..0ee030f17 100644 --- a/lib/contracts/compiler.js +++ b/lib/contracts/compiler.js @@ -16,15 +16,16 @@ class Compiler { let pluginCompilers = self.plugins.getPluginsProperty('compilers', 'compilers'); pluginCompilers.forEach(function (compilerObject) { - if(available_compilers[compilerObject.extension] === undefined){ - available_compilers[compilerObject.extension] = compilerObject.cb; + if(available_compilers[compilerObject.extension] == undefined){ + available_compilers[compilerObject.extension] = []; } + available_compilers[compilerObject.extension].push(compilerObject.cb); }); let compiledObject = {}; async.eachObject(available_compilers, - function (extension, compiler, callback) { + function (extension, compilers, callback) { let matchingFiles = contractFiles.filter(function (file) { let fileMatch = file.filename.match(/\.[0-9a-z]+$/); if (fileMatch && (fileMatch[0] === extension)) { @@ -37,6 +38,9 @@ class Compiler { if (!matchingFiles || !matchingFiles.length) { return callback(); } + + let compiler = compilers[0]; + compiler.call(compiler, matchingFiles, function (err, compileResult) { Object.assign(compiledObject, compileResult); callback(err, compileResult); From dac06c10eadc2d98b727eb0ecab8be0e588e3d6e Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Fri, 1 Jun 2018 08:12:42 -0400 Subject: [PATCH 4/7] Change based in code review --- lib/contracts/compiler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index 0ee030f17..9a7778e57 100644 --- a/lib/contracts/compiler.js +++ b/lib/contracts/compiler.js @@ -16,7 +16,7 @@ class Compiler { let pluginCompilers = self.plugins.getPluginsProperty('compilers', 'compilers'); pluginCompilers.forEach(function (compilerObject) { - if(available_compilers[compilerObject.extension] == undefined){ + if(!available_compilers[compilerObject.extension]){ available_compilers[compilerObject.extension] = []; } available_compilers[compilerObject.extension].push(compilerObject.cb); From 930aa72bc63a22dd32721d5e564d27a1c2fd89fc Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 14 Jun 2018 16:57:38 -0400 Subject: [PATCH 5/7] revert original changes, sorry Ramos --- lib/contracts/compiler.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index 9a7778e57..e6c4fc23e 100644 --- a/lib/contracts/compiler.js +++ b/lib/contracts/compiler.js @@ -16,16 +16,13 @@ class Compiler { let pluginCompilers = self.plugins.getPluginsProperty('compilers', 'compilers'); pluginCompilers.forEach(function (compilerObject) { - if(!available_compilers[compilerObject.extension]){ - available_compilers[compilerObject.extension] = []; - } - available_compilers[compilerObject.extension].push(compilerObject.cb); + available_compilers[compilerObject.extension] = compilerObject.cb; }); let compiledObject = {}; async.eachObject(available_compilers, - function (extension, compilers, callback) { + function (extension, compiler, callback) { let matchingFiles = contractFiles.filter(function (file) { let fileMatch = file.filename.match(/\.[0-9a-z]+$/); if (fileMatch && (fileMatch[0] === extension)) { @@ -38,9 +35,6 @@ class Compiler { if (!matchingFiles || !matchingFiles.length) { return callback(); } - - let compiler = compilers[0]; - compiler.call(compiler, matchingFiles, function (err, compileResult) { Object.assign(compiledObject, compileResult); callback(err, compileResult); From 6d4d90482519d01c672ba401bac46807d7829fd1 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 14 Jun 2018 16:58:03 -0400 Subject: [PATCH 6/7] sort by internal so first ones are internal and plugins last --- lib/core/plugins.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/core/plugins.js b/lib/core/plugins.js index 096ce43f1..fe42c472e 100644 --- a/lib/core/plugins.js +++ b/lib/core/plugins.js @@ -104,6 +104,17 @@ Plugins.prototype.getPluginsProperty = function(pluginType, property, sub_proper return plugin.has(pluginType); }); + // Sort internal plugins first + matchingPlugins.sort((a, b) => { + if (a.isInternal) { + return -1; + } + if (b.isInternal) { + return 1; + } + return 0; + }); + let matchingProperties = matchingPlugins.map((plugin) => { if (sub_property) { return plugin[property][sub_property]; @@ -111,6 +122,7 @@ Plugins.prototype.getPluginsProperty = function(pluginType, property, sub_proper return plugin[property]; }); + // Remove empty properties matchingProperties = matchingProperties.filter((property) => property); //return flattened list From 2ed6842e711909760812e602aaffaaa093bc5bf9 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 15 Jun 2018 09:16:03 -0400 Subject: [PATCH 7/7] trigger CI build --- test_apps/test_app/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/test_apps/test_app/README.md b/test_apps/test_app/README.md index 45b4c9373..c4971454f 100644 --- a/test_apps/test_app/README.md +++ b/test_apps/test_app/README.md @@ -5,4 +5,3 @@ Test App for integration testing purposes. ```../../bin/embark test``` to see tests are working as expected ```dist/index.html``` and ```dist/test.html``` to check different functionality -