Skip to content

Commit

Permalink
Adhara customizations
Browse files Browse the repository at this point in the history
  • Loading branch information
rynobey committed Jun 12, 2020
1 parent 7cb2e41 commit 5588917
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class API {
this.onTestsComplete = config.onTestsComplete || this.defaultHook;
this.onCompileComplete = config.onCompileComplete || this.defaultHook;
this.onIstanbulComplete = config.onIstanbulComplete || this.defaultHook;
this.onPreCompile = config.onPreCompile || this.defaultHook;

this.server = null;
this.defaultPort = 8555;
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "solidity-coverage",
"name": "adhara-solidity-coverage",
"version": "0.7.7",
"description": "",
"description": "Customized version of the public solidity-coverage truffle plugin",
"main": "plugins/buidler.plugin.js",
"bin": {
"solidity-coverage": "./plugins/bin.js"
},
"publishConfig": {
"registry": "https://adhara.jfrog.io/artifactory/api/npm/smart-contract-modules/"
},
"directories": {
"test": "test"
},
Expand All @@ -16,10 +19,10 @@
"test:debug": "node --max-old-space-size=4096 ./node_modules/.bin/mocha test/units/* --timeout 100000 --no-warnings --exit",
"netlify": "./scripts/run-netlify.sh"
},
"homepage": "https://github.com/sc-forks/solidity-coverage",
"homepage": "https://github.com/AdharaProjects/solidity-coverage",
"repository": {
"type": "git",
"url": "https://github.com/sc-forks/solidity-coverage.git"
"url": "https://github.com/AdharaProjects/solidity-coverage.git"
},
"author": "",
"license": "ISC",
Expand Down
Binary file added plugins/resources/.plugin.utils.js.swp
Binary file not shown.
3 changes: 1 addition & 2 deletions plugins/resources/plugin.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function toRelativePath(pathToFile, pathToParent){
*/
function getTempLocations(config){
const cwd = config.workingDir;
const contractsDirName = '.coverage_contracts';
const contractsDirName = config.coverage_contracts_temp || '.coverage_contracts';
const artifactsDirName = config.temp || '.coverage_artifacts';

return {
Expand Down Expand Up @@ -250,7 +250,6 @@ async function finish(config, api){
} = getTempLocations(config);

shell.config.silent = true;
shell.rm('-Rf', tempContractsDir);
shell.rm('-Rf', tempArtifactsDir);
shell.config.silent = false;

Expand Down
3 changes: 3 additions & 0 deletions plugins/truffle.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ async function plugin(config){
config.all = true;
config.compilers.solc.settings.optimizer.enabled = false;

// Run pre-compile hook;
await api.onPreCompile(config);

// Compile Instrumented Contracts
await truffle.contracts.compile(config);
await api.onCompileComplete(config);
Expand Down

0 comments on commit 5588917

Please sign in to comment.