Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openmole
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
RoiArthurB
openmole
Commits
d3f66d76
Commit
d3f66d76
authored
Mar 19, 2020
by
Romain Reuillon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Plugin] enh: implement JSON Hook
parent
3c58687a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
2 deletions
+30
-2
openmole/core/org.openmole.core.dsl/src/main/scala/org/openmole/core/dsl/extension/package.scala
.../main/scala/org/openmole/core/dsl/extension/package.scala
+1
-0
openmole/core/org.openmole.core.pluginmanager/src/main/scala/org/openmole/core/pluginmanager/PluginInfoActivator.scala
...org/openmole/core/pluginmanager/PluginInfoActivator.scala
+1
-0
openmole/core/org.openmole.core.workflow/src/main/scala/org/openmole/core/workflow/Activator.scala
...src/main/scala/org/openmole/core/workflow/Activator.scala
+3
-1
openmole/plugins/org.openmole.plugin.hook.json/src/main/scala/org/openmole/plugin/hook/json/Activator.scala
.../main/scala/org/openmole/plugin/hook/json/Activator.scala
+4
-1
openmole/plugins/org.openmole.plugin.hook.json/src/main/scala/org/openmole/plugin/hook/json/JSONHook.scala
...c/main/scala/org/openmole/plugin/hook/json/JSONHook.scala
+21
-0
No files found.
openmole/core/org.openmole.core.dsl/src/main/scala/org/openmole/core/dsl/extension/package.scala
View file @
d3f66d76
...
...
@@ -15,6 +15,7 @@ package object extension {
type
Hook
=
org
.
openmole
.
core
.
workflow
.
mole
.
FromContextHook
def
Hook
=
org
.
openmole
.
core
.
workflow
.
mole
.
Hook
def
FormattedFileHook
=
org
.
openmole
.
core
.
workflow
.
mole
.
FormattedFileHook
type
Source
=
org
.
openmole
.
core
.
workflow
.
mole
.
Source
type
FromContextSource
=
org
.
openmole
.
core
.
workflow
.
mole
.
FromContextSource
...
...
openmole/core/org.openmole.core.pluginmanager/src/main/scala/org/openmole/core/pluginmanager/PluginInfoActivator.scala
View file @
d3f66d76
...
...
@@ -81,6 +81,7 @@ object KeyWord {
case
class
SamplingKeyWord
(
name
:
String
)
extends
KeyWord
case
class
WordKeyWord
(
name
:
String
)
extends
KeyWord
case
class
DomainKeyWord
(
name
:
String
)
extends
KeyWord
case
class
OtherKeyWord
(
name
:
String
)
extends
KeyWord
}
trait
PluginInfoActivator
extends
BundleActivator
{
...
...
openmole/core/org.openmole.core.workflow/src/main/scala/org/openmole/core/workflow/Activator.scala
View file @
d3f66d76
...
...
@@ -2,6 +2,7 @@ package org.openmole.core.workflow
import
org.openmole.core.pluginmanager.PluginInfo
import
org.openmole.core.preference.ConfigurationInfo
import
org.openmole.core.workflow.mole.CSVHook.CSVOutputFormat
import
org.osgi.framework.
{
BundleActivator
,
BundleContext
}
class
Activator
extends
BundleActivator
{
...
...
@@ -54,7 +55,8 @@ class Activator extends BundleActivator {
TaskKeyWord
(
objectName
(
ToArrayTask
)),
TaskKeyWord
(
objectName
(
MoleTask
)),
TaskKeyWord
(
objectName
(
FromContextTask
)),
HookKeyWord
(
objectName
(
FromContextHook
))
HookKeyWord
(
objectName
(
FromContextHook
)),
OtherKeyWord
(
objectName
(
CSVOutputFormat
))
)
}
...
...
openmole/plugins/org.openmole.plugin.hook.json/src/main/scala/org/openmole/plugin/hook/json/Activator.scala
View file @
d3f66d76
...
...
@@ -33,7 +33,10 @@ class Activator extends PluginInfoActivator {
import
org.openmole.core.pluginmanager.KeyWord._
val
keyWords
:
Vector
[
KeyWord
]
=
Vector
()
Vector
(
TaskKeyWord
(
objectName
(
JSONHook
)),
OtherKeyWord
(
objectName
(
JSONOutputFormat
))
)
PluginInfo
.
register
(
this
,
Vector
(
this
.
getClass
.
getPackage
),
keyWords
=
keyWords
)
ConfigurationInfo
.
register
(
...
...
openmole/plugins/org.openmole.plugin.hook.json/src/main/scala/org/openmole/plugin/hook/json/JSONHook.scala
0 → 100644
View file @
d3f66d76
package
org.openmole.plugin.hook.json
import
org.openmole.core.dsl._
import
org.openmole.core.dsl.extension._
object
JSONHook
{
def
apply
(
output
:
WritableOutput
,
values
:
Val
[
_
]*)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
FromContextHook
=
apply
(
output
,
values
.
toVector
)
def
apply
(
output
:
WritableOutput
,
values
:
Seq
[
Val
[
_
]]
=
Vector
.
empty
,
exclude
:
Seq
[
Val
[
_
]]
=
Vector
.
empty
)(
implicit
name
:
sourcecode.Name
,
definitionScope
:
DefinitionScope
)
:
FromContextHook
=
FormattedFileHook
(
format
=
JSONOutputFormat
(),
output
=
output
,
values
=
values
,
exclude
=
exclude
,
name
=
Some
(
"JSONHook"
)
)
}
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