support directive

This commit is contained in:
Iuri Matias 2017-07-02 18:03:14 -04:00
parent 61e44b31e9
commit 8e349cc6ed
5 changed files with 9 additions and 7 deletions

View File

@ -249,7 +249,7 @@ Config.prototype.loadFiles = function(files) {
readFiles.push({filename: 'embark.js', content: fs.readFileSync(fs.embarkPath("js/build/embark.bundle.js")).toString(), path: fs.embarkPath("js/build/embark.bundle.js")});
}
if (file.indexOf("web3-") == 0) {
if (file.indexOf("web3-") === 0) {
let web3Version = file.split('web3-')[1].split(".js")[0];
npm.getPackageVersion('web3', web3Version, function(web3Content) {
self.logger.error('downloaded web3');

View File

@ -67,5 +67,5 @@ module.exports = {
});
}
}
};

View File

@ -17,7 +17,7 @@ module.exports = {
let gitHash = registryJSON.gitHead;
let repo = registryJSON.homepage.split("github.com/")[1];
let gitUrl = "http://raw.githubusercontent.com/" + repo + "/" + gitHash + "/dist/" + packageName + ".js"
let gitUrl = "http://raw.githubusercontent.com/" + repo + "/" + gitHash + "/dist/" + packageName + ".js";
utils.httpGet(gitUrl, function (res2) {
let body = '';
res2.on('data', function (d) {

View File

@ -23,11 +23,12 @@ class Pipeline {
let pipelinePlugins = this.plugins.getPluginsFor('pipeline');
if (file.filename[0] === '$') {
if (file.filename === "$ALL_CONTRACTS") {
return {content: abi, filename: file.filename, path: file.path, modified: true};
} else if (file.filename[0] === '$') {
let contractName = file.filename.substr(1);
return {content: this.buildContractJS(contractName), filename: contractName + ".js", path: file.path, modified: true};
}
else if (file.filename === 'embark.js') {
} else if (file.filename === 'embark.js') {
return {content: file.content + "\n" + abi, filename: file.filename, path: file.path, modified: true};
} else if (file.filename === 'abi.js') {
return {content: abi, filename: file.filename, path: file.path, modified: true};

View File

@ -12,7 +12,8 @@
"test.html": "app/test.html",
"test2.html": "app/test2.html",
"js/myweb3.js": "web3-0.18.js",
"js/web3.js": "web3.js"
"js/web3.js": "web3.js",
"js/all_contracts.js": "$ALL_CONTRACTS"
},
"buildDir": "dist/",
"config": "config/",