Skip to content

Commit

Permalink
Merge pull request #105 from ndw/master
Browse files Browse the repository at this point in the history
Use resources repository and misc fixes
  • Loading branch information
ndw authored Mar 10, 2018
2 parents 34856b6 + 94f6bd2 commit 74fa0d4
Show file tree
Hide file tree
Showing 138 changed files with 169 additions and 4,001 deletions.
54 changes: 49 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ plugins {
id "maven"
id "maven-publish"
id "signing"
id "de.undercouch.download" version "2.0.0"
}

defaultTasks 'compileXslt'

apply plugin: 'com.xmlcalabash.task'

import com.xmlcalabash.XMLCalabashTask
import de.undercouch.gradle.tasks.download.Download

repositories {
maven { url uri('/tmp/repo') }
Expand Down Expand Up @@ -191,7 +193,8 @@ task makeVersion(type: JavaExec) {
args('-it:main',
'-o:build/xslt/base/VERSION.xsl',
'-xsl:tools/version.xsl',
'version=' + version)
'version=' + version,
'resourcesVersion=' + resourcesVersion)
}

// ======================================================================
Expand Down Expand Up @@ -365,10 +368,8 @@ task copyReadme(type: Copy) {
into "build/stage/zip/"
}

task copyResources(type: Copy, dependsOn: [ "copyDocs", "copyVendors" ]) {
FileTree tree = fileTree(dir: 'resources', exclude: ['**/*_flymake.css'])
from tree
into "build/stage/zip/resources/"
task copyResources(dependsOn: [ "copyDocs", "copyVendors", "setupResources" ]) {
// nop
}

task copyVendors(type: Copy) {
Expand Down Expand Up @@ -417,6 +418,7 @@ task makeVersionProperties() {
}
doLast {
new File("build/stage/jar/etc/version.properties").text = """version=$version
resourcesVersion=$resourcesVersion
"""
}
}
Expand Down Expand Up @@ -514,12 +516,54 @@ task dist(dependsOn: [ "zip", "copyJar" ]) {
// nop
}

// ================================================================================
// Setup resources

// Explicitly not into build because it's tedious if 'clean' deletes
// the resources, especially if you're not connected to the internet!
task downloadResources(type: Download) {
String base = "https://github.com/docbook/xslt20-resources/releases/download/"
src base + resourcesVersion + "/docbook-xslt20-resources-" + resourcesVersion + ".zip"
dest new File("lib/resources-" + resourcesVersion + ".zip")
doFirst {
mkdir("lib")
}
}
downloadResources.onlyIf {
!file("lib/resources-" + resourcesVersion + ".zip").exists()
}

task setupResources(type: Copy, dependsOn: [ "downloadResources" ]) {
from zipTree(downloadResources.dest)
into { "build" }
doFirst {
mkdir("build/stage/zip")
}
doLast {
copy {
from "build/docbook-xslt20-resources-" + resourcesVersion
into "build/stage/zip/resources"
rename ("build/stage/zip/resources/docbook-xslt20-resources-" + resourcesVersion,
"build/stage/zip/resources")
}
}
}
setupResources.onlyIf {
!file("build/stage/zip/resources").exists()
}

// ================================================================================
// Cleanup

clean {
doFirst {
delete "build"
}
}

// ================================================================================
// Sign, publish, and upload

signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version=2.2.2
version=2.3.0
saxonVersion=9.8.0-8
xmlCalabashVersion=1.1.19-98
resourcesVersion=2.0.0

snapshot=
builtBy=Norman Walsh
Expand Down
5 changes: 3 additions & 2 deletions gradletest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ buildscript {
}

dependencies {
classpath group: 'org.docbook', name: 'docbook-xslt2', version: '2.2.0'
classpath group: 'org.docbook', name: 'docbook-xslt2', version: '2.3.0'
classpath group: 'org.docbook', name: 'docbook-schemas', version: '5.1-1'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash', version: '1.1.18-98'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.2'
classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.4'
classpath group: 'org.xmlresolver', name: 'xmlresolver', version: '0.13.1'
}
}
Expand All @@ -36,6 +36,7 @@ task testTask(type: XMLCalabashTask) {
}

task testDocBook(type: DocBookTask) {
// catalogFile = "/tmp/cat.xml"
debug = true
uriResolver = "org.xmlresolver.Resolver"
input("source", "input.xml")
Expand Down
23 changes: 0 additions & 23 deletions resources/css/db-noprism.css

This file was deleted.

27 changes: 0 additions & 27 deletions resources/css/db-prism.css

This file was deleted.

Loading

0 comments on commit 74fa0d4

Please sign in to comment.