|
| 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