Get contracts list from Compiler class to add support for reading all contracts by default

This commit is contained in:
Amir Bandeali 2019-08-11 14:57:24 -07:00
parent 88d055c3db
commit fb7b51d91b
2 changed files with 4 additions and 1 deletions

View File

@ -28,6 +28,7 @@
"homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts-gen/README.md",
"dependencies": {
"@0x/sol-resolver": "^2.0.8",
"@0x/sol-compiler": "^3.1.9",
"@0x/types": "^2.4.0",
"@0x/typescript-typings": "^4.2.3",
"@0x/utils": "^4.4.0",

View File

@ -1,5 +1,6 @@
#!/usr/bin/env node
import { Compiler } from '@0x/sol-compiler';
import { NameResolver } from '@0x/sol-resolver';
import { PackageJSON } from '@0x/types';
import { logUtils } from '@0x/utils';
@ -24,7 +25,8 @@ const AUTO_GENERATED_BANNER_FOR_LISTS = `This list is auto-generated by contract
(async () => {
const packageDir = process.cwd();
const compilerJSON = readJSONFile<CompilerOptions>('compiler.json');
const contracts = compilerJSON.contracts;
const compiler = new Compiler(compilerJSON);
const contracts = compiler.getContractNamesToCompile();
const contractsDir = compilerJSON.contractsDir || DEFAULT_CONTRACTS_DIR;
const artifactsDir = compilerJSON.artifactsDir || DEFAULT_ARTIFACTS_DIR;
const wrappersDir = DEFAULT_WRAPPERS_DIR;