Commit 9667fb9
committed
Merge branch 'script-processors'
This branch improves the script framework, adding a new
ScriptProcessor plugin so that scripts can be preprocessed
(in a way similar to the C preprocessor) prior to execution.
The parameter declaration syntax has been changed:
#@input String name
#@output String greeting
The old syntax is still supported, but the new syntax will mesh better
with other similar preprocessing directives such as:
#@repository("https://maven.imagej.net/content/groups/public")
#@dependency("net.imagej:imagej:2.0.0-rc-60")
(See the new scijava/scijava-grab repository for this feature.)
This branch also adds a new "shebang" syntax to declare language; e.g.:
#!groovy
So now it is no longer necessary to provide a dummy pseudo-path just
so the script framework can glean the language from the extension.
In all of these cases, the directives are stripped from the script
prior to execution (replaced with blank lines), to avoid confusing
the script engine itself.
The script processing mechanism itself is very general, allowing
processors to arbitrary mutate lines of scripts, so in the future,
this mechanism could allow for a variety of other neat features.File tree
13 files changed
+801
-264
lines changed- src
- main/java/org/scijava
- plugin
- script
- process
- test/java/org/scijava
- script
13 files changed
+801
-264
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| |||
0 commit comments