Skip to content
Snippets Groups Projects
Commit 97f72c94 authored by George Adrian Stoica's avatar George Adrian Stoica
Browse files

added skeleton for the "pdfSlides" gradle task that will perform the

actual export #8
parent eddda401
No related branches found
No related tags found
No related merge requests found
Pipeline #53197 passed
...@@ -114,11 +114,13 @@ revealjsPlugins { ...@@ -114,11 +114,13 @@ revealjsPlugins {
import org.apache.tools.ant.taskdefs.condition.Os import org.apache.tools.ant.taskdefs.condition.Os
def dockerAvailable;
task checkDocker { task checkDocker {
doLast{ doLast{
def result = 1 def result = 1
if (Os.isFamily(Os.FAMILY_WINDOWS)) { if (Os.isFamily(Os.FAMILY_WINDOWS)) {
println "*** WINDOWS " println "windows os"
result = exec{ result = exec{
def command = "/c docker --version" def command = "/c docker --version"
ignoreExitValue = true ignoreExitValue = true
...@@ -126,20 +128,37 @@ task checkDocker { ...@@ -126,20 +128,37 @@ task checkDocker {
} }
} else { } else {
//we assume linux/mac with bash if not having windows -
//more fine tuned testing can be done if needed
println "linux / unix os"
result = exec{ result = exec{
def command = "command -v docker" def command = "command -v docker"
ignoreExitValue = true ignoreExitValue = true
executable "bash" args "-l", "-c", command executable "bash" args "-l", "-c", command
} }
} }
if(result.getExitValue()==0){ if(result.getExitValue()==0){
println "Has Docker" println "docker available"
dockerAvailable = true
} else { } else {
print "No Docker" print "no docker available"
dockerAvailable = false
} }
} }
} }
build.dependsOn 'asciidoctorRevealJs' task pdfSlides {
if (dockerAvailable){
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
println "run windows script"
} else {
println "run linux / unix script"
}
} else {
println "docker is not available on this machine"
}
}
build.dependsOn 'asciidoctorRevealJs'
pdfSlides.dependsOn 'checkDocker'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment