From ae220c37dff04c8d4d22e48865a5a268000c2f12 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 9 May 2018 23:05:20 +0200 Subject: Add solcVersion to CompilerOpts --- packages/sol-compiler/src/compiler.ts | 13 +++++++++---- packages/sol-compiler/src/index.ts | 1 + packages/sol-compiler/src/utils/types.ts | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'packages/sol-compiler') diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index c17616246..2ebc5228e 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -74,6 +74,7 @@ export class Compiler { private _contractsDir: string; private _compilerSettings: solc.CompilerSettings; private _artifactsDir: string; + private _solcVersionIfExists: string | undefined; private _specifiedContracts: string[] | TYPE_ALL_FILES_IDENTIFIER; /** * Instantiates a new instance of the Compiler class. @@ -85,6 +86,7 @@ export class Compiler { ? JSON.parse(fs.readFileSync(CONFIG_FILE).toString()) : {}; this._contractsDir = opts.contractsDir || config.contractsDir || DEFAULT_CONTRACTS_DIR; + this._solcVersionIfExists = opts.solcVersion || config.solcVersion; this._compilerSettings = opts.compilerSettings || config.compilerSettings || DEFAULT_COMPILER_SETTINGS; this._artifactsDir = opts.artifactsDir || config.artifactsDir || DEFAULT_ARTIFACTS_DIR; this._specifiedContracts = opts.contracts || config.contracts || ALL_CONTRACTS_IDENTIFIER; @@ -139,9 +141,12 @@ export class Compiler { if (!shouldCompile) { return; } - const solcVersionRange = parseSolidityVersionRange(contractSource.source); - const availableCompilerVersions = _.keys(binPaths); - const solcVersion = semver.maxSatisfying(availableCompilerVersions, solcVersionRange); + let solcVersion = this._solcVersionIfExists; + if (_.isUndefined(solcVersion)) { + const solcVersionRange = parseSolidityVersionRange(contractSource.source); + const availableCompilerVersions = _.keys(binPaths); + solcVersion = semver.maxSatisfying(availableCompilerVersions, solcVersionRange); + } const fullSolcVersion = binPaths[solcVersion]; const compilerBinFilename = path.join(SOLC_BIN_DIR, fullSolcVersion); let solcjs: string; @@ -229,7 +234,7 @@ export class Compiler { sourceTreeHashHex, compiler: { name: 'solc', - version: solcVersion, + version: fullSolcVersion, settings: this._compilerSettings, }, }; diff --git a/packages/sol-compiler/src/index.ts b/packages/sol-compiler/src/index.ts index 4b4c51de2..15c166992 100644 --- a/packages/sol-compiler/src/index.ts +++ b/packages/sol-compiler/src/index.ts @@ -1,2 +1,3 @@ export { Compiler } from './compiler'; +export { CompilerOptions } from './utils/types'; export { ContractArtifact, ContractNetworks } from './utils/types'; diff --git a/packages/sol-compiler/src/utils/types.ts b/packages/sol-compiler/src/utils/types.ts index b12a11b79..d43347fa6 100644 --- a/packages/sol-compiler/src/utils/types.ts +++ b/packages/sol-compiler/src/utils/types.ts @@ -55,6 +55,7 @@ export interface CompilerOptions { artifactsDir?: string; compilerSettings?: solc.CompilerSettings; contracts?: string[] | '*'; + solcVersion?: string; } export interface ContractSourceData { -- cgit v1.2.3 From b86248f13fcb8f326098252beee6ca557e0175e7 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 May 2018 11:29:52 +0200 Subject: Add CHANGELOG entries --- packages/sol-compiler/CHANGELOG.json | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'packages/sol-compiler') diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index a1b53fb9e..35f2c6179 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -5,6 +5,10 @@ { "note": "Properly export the executable binary", "pr": 588 + }, + { + "note": "Add a possibility to define a solidity version to use", + "pr": 589 } ] }, -- cgit v1.2.3 From 1ff34bd0f4084d2f9dfd6f07447bb63684ac51ac Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 May 2018 15:14:36 +0200 Subject: Remove web3Factory.create and remove dev-tools dependency on sol-cov --- packages/sol-compiler/test/util/provider.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/sol-compiler') diff --git a/packages/sol-compiler/test/util/provider.ts b/packages/sol-compiler/test/util/provider.ts index e0fcb362a..2bd178129 100644 --- a/packages/sol-compiler/test/util/provider.ts +++ b/packages/sol-compiler/test/util/provider.ts @@ -3,7 +3,6 @@ import { Provider } from '@0xproject/types'; import * as Web3 from 'web3'; const providerConfigs = { shouldUseInProcessGanache: true }; -const web3Instance = web3Factory.create(providerConfigs); -const provider: Provider = web3Instance.currentProvider; +const provider: Provider = web3Factory.getRpcProvider(providerConfigs); export { provider }; -- cgit v1.2.3 From ac925aa22685a1ea412feddb760cf21022ef84c0 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 21 May 2018 16:45:38 -0700 Subject: Improve a CHANGELOG comment --- packages/sol-compiler/CHANGELOG.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/sol-compiler') diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index 35f2c6179..b71135ea7 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -7,7 +7,7 @@ "pr": 588 }, { - "note": "Add a possibility to define a solidity version to use", + "note": "Add the ability to define a specific solidity version", "pr": 589 } ] -- cgit v1.2.3 From f8c628b0c7b750e1096dcc507190525feb8bd572 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 10:16:38 -0700 Subject: Updated CHANGELOGS --- packages/sol-compiler/CHANGELOG.json | 3 ++- packages/sol-compiler/CHANGELOG.md | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'packages/sol-compiler') diff --git a/packages/sol-compiler/CHANGELOG.json b/packages/sol-compiler/CHANGELOG.json index b71135ea7..33fd99e4f 100644 --- a/packages/sol-compiler/CHANGELOG.json +++ b/packages/sol-compiler/CHANGELOG.json @@ -10,7 +10,8 @@ "note": "Add the ability to define a specific solidity version", "pr": 589 } - ] + ], + "timestamp": 1527009133 }, { "timestamp": 1525477860, diff --git a/packages/sol-compiler/CHANGELOG.md b/packages/sol-compiler/CHANGELOG.md index 4eb0ed453..ee9b53f4e 100644 --- a/packages/sol-compiler/CHANGELOG.md +++ b/packages/sol-compiler/CHANGELOG.md @@ -5,7 +5,11 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v0.4.3 - _May 5, 2018_ +## v0.5.0 - _May 22, 2018_ + + * Properly export the executable binary (#588) + +## v0.4.3 - _May 4, 2018_ * Dependencies updated -- cgit v1.2.3 From 84a1b5612de3b22bbe6b8b01a997234771d98005 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 May 2018 10:26:47 -0700 Subject: Publish - 0x.js@0.38.0 - @0xproject/abi-gen@0.3.0 - @0xproject/assert@0.2.10 - @0xproject/base-contract@0.3.2 - @0xproject/connect@0.6.13 - @0xproject/contract-wrappers@0.0.2 - contracts@2.1.29 - @0xproject/dev-utils@0.4.2 - @0xproject/fill-scenarios@0.0.2 - @0xproject/json-schemas@0.7.24 - @0xproject/metacoin@0.0.7 - @0xproject/migrations@0.0.6 - @0xproject/monorepo-scripts@0.1.20 - @0xproject/order-utils@0.0.5 - @0xproject/order-watcher@0.0.2 - @0xproject/react-docs-example@0.0.12 - @0xproject/react-docs@0.0.12 - @0xproject/react-shared@0.1.7 - @0xproject/sol-compiler@0.5.0 - @0xproject/sol-cov@0.0.11 - @0xproject/sol-resolver@0.0.5 - @0xproject/sra-report@0.1.0 - @0xproject/subproviders@0.10.2 - @0xproject/testnet-faucets@1.0.30 - @0xproject/tslint-config@0.4.18 - @0xproject/types@0.7.0 - @0xproject/typescript-typings@0.3.2 - @0xproject/utils@0.6.2 - @0xproject/web3-wrapper@0.6.4 - @0xproject/website@0.0.33 --- packages/sol-compiler/package.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'packages/sol-compiler') diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json index 31a10f8b7..c94e59eb4 100644 --- a/packages/sol-compiler/package.json +++ b/packages/sol-compiler/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/sol-compiler", - "version": "0.4.3", + "version": "0.5.0", "engines": { "node": ">=6.12" }, @@ -49,9 +49,9 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/sol-compiler/README.md", "devDependencies": { - "@0xproject/dev-utils": "^0.4.1", - "@0xproject/monorepo-scripts": "^0.1.19", - "@0xproject/tslint-config": "^0.4.17", + "@0xproject/dev-utils": "^0.4.2", + "@0xproject/monorepo-scripts": "^0.1.20", + "@0xproject/tslint-config": "^0.4.18", "@types/mkdirp": "^0.5.2", "@types/require-from-string": "^1.2.0", "@types/semver": "^5.5.0", @@ -72,12 +72,12 @@ "zeppelin-solidity": "1.8.0" }, "dependencies": { - "@0xproject/json-schemas": "^0.7.23", - "@0xproject/sol-resolver": "^0.0.4", - "@0xproject/types": "^0.6.3", - "@0xproject/typescript-typings": "^0.3.1", - "@0xproject/utils": "^0.6.1", - "@0xproject/web3-wrapper": "^0.6.3", + "@0xproject/json-schemas": "^0.7.24", + "@0xproject/sol-resolver": "^0.0.5", + "@0xproject/types": "^0.7.0", + "@0xproject/typescript-typings": "^0.3.2", + "@0xproject/utils": "^0.6.2", + "@0xproject/web3-wrapper": "^0.6.4", "@types/yargs": "^11.0.0", "chalk": "^2.3.0", "ethereumjs-util": "^5.1.1", -- cgit v1.2.3