This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-script-interpreter.git
The following commit(s) were added to refs/heads/master by this push:
new 50debfe improve documentation
50debfe is described below
commit 50debfe43f96679394cbe75f8a4f71143636c24b
Author: Hervé Boutemy <[email protected]>
AuthorDate: Sun Sep 27 23:03:28 2020 +0200
improve documentation
---
src/site/apt/index.apt.vm | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
index 1bfb46a..e952a09 100644
--- a/src/site/apt/index.apt.vm
+++ b/src/site/apt/index.apt.vm
@@ -40,7 +40,7 @@ ${project.name}
</dependency>
+---------
-* Interpret beanshell script
+* Interpret BeanShell script
+---------
@@ -52,7 +52,7 @@ ${project.name}
+---------
-* Interpret a groovy script
+* Interpret a Groovy script
+---------
@@ -126,18 +126,28 @@ class MyMirrorHandler implements FileLoggerMirrorHandler
** Build context
- You can pass some values to your script using a execution context which have
the type <<<Map<String, ? extends Object> context>>>.
+ You can pass some values to your script using an execution context which
have the type <<<Map<String, ? extends Object> context>>>:
+---------
+private Map<String, Object> buildContext()
+{
Map<String, Object> context = new HashMap<String, Object>();
context.put( "foo", "bar" );
return context;
+}
++---------
+ Then values are available in scripts context:
+
++---------
// in your bsh script
String value = context.get( "foo" );
++---------
+
value will be "bar"
- // in your groovy script
++---------
+ // in your Groovy script
context.get("foo")
+---------
@@ -153,4 +163,3 @@ class MyMirrorHandler implements FileLoggerMirrorHandler
scriptRunner.run( "test", new File( "src/test/resources/bsh-test" ),
"verify", buildContext(),
new FileLogger( logFile ) );
+---------
-