Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ task make_etc() {

["steps", "step-file", "step-os", "step-paged-media",
"step-run", "step-text", "step-mail", "step-rdf", "step-validation",
"step-ixml"
"step-ixml", "step-message"
].each { spec ->
Task t = task "copy_${spec}_build"(dependsOn: [ "buildspecs" ], type: Copy) {
from "$spec/build/"
Expand Down Expand Up @@ -706,6 +706,59 @@ task step_ixml_xpl(dependsOn: ["step-ixml:library"], type: Copy) {
rename ("library.xml", "steps.xpl")
}

// ======================================================================
// step-message

task step_message(type: DocBookTask,
dependsOn: [ "download_xproc_toc",
"steps", "xproc_schemas", "spec_schemas",
"step-message:specification",
"step_message_assets",
"step_message_src", "step_message_xpl" ]) {
inputs.files fileTree(dir: "tools/xsl/")
inputs.files fileTree(dir: "tools/xpl/")
inputs.file "build/xproc/toc.xml"
input("source", "step-message/build/source.xml")
output("result", "build/dist/message/index.html")

param("schemaext.schema", file("build/schema/dbspec.rng"))
param("ci", getenv("CIWORKFLOW"))
param("ci-commit", getenv("CI_SHA1"))
param("ci-build-number", getenv("CI_BUILD_NUM"))
param("ci-user", getenv("CI_PROJECT_USERNAME"))
param("ci-repo", getenv("CI_PROJECT_REPONAME"))
param("ci-branch", getenv("CI_BRANCH"))
param("ci-tag", getenv("CI_TAG"))

option("style", file("tools/xsl/xproc-specs.xsl"))
option("diff", '')
option("specid", "message")
option("diffloc", buildAbsDir + "/message/diff.html")

pipeline "tools/xpl/formatspec.xpl"
}
buildspecs.dependsOn "step_message"

task step_message_assets(type: Copy) {
from "src/main/resources"
into "build/dist/message/"
}

task step_message_src(dependsOn: ["step-message:source"], type: Copy) {
from "step-message/build/"
into "build/dist/message/"
include "source.xml"
rename ("source.xml", "specification.xml")
}

task step_message_xpl(dependsOn: ["step-message:library"], type: Copy) {
from "step-message/build/"
into "build/dist/message/"
include "library.xml"
rename ("library.xml", "steps.xpl")
}


// ======================================================================
// Clean up

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include 'steps', 'step-validation', 'step-os', 'step-paged-media', 'step-run',
'step-file', 'step-text', 'step-mail', 'step-ixml'
'step-file', 'step-text', 'step-mail', 'step-ixml', 'step-message'
95 changes: 95 additions & 0 deletions step-message/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
repositories {
mavenLocal()
mavenCentral()
}

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

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

defaultTasks 'specification'

apply plugin: 'com.xmlcalabash.task'

import com.xmlcalabash.XMLCalabashTask
import com.nwalsh.tasks.StripAmblesTask

task xinclude(dependsOn: [":spec_schemas"], type: XMLCalabashTask) {
inputs.files fileTree(dir: "src/main/xml/")
outputs.file "build/xinclude.xml"
input("source", "src/main/xml/specification.xml")
output("result", "build/xinclude.xml")
pipeline "../tools/xpl/validate.xpl"
}
xinclude.doFirst {
mkdir("build")
}

task source(dependsOn: ["glossary"], type: XMLCalabashTask) {
inputs.file "../tools/xsl/masterbib.xsl"
inputs.file "../src/main/xml/bibliography.xml"
inputs.file "src/main/xml/specification.xml"
inputs.file "build/glossary.xml"
outputs.file "build/source.xml"
input("source", "src/main/xml/specification.xml")
output("result", "build/source.xml")
pipeline "../tools/xpl/validate.xpl"
}

task glossary(dependsOn: ["xinclude"], type: XMLCalabashTask) {
inputs.file "build/xinclude.xml"
inputs.file "../tools/xpl/makeglossary.xpl"
inputs.file "../tools/xsl/makeglossary.xsl"
outputs.file "build/glossary.xml"
input("source", "build/xinclude.xml")
output("result", "build/glossary.xml")
pipeline "../tools/xpl/makeglossary.xpl"
}

task library(dependsOn: ["source"], type: XMLCalabashTask) {
inputs.file "build/source.xml"
inputs.file "../tools/xpl/typed-pipeline-library.xpl"
inputs.file "../tools/xsl/typed-pipeline-library.xsl"
outputs.file "build/library.xml"
input("source", "build/source.xml")
output("result", "build/library.xml")
pipeline "../tools/xpl/typed-pipeline-library.xpl"
}

task rnc(dependsOn: ["library"], type: XMLCalabashTask) {
inputs.file "build/library.xml"
inputs.file "../tools/xpl/library-to-rnc.xpl"
inputs.file "../tools/xsl/library-to-rnc.xsl"
outputs.file "build/steps.rnc"
input("source", "build/library.xml")
output("result", "build/steps.rnc")
pipeline "../tools/xpl/library-to-rnc.xpl"
}

task rng(dependsOn: ["rnc"], type: JavaExec) {
inputs.file "build/steps.rnc"
outputs.file "build/steps.rng"
classpath = configurations.tools
mainClass = 'com.thaiopensource.relaxng.translate.Driver'
args = ["build/steps.rnc", "build/steps.rng"]
}

task specification(dependsOn: [ "source", "library", "rng" ]) {
// nop
}

task clean() {
doFirst {
delete("build")
}
}
9 changes: 9 additions & 0 deletions step-message/build/glossary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<appendix xmlns:db="http://docbook.org/ns/docbook" xmlns="http://docbook.org/ns/docbook" xml:id="glossary"><title>Glossary</title><glosslist><glossentry><glossterm>implementation-defined</glossterm><glossdef><para>An
<firstterm>implementation-defined</firstterm> feature is one where the
implementation has discretion in how it is performed.
Conformant implementations <rfc2119>must</rfc2119> document
how <glossterm role="unwrapped">implementation-defined</glossterm> features are performed.</para></glossdef></glossentry><glossentry><glossterm>implementation-dependent</glossterm><glossdef><para>An
<firstterm>implementation-dependent</firstterm> feature is one where the
implementation has discretion in how it is performed.
Implementations are not required to document or explain
how <glossterm role="unwrapped">implementation-dependent</glossterm> features are performed.</para></glossdef></glossentry></glosslist></appendix>
10 changes: 10 additions & 0 deletions step-message/build/library.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<p:library xmlns:p="http://www.w3.org/ns/xproc"
xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"
version="3.1">
<p:declare-step type="p:message" xml:id="message">
<p:input port="source" sequence="true"/>
<p:output port="result" sequence="true"/>
<p:option name="test" as="xs:boolean" select="true()"/>
<p:option name="select" as="xs:string"/>
</p:declare-step>
</p:library>
Loading