aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/src/compiler.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-04-02 03:15:34 +0800
committerGitHub <noreply@github.com>2018-04-02 03:15:34 +0800
commita220b56736bcacfcce045329c99091af5932e723 (patch)
treec2350f7b9cf586552e9c1077a9af4f079d15bf46 /packages/deployer/src/compiler.ts
parent19454a92dcf29c3c50d3d62cbda3c62b7bafe37f (diff)
parentff7c3012a56d0744fa2bcaec0158c85b04293980 (diff)
downloaddexon-sol-tools-a220b56736bcacfcce045329c99091af5932e723.tar
dexon-sol-tools-a220b56736bcacfcce045329c99091af5932e723.tar.gz
dexon-sol-tools-a220b56736bcacfcce045329c99091af5932e723.tar.bz2
dexon-sol-tools-a220b56736bcacfcce045329c99091af5932e723.tar.lz
dexon-sol-tools-a220b56736bcacfcce045329c99091af5932e723.tar.xz
dexon-sol-tools-a220b56736bcacfcce045329c99091af5932e723.tar.zst
dexon-sol-tools-a220b56736bcacfcce045329c99091af5932e723.zip
Merge pull request #491 from 0xProject/fix/buildErrors
Fix build errors
Diffstat (limited to 'packages/deployer/src/compiler.ts')
-rw-r--r--packages/deployer/src/compiler.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts
index 4741a9086..219a55c32 100644
--- a/packages/deployer/src/compiler.ts
+++ b/packages/deployer/src/compiler.ts
@@ -11,7 +11,7 @@ import solc = require('solc');
import { binPaths } from './solc/bin_paths';
import {
- createArtifactsDirIfDoesNotExistAsync,
+ createDirIfDoesNotExistAsync,
findImportIfExist,
getContractArtifactIfExistsAsync,
getNormalizedErrMsg,
@@ -32,6 +32,7 @@ import {
import { utils } from './utils/utils';
const ALL_CONTRACTS_IDENTIFIER = '*';
+const SOLC_BIN_DIR = path.join(__dirname, '..', '..', 'solc_bin');
/**
* The Compiler facilitates compiling Solidity smart contracts and saves the results
@@ -103,7 +104,8 @@ export class Compiler {
* Compiles selected Solidity files found in `contractsDir` and writes JSON artifacts to `artifactsDir`.
*/
public async compileAsync(): Promise<void> {
- await createArtifactsDirIfDoesNotExistAsync(this._artifactsDir);
+ await createDirIfDoesNotExistAsync(this._artifactsDir);
+ await createDirIfDoesNotExistAsync(SOLC_BIN_DIR);
this._contractSources = await Compiler._getContractSourcesAsync(this._contractsDir);
_.forIn(this._contractSources, this._setContractSpecificSourceData.bind(this));
const fileNames = this._specifiedContracts.has(ALL_CONTRACTS_IDENTIFIER)
@@ -147,7 +149,7 @@ export class Compiler {
contractSpecificSourceData.solcVersionRange,
);
const fullSolcVersion = binPaths[solcVersion];
- const compilerBinFilename = path.join(__dirname, '../../solc_bin', fullSolcVersion);
+ const compilerBinFilename = path.join(SOLC_BIN_DIR, fullSolcVersion);
let solcjs: string;
const isCompilerAvailableLocally = fs.existsSync(compilerBinFilename);
if (isCompilerAvailableLocally) {