Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build cleanup #129

Merged
merged 10 commits into from
Jan 13, 2019
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
5 changes: 5 additions & 0 deletions .calabash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- -*- nxml -*- -->
<cc:xproc-config xmlns:cc="http://xmlcalabash.com/ns/configuration">
<cc:extension-function class-name="org.docbook.extensions.xslt20.ImageProperties"/>
<cc:extension-function class-name="org.docbook.extensions.xslt20.Cwd"/>
</cc:xproc-config>
70 changes: 36 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@ buildscript {
dependencies {
classpath files("lib")
classpath fileTree(dir: 'lib').include("*.jar")
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-print', version: '1.1.4'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-print', version: '1.1.5'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash', version: xmlCalabashVersion
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.3'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.5'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-deltaxml', version: '1.1.5'
classpath group: 'org.docbook', name: 'docbook-schemas', version: '5.1-1'
}
}

plugins {
id "java"
id "osgi"
id "groovy"
id "maven"
id "maven-publish"
id "signing"
id "de.undercouch.download" version "2.0.0"
id "de.undercouch.download" version "3.4.3"
}

defaultTasks 'compileXslt'
Expand All @@ -43,6 +42,12 @@ repositories {
maven { url "https://maven.restlet.com" }
}

configurations.all {
resolutionStrategy {
force 'xml-apis:xml-apis:1.4.01'
}
}

configurations {
pluginApi
}
Expand All @@ -51,17 +56,17 @@ dependencies {
compile fileTree(dir: 'lib').include("*.jar")
compile (
[group: 'net.sf.saxon', name: 'Saxon-HE', version: saxonVersion],
[group: 'com.thaiopensource', name: 'jing', version: '20091111', transitive: false],
[group: 'org.relaxng', name: 'jing', version: '20181222' ],
[group: 'com.xmlcalabash', name: 'xmlcalabash', version: xmlCalabashVersion],
[group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.3'],
[group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.5'],

// 1.2 because that's what gradleApi requires :-(
[group: 'commons-cli', name: 'commons-cli', version: '1.2']
)

runtime (
[group: 'com.xmlcalabash', name: 'xmlcalabash1-print', version: '1.1.4'],
[group: 'com.thaiopensource', name: 'trang', version: '20091111']
[group: 'org.relaxng', name: 'trang', version: '20181222' ],
[group: 'com.xmlcalabash', name: 'xmlcalabash1-print', version: '1.1.5'],
)

pluginApi gradleApi()
Expand Down Expand Up @@ -104,10 +109,6 @@ sourceSets {
}
}

wrapper {
gradleVersion = '4.9'
}

// ======================================================================
// Compile the stylesheets

Expand Down Expand Up @@ -166,9 +167,9 @@ locales.each { File file ->

Task t = task "gentext_$name"(type: XMLCalabashTask) {
inputs.file in_name
inputs.file "tools/gentext.xpl"
inputs.file "build/schemas/locale.rng"
inputs.file "tools/build-l10n.xsl"
inputs.file "tools/gentext.xpl"
inputs.file "build/schemas/locale.rng"
inputs.file "tools/build-l10n.xsl"
outputs.file out_name
input("source", in_name)
output("result", out_name)
Expand Down Expand Up @@ -243,7 +244,7 @@ task test_print_fo(dependsOn: [ "setupTestResources" ]) {
};
test.dependsOn test_print_fo

def tests = fileTree(dir: "src/test/xml/").include(testsrc)
def tests = fileTree(dir: "src/test/xml/", exclude: ['**/linkbase.xml']).include(testsrc)
tests.each { File file ->
String filename = file.getName()
String testname = filename.substring(0, filename.lastIndexOf("."))
Expand Down Expand Up @@ -273,13 +274,14 @@ tests.each { File file ->
inputs.dir "xslt"
inputs.dir "src/main/gentext"
inputs.dir "tools/test"
outputs.file "build/test/actual-print-css/" + testname + ".html"
outputs.file "build/test/actual-print-css/" + testname + ".pdf"
option("name", testname)
option("resultdir", "../../build/test/result-print-css/")
option("actualdir", "../../build/test/actual-print-css/")
option("expecteddir", "../../src/test/expected-print-css/")
option("diffdir", "../../build/test/diff-print-css/")
option("format", "cssprint")
option("css", "build/xslt/base/css/print.css")
option("preprocess", pre_print_css)
option("postprocess", post_print_css)
pipeline "tools/test/printtest.xpl"
Expand All @@ -291,7 +293,7 @@ tests.each { File file ->
inputs.dir "xslt"
inputs.dir "src/main/gentext"
inputs.dir "tools/test"
outputs.file "build/test/actual-print-fo/" + testname + ".html"
outputs.file "build/test/actual-print-fo/" + testname + ".pdf"
option("name", testname)
option("resultdir", "../../build/test/result-print-fo/")
option("actualdir", "../../build/test/actual-print-fo/")
Expand Down Expand Up @@ -346,6 +348,8 @@ task testReport(type: XMLCalabashTask,
output("result", "build/test/index.html")
pipeline("tools/test/report.xpl")
}
// Make the report part of the standard 'test' target build
test.dependsOn testReport

task copy_test_css(type: Copy) {
from 'src/test/resources'
Expand Down Expand Up @@ -504,24 +508,22 @@ task copyJar(type: Copy, dependsOn: [ "jar" ]) {
jar {
baseName "docbook-xslt2"
manifest {
instruction 'Built-By', builtBy
instruction 'Implementation-Vendor', 'Norman Walsh'
instruction 'Implementation-Title', 'DocBook XSLT Stylesheets'
instruction 'Implementation-Version', project.ext.distVersion
instruction 'Main-Class', 'org.docbook.Main'
instruction 'Bundle-SymbolicName', 'org.docbook'
instruction 'Bundle-RequiredExecutionEnvironment', 'J2SE-1.7'
instruction 'Export-Package', '*, etc'
instruction 'Import-Package', 'net.sf.saxon.*;version=' + project.ext.saxonRelease + ',\
javax.xml.*,\
*;resolution:=optional'
instruction 'DynamicImport-Package', '*'
attributes "Built-By": builtBy
attributes "Implementation-Vendor": "Norman Walsh"
attributes "Implementation-Title": "DocBook XSLT Stylesheets"
attributes "Implementation-Version": project.ext.distVersion
attributes "Main-Class": "org.docbook.Main"
attributes "Bundle-SymbolicName": "org.docbook"
attributes "Bundle-RequiredExecutionEnvironment": "J2SE-1.7"
attributes "Export-Package": "*: etc"
attributes "Import-Package": "net.sf.saxon.*;version=" + project.ext.saxonRelease + ":\
javax.xml.*:\
*;resolution:=optional"
attributes "DynamicImport-Package": "*"
// This is a bit of a hack; special case the three most likely
// commercial jar files for printing with CSS or FO.
instruction 'Class-Path', project.ext.runtimeClasspath \
+ " lib/XfoJavaCtl.jar" \
+ " lib/xep.jar" \
+ " lib/prince.jar"
attributes"Class-Path": project.ext.runtimeClasspath \
+ " lib/XfoJavaCtl.jar lib/xep.jar lib/prince.jar"
}
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx2g"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
2 changes: 1 addition & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx2g"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
2 changes: 1 addition & 1 deletion src/test/expected-html/JFK_Inaugural.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>John F. Kennedy Inaugural Address</title><meta charset="utf-8" /><meta name="generator" content="DocBook XSL 2.0 Stylesheets V2.3.1" /><link href="../resources/css/prism.css" rel="stylesheet" type="text/css" /><link href="../resources/css/db-prism.css" rel="stylesheet" type="text/css" /><link rel="stylesheet" type="text/css" href="../resources/css/default.css" /><link rel="stylesheet" type="text/css" href="../resources/css/publishers.css" /><script type="text/javascript" src="../resources/js/dbmodnizr.js"></script></head><body><article id="R.1" class="article"><header class="article-titlepage"><h2>John F. Kennedy Inaugural Address</h2></header><div class="content"><div class="dialogue"><div class="title">John F. Kennedy Inaugural Address</div>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>John F. Kennedy Inaugural Address</title><meta charset="utf-8" /><meta name="generator" content="DocBook XSL 2.0 Stylesheets V2.3.8" /><link href="../resources/css/prism.css" rel="stylesheet" type="text/css" /><link href="../resources/css/db-prism.css" rel="stylesheet" type="text/css" /><link rel="stylesheet" type="text/css" href="../resources/css/default.css" /><link rel="stylesheet" type="text/css" href="../resources/css/publishers.css" /><script type="text/javascript" src="../resources/js/dbmodnizr.js"></script></head><body><article id="R.1" class="article"><header class="article-titlepage"><h2>John F. Kennedy Inaugural Address</h2></header><div class="content"><div class="dialogue"><div class="title">John F. Kennedy Inaugural Address</div>

<div class="linegroup">
<div class="speaker">
Expand Down
Loading