Overwrite Gradle's "BUILD SUCCESSFUL" message

(charleston.thai) #1

Hi, In my build.gradle, I invoke ant api as followed

ant.taskdef(name: ‘sshexec’, classname: ‘org.apache.tools.ant.taskdefs.optional.ssh.SSHExec’, classpath: configurations.sshAntTask)

ant.sshexec(host: myhost, username: mylogin, password: mypass, command: “cd /xyz”, trust: ‘true’, failonerror: ‘false’)

In this scenario, since /xyz does not exists, it will failed and return by ant.sshexec.

But, from gradle, it will still show “BUILD SUCCESSFUL”.

Is there any way to overwrite this based on the result of calling ant.sshexec such that it will show “BUILD FAILED”?

thanks, ct

(Peter Niederwieser) #2

It should be good enough to not set ‘failOnError’.