Skip to content
Permalink
Browse files

[JENKINS-37781] fixing the compilation of the compiler

and cleaned up some debug echo
  • Loading branch information...
rsandell committed Oct 26, 2016
1 parent dfab9e2 commit 9676206a2bc0ec8b93624ae8fc7cf907e8273b4e
@@ -51,7 +51,7 @@ public class Stage implements NestedModel, Serializable {
PostStage post

@Whitelisted
Closure<Boolean> when
StepsBlock when

@Whitelisted
Stage name(String n) {
@@ -84,7 +84,7 @@ public class Stage implements NestedModel, Serializable {
}

@Whitelisted
Stage when(Closure<Boolean> when) {
Stage when(StepsBlock when) {
this.when = when
return this
}
@@ -291,16 +291,13 @@ public class ModelInterpreter implements Serializable {
}

def runStageOrNot(Stage stage, Throwable firstError, Closure body) {
script.echo "Run stage or not!"
if (stage.when != null && firstError == null) {
script.echo "One when!"
return {
if (stage.when.call()) {
if (setUpDelegate(stage.when.closure).call()) {
body.call()
}
}
} else {
script.echo "No when!"
return {
body.call()
}
@@ -31,7 +31,6 @@
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.IOException;

/**
* Tests {@link Stage#when}
@@ -27,10 +27,6 @@ pipeline {
agent label: "here"
stages {
stage("One") {
when {
echo "Should I run?"
return true
}
steps {
echo "Hello"
}

0 comments on commit 9676206

Please sign in to comment.
You can’t perform that action at this time.