Skip to content

Commit

Permalink
Check for existence of perl executable and skip if it doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Oct 10, 2024
1 parent 08a17da commit e3ac0ca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gradle/documentation/changes-to-html.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,16 @@ class ChangesToHtmlTask extends DefaultTask {

def toHtml(File versionsFile) {
def output = new ByteArrayOutputStream()

// Check if the perl executable exists
def perlExecutable = project.externalTool("perl")
if (!new File(perlExecutable).exists()) {
logger.warn("WARNING: Perl is not installed or could not be found at: ${perlExecutable}, skipping creating Changes.html")
return
}

def result = project.exec {
executable project.externalTool("perl")
perlExecutable
standardInput changesFile.newInputStream()
standardOutput project.file("${targetDir.get().getAsFile()}/Changes.html").newOutputStream()
errorOutput = output
Expand Down

0 comments on commit e3ac0ca

Please sign in to comment.