Reordered few lines for clarity
@@ -20,6 +20,8 @@ public class TravisPlugin implements Plugin<Project> {
project.getPlugins().apply(GitSetupPlugin.class);
ReleaseConfiguration conf = project.getPlugins().apply(ReleaseConfigurationPlugin.class).getConfiguration();
+ conf.getBuild().setCommitMessage(System.getenv("TRAVIS_COMMIT_MESSAGE"));
+
String buildNo = System.getenv("TRAVIS_BUILD_NUMBER");
if (buildNo != null) {
conf.getGit().setCommitMessagePostfix("by Travis CI build " + buildNo + " [ci skip]");
@@ -29,11 +31,9 @@ public class TravisPlugin implements Plugin<Project> {
String pr = System.getenv("TRAVIS_PULL_REQUEST");
boolean isPullRequest = pr != null && !pr.trim().isEmpty() && !pr.equals("false");
+ conf.getBuild().setPullRequest(isPullRequest);
- conf.getBuild().setCommitMessage(System.getenv("TRAVIS_COMMIT_MESSAGE"));
GitCheckOutTask gitCheckOutTask = (GitCheckOutTask) project.getTasks().getByName(CHECKOUT_BRANCH_TASK);
gitCheckOutTask.setRev(System.getenv("TRAVIS_BRANCH"));
-
- conf.getBuild().setPullRequest(isPullRequest);
}
}
