aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/src/compiler.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-16 02:44:10 +0800
committerFabio Berger <me@fabioberger.com>2018-03-16 02:44:10 +0800
commit8d1e27a1a53f4c88ec9fefb5fd37b30c652782a6 (patch)
tree831b8d07c48d3700ec5662c7948ebab5e903b1b9 /packages/deployer/src/compiler.ts
parentf9ad97b978ae4017adca032168ae7963c94e4157 (diff)
parent8137d41ce54b582032770c9b168016ce379711bf (diff)
downloaddexon-sol-tools-8d1e27a1a53f4c88ec9fefb5fd37b30c652782a6.tar
dexon-sol-tools-8d1e27a1a53f4c88ec9fefb5fd37b30c652782a6.tar.gz
dexon-sol-tools-8d1e27a1a53f4c88ec9fefb5fd37b30c652782a6.tar.bz2
dexon-sol-tools-8d1e27a1a53f4c88ec9fefb5fd37b30c652782a6.tar.lz
dexon-sol-tools-8d1e27a1a53f4c88ec9fefb5fd37b30c652782a6.tar.xz
dexon-sol-tools-8d1e27a1a53f4c88ec9fefb5fd37b30c652782a6.tar.zst
dexon-sol-tools-8d1e27a1a53f4c88ec9fefb5fd37b30c652782a6.zip
Merge branch 'development' into addExtraDocs
* development: Add changelog entry about pragma addition Add pragma above command-line script Keep console.log in monorepo-scripts Enable coverage for all other packages with tests Fix parallel coverage results reporting Fix linter issuesx Update CHANGELOGs Consolidate all console.log into the @0xproject/utils package # Conflicts: # packages/deployer/package.json
Diffstat (limited to 'packages/deployer/src/compiler.ts')
-rw-r--r--packages/deployer/src/compiler.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts
index ced8063db..83977709b 100644
--- a/packages/deployer/src/compiler.ts
+++ b/packages/deployer/src/compiler.ts
@@ -1,4 +1,4 @@
-import { promisify } from '@0xproject/utils';
+import { logUtils, promisify } from '@0xproject/utils';
import * as ethUtil from 'ethereumjs-util';
import * as fs from 'fs';
import 'isomorphic-fetch';
@@ -59,9 +59,9 @@ export class Compiler {
};
const source = await fsWrapper.readFileAsync(contentPath, opts);
sources[fileName] = source;
- utils.consoleLog(`Reading ${fileName} source...`);
+ logUtils.log(`Reading ${fileName} source...`);
} catch (err) {
- utils.consoleLog(`Could not find file at ${contentPath}`);
+ logUtils.log(`Could not find file at ${contentPath}`);
}
} else {
try {
@@ -71,7 +71,7 @@ export class Compiler {
...nestedSources,
};
} catch (err) {
- utils.consoleLog(`${contentPath} is not a directory or ${constants.SOLIDITY_FILE_EXTENSION} file`);
+ logUtils.log(`${contentPath} is not a directory or ${constants.SOLIDITY_FILE_EXTENSION} file`);
}
}
}
@@ -164,7 +164,7 @@ export class Compiler {
});
await Promise.all(_.map(fileNames, async fileName => this._compileContractAsync(fileName)));
this._solcErrors.forEach(errMsg => {
- utils.consoleLog(errMsg);
+ logUtils.log(errMsg);
});
}
/**
@@ -195,7 +195,7 @@ export class Compiler {
if (isCompilerAvailableLocally) {
solcjs = fs.readFileSync(compilerBinFilename).toString();
} else {
- utils.consoleLog(`Downloading ${fullSolcVersion}...`);
+ logUtils.log(`Downloading ${fullSolcVersion}...`);
const url = `${constants.BASE_COMPILER_URL}${fullSolcVersion}`;
const response = await fetch(url);
if (response.status !== 200) {
@@ -206,7 +206,7 @@ export class Compiler {
}
const solcInstance = solc.setupMethods(requireFromString(solcjs, compilerBinFilename));
- utils.consoleLog(`Compiling ${fileName}...`);
+ logUtils.log(`Compiling ${fileName}...`);
const source = this._contractSources[fileName];
const input = {
[fileName]: source,
@@ -270,7 +270,7 @@ export class Compiler {
const artifactString = utils.stringifyWithFormatting(newArtifact);
const currentArtifactPath = `${this._artifactsDir}/${contractName}.json`;
await fsWrapper.writeFileAsync(currentArtifactPath, artifactString);
- utils.consoleLog(`${fileName} artifact saved!`);
+ logUtils.log(`${fileName} artifact saved!`);
}
/**
* Sets the source tree hash for a file and its dependencies.
@@ -323,7 +323,7 @@ export class Compiler {
*/
private async _createArtifactsDirIfDoesNotExistAsync(): Promise<void> {
if (!fsWrapper.doesPathExistSync(this._artifactsDir)) {
- utils.consoleLog('Creating artifacts directory...');
+ logUtils.log('Creating artifacts directory...');
await fsWrapper.mkdirAsync(this._artifactsDir);
}
}
@@ -344,7 +344,7 @@ export class Compiler {
contractArtifact = JSON.parse(contractArtifactString);
return contractArtifact;
} catch (err) {
- utils.consoleLog(`Artifact for ${fileName} does not exist`);
+ logUtils.log(`Artifact for ${fileName} does not exist`);
return undefined;
}
}