Skip to content

Commit

Permalink
Merge pull request #53 from ndw/docbook-5.2
Browse files Browse the repository at this point in the history
A complete reorg and update to the books
  • Loading branch information
ndw committed Oct 31, 2019
2 parents 63cf1c9 + 7b5e4de commit 457b9eb
Show file tree
Hide file tree
Showing 6,344 changed files with 22,193 additions and 615,983 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
File renamed without changes.
16 changes: 7 additions & 9 deletions .circleci/config.yml
Expand Up @@ -25,20 +25,18 @@ jobs:
keys:
- v1-dependencies-

- run: gradle dependencies
- run: ./gradlew dependencies

- save_cache:
paths:
- ~/.gradle
key: v1-dependencies-{{ checksum "en/defguide5/build.gradle" }}
key: v1-dependencies-{{ checksum "build.gradle" }}

- run:
working_directory: ~/defguide/en/defguide5
command: ./gradlew --no-daemon tdg
no_output_timeout: 30m
working_directory: ~/defguide
command: ./gradlew --no-daemon
no_output_timeout: 60m

- run:
working_directory: ~/defguide/en/defguide5
command: ../bin/circle-ci-deploy.sh


working_directory: ~/defguide
command: tools/bin/circle-ci-deploy.sh
5 changes: 3 additions & 2 deletions .gitignore
@@ -1,2 +1,3 @@
/en/resources/css/.sass-cache/
/en/resources/css/defguide.css.map
/src/resources/css/.sass-cache/
/src/resources/css/defguide.css.map
/.gradle/
359 changes: 359 additions & 0 deletions build.gradle
@@ -0,0 +1,359 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "http://maven.restlet.org" }
}

// Get rid of that [expletive deleted] warning about xml-apis 2.0.2/1.0.b2
configurations.all {
resolutionStrategy {
force 'xml-apis:xml-apis:1.4.01'
}
}

dependencies {
classpath group: 'org.docbook', name: 'docbook-xslt2', version: docbookXsltVersion
classpath group: 'org.docbook', name: 'docbook-schemas', version: '5.1-1'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-print', version: '1.1.5'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.5'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash', version: '1.1.29-99'
classpath group: 'org.xmlresolver', name: 'xmlresolver', version: '1.0.1'
classpath group: 'gradle.plugin.com.dorongold.plugins', name: 'task-tree', version: '1.4'
}
}

plugins {
id "de.undercouch.download" version "3.4.3"
id "groovy"
id "com.dorongold.task-tree" version "1.4"
}

repositories {
mavenLocal()
mavenCentral()
}

// Get rid of that [expletive deleted] warning about xml-apis 2.0.2/1.0.b2
configurations.all {
resolutionStrategy {
force 'xml-apis:xml-apis:1.4.01'
force 'org.xmlresolver:xmlresolver:1.0.1'
}
}

configurations {
tools {
description = "Run tools"
transitive = true
}
}

dependencies {
tools (
[group: 'org.relaxng', name: 'jing', version: '20181204'],
[group: 'org.relaxng', name: 'trang', version: '20181204']
)
}

defaultTasks "allBooks"

apply plugin: 'org.docbook.task'
apply plugin: 'com.xmlcalabash.task'
apply plugin: 'com.dorongold.task-tree'

import org.docbook.DocBookTask
import com.xmlcalabash.XMLCalabashTask
import de.undercouch.gradle.tasks.download.Download

// ======================================================================

def absuri(String path) {
def spath = path
if (!spath.endsWith("/")) {
spath = spath + "/"
}
def cpath = new File(spath).getCanonicalPath()
return "file://" + cpath + "/"
}

// ======================================================================
// Define some globals

def books = ["defguide",
"publishers",
"sdocbook",
"slides",
"website"]

def bookVersion = ["defguide": defguideBookVersion,
"publishers": publishersBookVersion,
"sdocbook": sdocbookBookVersion,
"slides": slidesBookVersion,
"website": websiteBookVersion ]

// ======================================================================

task hello() {
doFirst {
println("Hello, world.")
}
}

task gitLogSummary(type: Exec) {
inputs.file "tools/bin/git-log-summary"
outputs.file "build/gitlog.xml"
commandLine "tools/bin/git-log-summary", "-o", "build/gitlog.xml"
doFirst {
mkdir("build")
}
}

task allBooks() {
// just a dependency
}

clean {
doFirst {
delete("build")
}
}

// ======================================================================
// Generate tasks parameterized by vocabulary

books.each { vocab ->
def rndFile = new File("src/lib/${vocab}.rnd").getCanonicalPath()

task "${vocab}_patterns"(type: XMLCalabashTask) {
input("source", "src/${vocab}/patterns.xml")
input("stylesheet", "tools/xsl/patterns.xsl")
output("result", "build/${vocab}/patterns.xml")
param("rngfile", rndFile)
pipeline "tools/xpl/style.xpl"
doFirst {
mkdir("build/${vocab}")
}
}

task "${vocab}_refpageExamples"(type: Copy) {
from "src/refpages/examples"
into "build/${vocab}/refpages/examples"
include "*"
doFirst {
mkdir("build/${vocab}/refpages/examples")
}
}

task "${vocab}_bookmeta"(type: XMLCalabashTask) {
input("source", "src/${vocab}/bookinfo.xml")
output("result", "build/${vocab}/bookinfo.xml")
param("bookVersion", bookVersion[vocab])
param("docbookVersion", docbookVersion)
pipeline "tools/xpl/bookmeta.xpl"
doFirst {
mkdir("build/${vocab}")
}
}

task "${vocab}_refpageListElements"(type: XMLCalabashTask) {
inputs.file "tools/xsl/elem-xi.xsl"
inputs.file "tools/xpl/element-list.xpl"
input("source", rndFile)
output("result", "build/${vocab}/list-elements.xml")
pipeline "tools/xpl/element-list.xpl"
doFirst {
mkdir("build/${vocab}")
}
}

task "${vocab}_copysrc"(type: Copy) {
from "src/${vocab}"
into "build/${vocab}"
include "**/*"
exclude "bookinfo.xml"
exclude "patterns.xml"
exclude "list-elements.xml"
exclude "list-assembly.xml" // only in defguide, but harmless
}

task "${vocab}_copyresources"(dependsOn: ["${vocab}_copyresources_src",
"${vocab}_copyresources_dist"]) {
// Once so the stylesheet can read the dimensions
// Once so it's in the actual published output
}

task "${vocab}_copyresources_src"(type: Copy) {
from "src/resources"
into "build/${vocab}"
include "**/*"
}

task "${vocab}_copyresources_dist"(type: Copy) {
from "src/resources"
into "build/dist/${vocab}"
include "**/*"
exclude "figs/src"
exclude "figs/print"
}

task "${vocab}_tdgxml"(dependsOn: ["${vocab}_copysrc",
"${vocab}_bookmeta",
"${vocab}_patterns",
"${vocab}_refpages"],
type: XMLCalabashTask) {
inputs.dir "build/${vocab}"
input("source", "build/${vocab}/book5.xml")
output("result", "build/${vocab}/tdg.xml")
pipeline "tools/xpl/xinclude.xpl"
}

task "${vocab}_refpages"(dependsOn: ["${vocab}_refpageListElements",
"${vocab}_refpageExamples",
"gitLogSummary"],
type: XMLCalabashTask) {
inputs.dir "src/refpages/elements"
inputs.file "tools/xsl/refentry.xsl"
inputs.file "tools/xpl/refpages.xpl"
inputs.file "src/${vocab}/seealso.xml"
outputs.dir "build/${vocab}/refpages"
option("rnd", rndFile)
option("src", absuri("src/${vocab}/"))
option("dst", absuri("build/${vocab}/refpages/"))
outputs.dir "build/${vocab}/refpages"
input("source", rndFile)
pipeline "tools/xpl/refpages.xpl"
}

task "${vocab}"(dependsOn: ["${vocab}_xml", "${vocab}_copyresources" ],
type: DocBookTask) {
inputs.file "tools/xsl/chunk.xsl"
inputs.file "tools/xsl/custom.xsl"
input("source", "build/${vocab}/book.xml")
option("style", "tools/xsl/chunk.xsl")
param("output.dir", System.getProperty('user.dir') + "/build/dist/")
param("base.dir", "build/dist/${vocab}/")
param("html.ext", ".html")
param("rngfile", rndFile)
param("bookVersion", bookVersion[vocab])
param("docbookXsltVersion", docbookXsltVersion)
param("resource.root", "")
doFirst {
mkdir("build/dist/${vocab}")
}
}

allBooks.dependsOn "${vocab}"
}

// ======================================================================

defguide_refpages.dependsOn "defguide_refpageListAssembly"

task defguide_refpageListAssembly(type: XMLCalabashTask) {
inputs.file "tools/xsl/elem-xi.xsl"
inputs.file "tools/xpl/element-list.xpl"

input("source", new File(defguideRnd).getCanonicalPath())
output("result", "build/defguide/list-assembly.xml")
pipeline "tools/xpl/element-list.xpl"

option("manual","assembly")

doFirst {
mkdir("build")
}
}

task defguide_xml(dependsOn: ['defguide_tdgxml'], type: XMLCalabashTask) {
inputs.file file("tools/xsl/purpose.xsl")
inputs.file file("tools/xsl/tdg2db.xsl")
inputs.file file("tools/xsl/profile.xsl")
inputs.file file("build/defguide/style/purpose.xsl")

input("source", "build/defguide/tdg.xml")
output("result", "build/defguide/book.xml")
option("arch", "assembly defguide")
option("revision", "5.0 5.1 5.2")
// This crazy list of conditions is a side effect of the fact that
// I carelessly decided to override the condition attribute for
// something else in the reference pages. :-(
option("condition", "expanded ref.desc.attribute-descriptions ref.desc.attributes ref.desc.children ref.desc.parents ref.description ref.desc.rules ref.desc.seealso ref.examples refpages web")
pipeline "tools/xpl/make-book.xpl"
}

// ======================================================================

task publishers_xml(dependsOn: ['publishers_tdgxml'], type: XMLCalabashTask) {
inputs.file file("tools/xsl/purpose.xsl")
inputs.file file("tools/xsl/tdg2db.xsl")
inputs.file file("tools/xsl/profile.xsl")
inputs.file file("build/publishers/style/purpose.xsl")

input("source", "build/publishers/tdg.xml")
output("result", "build/publishers/book.xml")
option("arch", "publishers")
option("revision", "5.0 5.1 5.2 1.0 1.1 1.2")
// This crazy list of conditions is a side effect of the fact that
// I carelessly decided to override the condition attribute for
// something else in the reference pages. :-(
option("condition", "expanded ref.desc.attribute-descriptions ref.desc.attributes ref.desc.children ref.desc.parents ref.description ref.desc.rules ref.desc.seealso ref.examples refpages web")
pipeline "tools/xpl/make-book.xpl"
}

// ======================================================================

task sdocbook_xml(dependsOn: ['sdocbook_tdgxml'], type: XMLCalabashTask) {
inputs.file file("tools/xsl/purpose.xsl")
inputs.file file("tools/xsl/tdg2db.xsl")
inputs.file file("tools/xsl/profile.xsl")
inputs.file file("build/sdocbook/style/purpose.xsl")

input("source", "build/sdocbook/tdg.xml")
output("result", "build/sdocbook/book.xml")
option("arch", "sdocbook")
option("revision", "5.0 5.1 5.2")
// This crazy list of conditions is a side effect of the fact that
// I carelessly decided to override the condition attribute for
// something else in the reference pages. :-(
option("condition", "expanded ref.desc.attribute-descriptions ref.desc.attributes ref.desc.children ref.desc.parents ref.description ref.desc.rules ref.desc.seealso ref.examples refpages web")
pipeline "tools/xpl/make-book.xpl"
}

// ======================================================================

task slides_xml(dependsOn: ['slides_tdgxml'], type: XMLCalabashTask) {
inputs.file file("tools/xsl/purpose.xsl")
inputs.file file("tools/xsl/tdg2db.xsl")
inputs.file file("tools/xsl/profile.xsl")
inputs.file file("build/slides/style/purpose.xsl")

input("source", "build/slides/tdg.xml")
output("result", "build/slides/book.xml")
option("arch", "sdocbook slides")
option("revision", "5.0 5.1 5.2")
// This crazy list of conditions is a side effect of the fact that
// I carelessly decided to override the condition attribute for
// something else in the reference pages. :-(
option("condition", "expanded ref.desc.attribute-descriptions ref.desc.attributes ref.desc.children ref.desc.parents ref.description ref.desc.rules ref.desc.seealso ref.examples refpages web")
pipeline "tools/xpl/make-book.xpl"
}

// ======================================================================

task website_xml(dependsOn: ['website_tdgxml'], type: XMLCalabashTask) {
inputs.file file("tools/xsl/purpose.xsl")
inputs.file file("tools/xsl/tdg2db.xsl")
inputs.file file("tools/xsl/profile.xsl")
inputs.file file("build/website/style/purpose.xsl")

input("source", "build/website/tdg.xml")
output("result", "build/website/book.xml")
option("arch", "slides website")
option("revision", "5.0 5.1 5.2")
// This crazy list of conditions is a side effect of the fact that
// I carelessly decided to override the condition attribute for
// something else in the reference pages. :-(
option("condition", "expanded ref.desc.attribute-descriptions ref.desc.attributes ref.desc.children ref.desc.parents ref.description ref.desc.rules ref.desc.seealso ref.examples refpages web")
pipeline "tools/xpl/make-book.xpl"
}

0 comments on commit 457b9eb

Please sign in to comment.