Skip to content

Commit

Permalink
[JENKINS-37781] fixing the compilation of the compiler
Browse files Browse the repository at this point in the history
and cleaned up some debug echo
  • Loading branch information
rsandell committed Oct 26, 2016
1 parent dfab9e2 commit 9676206
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
Expand Up @@ -51,7 +51,7 @@ public class Stage implements NestedModel, Serializable {
PostStage post

@Whitelisted
Closure<Boolean> when
StepsBlock when

@Whitelisted
Stage name(String n) {
Expand Down Expand Up @@ -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
}
Expand Down
Expand Up @@ -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()
}
Expand Down
Expand Up @@ -31,7 +31,6 @@
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.IOException;

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

0 comments on commit 9676206

Please sign in to comment.