Skip to content

Commit a817111

Browse files
authored
Declare config options with ConfigScope (#44)
--------- Signed-off-by: Ben Sherman <[email protected]>
1 parent ff0b211 commit a817111

File tree

3 files changed

+127
-4
lines changed

3 files changed

+127
-4
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
java_version: [17]
21-
nextflow_version: ['24.10']
21+
nextflow_version: ['25.04']
2222

2323
steps:
2424
- name: Environment
@@ -51,4 +51,4 @@ jobs:
5151
run: make install
5252

5353
- name: Test
54-
run: nextflow run nf-prov-test/ -plugins nf-prov@1.4.0
54+
run: nextflow run nf-prov-test/ -plugins nf-prov@1.5.0

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ plugins {
33
id 'io.nextflow.nextflow-plugin' version '0.0.1-alpha3'
44
}
55

6-
version = '1.4.0'
6+
version = '1.5.0'
77

88
nextflowPlugin {
9-
nextflowVersion = '24.10.0'
9+
nextflowVersion = '25.04.0'
1010

1111
provider = 'nextflow'
1212
className = 'nextflow.prov.ProvPlugin'
1313
extensionPoints = [
14+
'nextflow.prov.ProvConfig',
1415
'nextflow.prov.ProvObserverFactory'
1516
]
1617

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/*
2+
* Copyright 2022, Seqera Labs
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package nextflow.prov
18+
19+
import nextflow.config.schema.ConfigOption
20+
import nextflow.config.schema.ConfigScope
21+
import nextflow.config.schema.ScopeName
22+
import nextflow.script.dsl.Description
23+
24+
@ScopeName('prov')
25+
@Description('''
26+
The `prov` scope allows you to configure the `nf-prov` plugin.
27+
''')
28+
class ProvConfig implements ConfigScope {
29+
30+
@ConfigOption
31+
@Description('Create the provenance report (default: `true` if plugin is loaded).')
32+
boolean enabled
33+
34+
@Description('Configuration scope for the desired output formats.')
35+
ProvFormatsConfig formats
36+
}
37+
38+
39+
class ProvFormatsConfig implements ConfigScope {
40+
41+
@Description('Configuration scope for the BCO output format.')
42+
ProvBcoConfig bco
43+
44+
@Description('Configuration scope for the DAG output format.')
45+
ProvDagConfig dag
46+
47+
@Description('Configuration scope for the legacy output format.')
48+
ProvLegacyConfig legacy
49+
50+
@Description('Configuration scope for the WRROC output format.')
51+
ProvWrrocConfig wrroc
52+
}
53+
54+
55+
class ProvBcoConfig implements ConfigScope {
56+
57+
@ConfigOption
58+
@Description('''
59+
The file name of the BCO manifest.
60+
''')
61+
String file
62+
63+
@ConfigOption
64+
@Description('''
65+
When `true` overwrites any existing BCO manifest with the same name.
66+
''')
67+
boolean overwrite
68+
}
69+
70+
71+
class ProvDagConfig implements ConfigScope {
72+
73+
@ConfigOption
74+
@Description('''
75+
The file name of the DAG diagram.
76+
''')
77+
String file
78+
79+
@ConfigOption
80+
@Description('''
81+
When `true` overwrites any existing DAG diagram with the same name.
82+
''')
83+
boolean overwrite
84+
}
85+
86+
87+
class ProvLegacyConfig implements ConfigScope {
88+
89+
@ConfigOption
90+
@Description('''
91+
The file name of the legacy manifest.
92+
''')
93+
String file
94+
95+
@ConfigOption
96+
@Description('''
97+
When `true` overwrites any existing legacy manifest with the same name.
98+
''')
99+
boolean overwrite
100+
}
101+
102+
103+
class ProvWrrocConfig implements ConfigScope {
104+
105+
@ConfigOption
106+
@Description('''
107+
The file name of the Workflow Run RO-Crate.
108+
''')
109+
String file
110+
111+
@ConfigOption
112+
@Description('''
113+
When `true` overwrites any existing Workflow Run RO-Crate with the same name.
114+
''')
115+
boolean overwrite
116+
117+
@ConfigOption
118+
@Description('''
119+
The license for the Workflow Run RO-Crate.
120+
''')
121+
String license
122+
}

0 commit comments

Comments
 (0)