Skip to content

Commit

Permalink
Classify remote JAVA_EXEC failure with AsciidoctorRemoteExecutionExce…
Browse files Browse the repository at this point in the history
…ption (asciidoctor#377)
  • Loading branch information
ysb33r committed May 19, 2019
1 parent 6a32908 commit 6d9fd97
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import org.asciidoctor.gradle.internal.ExecutorUtils
import org.asciidoctor.gradle.internal.JavaExecUtils
import org.asciidoctor.gradle.remote.AsciidoctorJExecuter
import org.asciidoctor.gradle.remote.AsciidoctorJavaExec
import org.asciidoctor.gradle.remote.AsciidoctorRemoteExecutionException
import org.gradle.api.Action
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
Expand Down Expand Up @@ -985,14 +986,18 @@ class AbstractAsciidoctorTask extends DefaultTask {
logger.debug("Serialised AsciidoctorJ configuration to ${execConfigurationData}")
logger.info "Running AsciidoctorJ instance with classpath ${javaExecClasspath.files}"

project.javaexec { JavaExecSpec jes ->
configureForkOptions(jes)
logger.debug "Running AsciidoctorJ instance with environment: ${jes.environment}"
jes.with {
main = AsciidoctorJavaExec.canonicalName
classpath = javaExecClasspath
args execConfigurationData.absolutePath
try {
project.javaexec { JavaExecSpec jes ->
configureForkOptions(jes)
logger.debug "Running AsciidoctorJ instance with environment: ${jes.environment}"
jes.with {
main = AsciidoctorJavaExec.canonicalName
classpath = javaExecClasspath
args execConfigurationData.absolutePath
}
}
} catch (Exception e) {
throw new AsciidoctorRemoteExecutionException("Remote Asciidoctor process failed to complete successfully", e)
}

executorConfigurations
Expand Down

0 comments on commit 6d9fd97

Please sign in to comment.