@@ -23,8 +23,6 @@ import groovyx.gpars.dataflow.DataflowWriteChannel
23
23
import nextflow.exception.MissingValueException
24
24
import nextflow.exception.ScriptRuntimeException
25
25
import nextflow.extension.CH
26
- import nextflow.extension.PublishOp
27
-
28
26
/**
29
27
* Models a script workflow component
30
28
*
@@ -42,8 +40,6 @@ class WorkflowDef extends BindableDef implements ChainableDef, ExecutionContext
42
40
43
41
private List<String > declaredOutputs
44
42
45
- private Map<String ,Map > declaredPublish
46
-
47
43
private Set<String > variableNames
48
44
49
45
private BaseScript owner
@@ -67,7 +63,6 @@ class WorkflowDef extends BindableDef implements ChainableDef, ExecutionContext
67
63
// now it can access the parameters
68
64
this . declaredInputs = new ArrayList<> (resolver. getTakes(). keySet())
69
65
this . declaredOutputs = new ArrayList<> (resolver. getEmits(). keySet())
70
- this . declaredPublish = new LinkedHashMap<> (resolver. getPublish())
71
66
this . variableNames = getVarNames0()
72
67
}
73
68
@@ -164,29 +159,7 @@ class WorkflowDef extends BindableDef implements ChainableDef, ExecutionContext
164
159
}
165
160
return new ChannelOut (channels)
166
161
}
167
-
168
- protected publishOutputs (Map<String ,Map > publishDefs ) {
169
- for ( Map.Entry < String ,Map > pub : publishDefs. entrySet() ) {
170
- final name = pub. key
171
- final opts = pub. value
172
- if ( ! binding. hasVariable(name) )
173
- throw new MissingValueException (" Missing workflow publish parameter: $name " )
174
- final obj = binding. getVariable(name)
175
-
176
- if ( CH . isChannel(obj) ) {
177
- new PublishOp (CH . getReadChannel(obj), opts). apply()
178
- }
179
-
180
- else if ( obj instanceof ChannelOut ) {
181
- for ( DataflowWriteChannel ch : ((ChannelOut )obj) ) {
182
- new PublishOp (CH . getReadChannel(ch), opts). apply()
183
- }
184
- }
185
-
186
- else throw new IllegalArgumentException (" Illegal workflow publish parameter: $name value: $obj " )
187
- }
188
- }
189
-
162
+
190
163
191
164
Object run (Object [] args ) {
192
165
binding = new WorkflowBinding (owner)
@@ -208,7 +181,6 @@ class WorkflowDef extends BindableDef implements ChainableDef, ExecutionContext
208
181
closure. call()
209
182
// collect the workflow outputs
210
183
output = collectOutputs(declaredOutputs)
211
- publishOutputs(declaredPublish)
212
184
return output
213
185
}
214
186
@@ -223,12 +195,10 @@ class WorkflowParamsResolver implements GroovyInterceptable {
223
195
224
196
static final private String TAKE_PREFIX = ' _take_'
225
197
static final private String EMIT_PREFIX = ' _emit_'
226
- @Deprecated static final private String PUBLISH_PREFIX = ' _publish_'
227
198
228
199
229
200
Map<String ,Object > takes = new LinkedHashMap<> (10 )
230
201
Map<String ,Object > emits = new LinkedHashMap<> (10 )
231
- Map<String ,Map > publish = new LinkedHashMap<> (10 )
232
202
233
203
@Override
234
204
def invokeMethod (String name , Object args ) {
@@ -238,14 +208,8 @@ class WorkflowParamsResolver implements GroovyInterceptable {
238
208
else if ( name. startsWith(EMIT_PREFIX ) )
239
209
emits. put(name. substring(EMIT_PREFIX . size()), args)
240
210
241
- else if ( name. startsWith(PUBLISH_PREFIX )) {
242
- log. warn1 " Workflow `publish` is deprecated -- Use process directive `publishDir` instead"
243
- publish. put(name. substring(PUBLISH_PREFIX . size()), argToPublishOpts(args))
244
- }
245
-
246
211
else
247
212
throw new MissingMethodException (name, WorkflowDef , args)
248
-
249
213
}
250
214
251
215
private Map argsToMap (Object args ) {
0 commit comments