full compilation output in file

pull/2112/head
aniket-engg 3 years ago committed by Aniket
parent 543abf0a7f
commit d506809b42
  1. 9
      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 {

Loading…
Cancel
Save