JAL-3248 added conversion of building.md to building.html to gradle task. Will happen...
authorBen Soares <bsoares@dundee.ac.uk>
Mon, 10 Jun 2019 13:39:20 +0000 (14:39 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Mon, 10 Jun 2019 13:39:20 +0000 (14:39 +0100)
build.gradle
doc/building.html
gradle.properties

index e143b80..3e5901b 100644 (file)
@@ -455,7 +455,36 @@ task createBuildProperties(type: WriteProperties) {
   outputs.dir("$classes")
 }
 
+def buildingHTML = "$jalviewDir/$docDir/building.html"
+task deleteBuildingHTML(type: Delete) {
+  delete buildingHTML
+}
+
+task convertBuildingMD(type: Exec) {
+  dependsOn deleteBuildingHTML
+  def buildingMD = "$jalviewDir/$docDir/building.md"
+  def css = "$jalviewDir/$docDir/github.css"
+
+  def pandoc = pandoc_exec
+  if (! file(pandoc).exists() && hostname.equals("jv-bamboo")) {
+    pandoc = System.getProperty("user.home")+"/buildtools/pandoc/bin/pandoc"
+  }
+
+  if (file(pandoc).exists()) {
+    commandLine pandoc, '-s', '-o', buildingHTML, '--metadata', 'pagetitle="Building Jalview from Source"', '--toc', '-H', css, buildingMD
+  }
+  ignoreExitValue true
+
+  inputs.file(buildingMD)
+  inputs.file(css)
+  outputs.file(buildingHTML)
+}
+clean {
+  delete buildingHTML
+}
+
 task syncDocs(type: Sync) {
+  dependsOn convertBuildingMD
   def syncDir = "$classes/$docDir"
   from fileTree("$jalviewDir/$docDir")
   into syncDir
index 615f8ba..7669d30 100644 (file)
@@ -4,7 +4,7 @@
   <meta charset="utf-8" />
   <meta name="generator" content="pandoc" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
-  <title>Building Jalview from Source</title>
+  <title>"Building Jalview from Source"</title>
   <style>
       code{white-space: pre-wrap;}
       span.smallcaps{font-variant: small-caps;}
index 57119cb..1189f12 100644 (file)
@@ -111,5 +111,6 @@ JSIGN_SH = echo
 
 eclipse_extra_jdt_prefs_file = .settings/org.eclipse.jdt.core.jalview.prefs
 
+pandoc_exec = /usr/local/bin/pandoc
 dev = false