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
39dc9905
Commit
39dc9905
authored
May 18, 2021
by
yann300
Committed by
Aniket
May 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make compileTabLogic a plugin
parent
d62c6c4c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
12 deletions
+19
-12
app.js
apps/remix-ide/src/app.js
+1
-0
compile-tab.js
apps/remix-ide/src/app/tabs/compile-tab.js
+3
-6
compileTab.js
apps/remix-ide/src/app/tabs/compileTab/compileTab.js
+14
-5
remixAppManager.js
apps/remix-ide/src/remixAppManager.js
+1
-1
No files found.
apps/remix-ide/src/app.js
View file @
39dc9905
...
@@ -431,6 +431,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -431,6 +431,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
engine
.
register
([
engine
.
register
([
compileTab
,
compileTab
,
compileTab
.
compileTabLogic
,
run
,
run
,
debug
,
debug
,
analysis
,
analysis
,
...
...
apps/remix-ide/src/app/tabs/compile-tab.js
View file @
39dc9905
...
@@ -65,15 +65,10 @@ class CompileTab extends ViewPlugin {
...
@@ -65,15 +65,10 @@ class CompileTab extends ViewPlugin {
eventHandlers
:
{},
eventHandlers
:
{},
loading
:
false
loading
:
false
}
}
this
.
compileTabLogic
=
new
CompileTabLogic
(
this
.
queryParams
,
this
.
fileManager
,
this
.
editor
,
this
.
config
,
this
.
fileProvider
,
this
.
contentImport
)
}
}
onActivationInternal
()
{
onActivationInternal
()
{
const
miscApi
=
{
clearAnnotations
:
()
=>
{
this
.
call
(
'editor'
,
'clearAnnotations'
)
}
}
this
.
compileTabLogic
=
new
CompileTabLogic
(
this
.
queryParams
,
this
.
fileManager
,
this
.
editor
,
this
.
config
,
this
.
fileProvider
,
this
.
contentImport
,
miscApi
)
this
.
compiler
=
this
.
compileTabLogic
.
compiler
this
.
compiler
=
this
.
compileTabLogic
.
compiler
this
.
compileTabLogic
.
init
()
this
.
compileTabLogic
.
init
()
...
@@ -486,6 +481,7 @@ class CompileTab extends ViewPlugin {
...
@@ -486,6 +481,7 @@ class CompileTab extends ViewPlugin {
}
}
onActivation
()
{
onActivation
()
{
this
.
call
(
'manager'
,
'activatePlugin'
,
'solidity-logic'
)
this
.
listenToEvents
()
this
.
listenToEvents
()
}
}
...
@@ -499,6 +495,7 @@ class CompileTab extends ViewPlugin {
...
@@ -499,6 +495,7 @@ class CompileTab extends ViewPlugin {
this
.
fileManager
.
events
.
removeListener
(
'noFileSelected'
,
this
.
data
.
eventHandlers
.
onNoFileSelected
)
this
.
fileManager
.
events
.
removeListener
(
'noFileSelected'
,
this
.
data
.
eventHandlers
.
onNoFileSelected
)
this
.
compiler
.
event
.
unregister
(
'compilationFinished'
,
this
.
data
.
eventHandlers
.
onCompilationFinished
)
this
.
compiler
.
event
.
unregister
(
'compilationFinished'
,
this
.
data
.
eventHandlers
.
onCompilationFinished
)
globalRegistry
.
get
(
'themeModule'
).
api
.
events
.
removeListener
(
'themeChanged'
,
this
.
data
.
eventHandlers
.
onThemeChanged
)
globalRegistry
.
get
(
'themeModule'
).
api
.
events
.
removeListener
(
'themeChanged'
,
this
.
data
.
eventHandlers
.
onThemeChanged
)
this
.
call
(
'manager'
,
'deactivatePlugin'
,
'solidity-logic'
)
}
}
}
}
...
...
apps/remix-ide/src/app/tabs/compileTab/compileTab.js
View file @
39dc9905
const
EventEmitter
=
require
(
'events'
)
const
EventEmitter
=
require
(
'events'
)
var
Compiler
=
require
(
'@remix-project/remix-solidity'
).
Compiler
var
Compiler
=
require
(
'@remix-project/remix-solidity'
).
Compiler
import
*
as
packageJson
from
'../../../../../../package.json'
import
{
Plugin
}
from
'@remixproject/engine'
class
CompileTab
{
const
profile
=
{
constructor
(
queryParams
,
fileManager
,
editor
,
config
,
fileProvider
,
contentImport
,
miscApi
)
{
name
:
'solidity-logic'
,
displayName
:
'Solidity compiler logic'
,
description
:
'Compile solidity contracts - Logic'
,
version
:
packageJson
.
version
}
class
CompileTab
extends
Plugin
{
constructor
(
queryParams
,
fileManager
,
editor
,
config
,
fileProvider
,
contentImport
)
{
super
(
profile
)
this
.
event
=
new
EventEmitter
()
this
.
event
=
new
EventEmitter
()
this
.
miscApi
=
miscApi
this
.
queryParams
=
queryParams
this
.
queryParams
=
queryParams
this
.
compilerImport
=
contentImport
this
.
compilerImport
=
contentImport
this
.
compiler
=
new
Compiler
((
url
,
cb
)
=>
this
.
compilerImport
.
resolveAndSave
(
url
).
then
((
result
)
=>
cb
(
null
,
result
)).
catch
((
error
)
=>
cb
(
error
.
message
)))
this
.
compiler
=
new
Compiler
((
url
,
cb
)
=>
this
.
compilerImport
.
resolveAndSave
(
url
).
then
((
result
)
=>
cb
(
null
,
result
)).
catch
((
error
)
=>
cb
(
error
.
message
)))
...
@@ -100,10 +109,10 @@ class CompileTab {
...
@@ -100,10 +109,10 @@ class CompileTab {
`
`
const
configFilePath
=
'remix-compiler.config.js'
const
configFilePath
=
'remix-compiler.config.js'
this
.
fileManager
.
setFileContent
(
configFilePath
,
fileContent
)
this
.
fileManager
.
setFileContent
(
configFilePath
,
fileContent
)
this
.
fileManager
.
call
(
'hardhat'
,
'compile'
,
configFilePath
)
this
.
call
(
'hardhat'
,
'compile'
,
configFilePath
)
}
}
this
.
fileManager
.
saveCurrentFile
()
this
.
fileManager
.
saveCurrentFile
()
this
.
miscApi
.
clearAnnotations
(
)
this
.
call
(
'editor'
,
'clearAnnotations'
)
var
currentFile
=
this
.
config
.
get
(
'currentFile'
)
var
currentFile
=
this
.
config
.
get
(
'currentFile'
)
return
this
.
compileFile
(
currentFile
)
return
this
.
compileFile
(
currentFile
)
}
catch
(
err
)
{
}
catch
(
err
)
{
...
...
apps/remix-ide/src/remixAppManager.js
View file @
39dc9905
...
@@ -14,7 +14,7 @@ const requiredModules = [ // services + layout views + system views
...
@@ -14,7 +14,7 @@ const requiredModules = [ // services + layout views + system views
const
dependentModules
=
[
'git'
,
'hardhat'
]
// module which shouldn't be manually activated (e.g git is activated by remixd)
const
dependentModules
=
[
'git'
,
'hardhat'
]
// module which shouldn't be manually activated (e.g git is activated by remixd)
export
function
isNative
(
name
)
{
export
function
isNative
(
name
)
{
const
nativePlugins
=
[
'vyper'
,
'workshops'
,
'debugger'
,
'remixd'
,
'menuicons'
]
const
nativePlugins
=
[
'vyper'
,
'workshops'
,
'debugger'
,
'remixd'
,
'menuicons'
,
'solidity'
]
return
nativePlugins
.
includes
(
name
)
||
requiredModules
.
includes
(
name
)
return
nativePlugins
.
includes
(
name
)
||
requiredModules
.
includes
(
name
)
}
}
...
...
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