Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
29b4eb7e
Commit
29b4eb7e
authored
May 12, 2021
by
aniket-engg
Committed by
Aniket
May 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler configuration from remix IDE
parent
25edaefe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
fileManager.js
apps/remix-ide/src/app/files/fileManager.js
+4
-3
compileTab.js
apps/remix-ide/src/app/tabs/compileTab/compileTab.js
+12
-1
hardhatClient.ts
libs/remixd/src/services/hardhatClient.ts
+2
-1
No files found.
apps/remix-ide/src/app/files/fileManager.js
View file @
29b4eb7e
...
...
@@ -57,9 +57,10 @@ class FileManager extends Plugin {
this
.
mode
=
mode
}
async
compileWithHardhat
(
cmd
)
{
console
.
log
(
'Inside compileWithHardhat, calling hardhat compile using appManager'
)
return
await
this
.
appManager
.
call
(
'hardhat'
,
'compile'
,
cmd
)
async
compileWithHardhat
(
fileContent
)
{
const
configFilePath
=
'remixCompiler.config.js'
this
.
setFileContent
(
configFilePath
,
fileContent
)
return
await
this
.
appManager
.
call
(
'hardhat'
,
'compile'
,
configFilePath
)
}
limitPluginScope
(
path
)
{
...
...
apps/remix-ide/src/app/tabs/compileTab/compileTab.js
View file @
29b4eb7e
...
...
@@ -83,7 +83,18 @@ class CompileTab {
console
.
log
(
'mode is - '
,
this
.
fileManager
.
mode
)
if
(
this
.
fileManager
.
mode
===
'localhost'
)
{
console
.
log
(
'calling compilehardhat'
)
this
.
fileManager
.
compileWithHardhat
(
'npx hardhat compile'
).
then
(
console
.
log
)
const
{
currentVersion
,
optimize
,
runs
}
=
this
.
compiler
.
state
const
fileContent
=
`module.exports = {
solidity: '
${
currentVersion
.
substring
(
0
,
currentVersion
.
indexOf
(
'+commit'
))}
',
settings: {
optimizer: {
enabled:
${
optimize
}
,
runs:
${
runs
}
}
}
}
`
this
.
fileManager
.
compileWithHardhat
(
fileContent
).
then
(
console
.
log
)
}
this
.
fileManager
.
saveCurrentFile
()
this
.
miscApi
.
clearAnnotations
()
...
...
libs/remixd/src/services/hardhatClient.ts
View file @
29b4eb7e
...
...
@@ -21,7 +21,8 @@ export class HardhatClient extends PluginClient {
this
.
currentSharedFolder
=
currentSharedFolder
}
compile
(
cmd
:
string
)
{
compile
(
configPath
:
string
)
{
const
cmd
=
`npx hardhat compile --config
${
configPath
}
`
const
options
=
{
cwd
:
this
.
currentSharedFolder
,
shell
:
true
}
const
child
=
spawn
(
cmd
,
options
)
let
result
=
''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment