From f132c52720a1653f645cce04ebdb77d9dfc03e17 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 22 Feb 2022 13:28:55 +0530 Subject: [PATCH] full compilation output in file --- libs/remix-core-plugin/src/lib/compiler-metadata.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libs/remix-core-plugin/src/lib/compiler-metadata.ts b/libs/remix-core-plugin/src/lib/compiler-metadata.ts index 7fb555ea0b..b217d8984f 100644 --- a/libs/remix-core-plugin/src/lib/compiler-metadata.ts +++ b/libs/remix-core-plugin/src/lib/compiler-metadata.ts @@ -26,8 +26,8 @@ export class CompilerMetadata extends Plugin { return this.joinPath(path, this.innerPath, contractName + '_metadata.json') } - _OutputFileName (path, contractName) { - return this.joinPath(path, this.innerPath, contractName + '_fullOP.json') + _OutputFileName (path, target) { + return this.joinPath(path, this.innerPath, 'output/' + target.replace('/', '_') + '.json') } onActivation () { @@ -36,6 +36,8 @@ export class CompilerMetadata extends Plugin { if (!await this.call('settings', 'get', 'settings/generate-contract-metadata')) return const compiler = new CompilerAbstract(languageVersion, data, source) const path = self._extractPathOf(source.target) + const outputFileName = this._OutputFileName(path, source.target) + await this.call('fileManager', 'writeFile', outputFileName, JSON.stringify(data, null, '\t')) compiler.visitContracts((contract) => { if (contract.file !== source.target) return (async () => { @@ -57,9 +59,6 @@ export class CompilerMetadata extends Plugin { content = content || '{}' const fileName = this._JSONFileName(path, contract.name) const metadataFileName = this._MetadataFileName(path, contract.name) - const opFileName = this._OutputFileName(path, contract.name) - - if (contract && contract.object) await this.call('fileManager', 'writeFile', opFileName, JSON.stringify(contract.object, null, '\t')) let metadata try {