-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from ndw/master
DocBook XSLT Stylesheets 2.0.13 released
- Loading branch information
Showing
9 changed files
with
379 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,14 @@ | |
// Gradle to accept resources directly from xslt/ without losing the | ||
// top-level xslt/ part of the path names. So I punted. | ||
|
||
import groovy.swing.SwingBuilder | ||
import java.awt.Point | ||
|
||
buildscript { | ||
repositories { | ||
// maven { url uri('/tmp/repo') } | ||
mavenLocal() | ||
mavenCentral() | ||
maven { | ||
url 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath | ||
} | ||
maven { url "http://maven.restlet.org" } | ||
maven { url "http://developer.marklogic.com/maven2" } | ||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } | ||
|
@@ -24,6 +25,7 @@ buildscript { | |
plugins { | ||
id "java" | ||
id "osgi" | ||
id "groovy" | ||
id "maven" | ||
id "maven-publish" | ||
id "signing" | ||
|
@@ -45,6 +47,10 @@ configurations.all { | |
} | ||
} | ||
|
||
configurations { | ||
pluginApi | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'delta').include("*.jar") | ||
compile ( | ||
|
@@ -54,8 +60,10 @@ dependencies { | |
[group: 'com.xmlcalabash', name: 'xmlcalabash1-print', version: '1.1.4'], | ||
[group: 'com.thaiopensource', name: 'jing', version: '20091111', transitive: false], | ||
[group: 'org.docbook', name: 'docbook-xsl-java-saxon', version: '1.2.1-95'], | ||
[group: 'commons-cli', name: 'commons-cli', version: '1.3.1'] | ||
// 1.2 because that's what gradleApi requires :-( | ||
[group: 'commons-cli', name: 'commons-cli', version: '1.2'], | ||
) | ||
pluginApi gradleApi() | ||
} | ||
|
||
project.ext.saxonRelease = saxonVersion.substring(0,5) | ||
|
@@ -68,6 +76,30 @@ def versionPropsFile = file("src/main/resources/etc/version.properties") | |
versionProps['version'] = releaseVersion | ||
versionProps.store(versionPropsFile.newWriter(),null) | ||
|
||
compileGroovy { | ||
classpath += configurations.pluginApi | ||
} | ||
|
||
compileJava { | ||
classpath += configurations.pluginApi | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier = 'javadoc' | ||
from javadoc.destinationDir | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
artifacts { | ||
archives jar | ||
archives sourcesJar | ||
archives javadocJar | ||
} | ||
|
||
task copyLib(type: Copy) { | ||
FileCollection runtime = configurations.runtime | ||
FileCollection localLib = fileTree(dir: 'delta').include("*.jar") | ||
|
@@ -245,7 +277,12 @@ jar { | |
javax.xml.*,\ | ||
*;resolution:=optional' | ||
instruction 'DynamicImport-Package', '*' | ||
instruction 'Class-Path', project.ext.runtimeClasspath + " lib" | ||
// 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" | ||
} | ||
} | ||
|
||
|
@@ -357,3 +394,116 @@ task clean.doFirst { | |
delete "test/actual" | ||
delete "test/result" | ||
} | ||
|
||
/* | ||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
repository(url: uri('/tmp/repo')) | ||
} | ||
} | ||
} | ||
*/ | ||
|
||
signing { | ||
required { gradle.taskGraph.hasTask("uploadArchives") } | ||
sign configurations.archives | ||
} | ||
|
||
// I refuse to put my PGP password in a file. | ||
// | ||
// Adapted from | ||
// https://www.timroes.de/2014/01/19/using-password-prompts-with-gradle-build-files/ | ||
// | ||
// N.B. This can't work in a CI environment so there's no way to | ||
// automatically publish the artifacts from, for example, Travis CI. | ||
// | ||
gradle.taskGraph.whenReady { taskGraph -> | ||
if(taskGraph.hasTask(':uploadArchives')) { | ||
|
||
def pass = '' | ||
if(System.console() == null) { | ||
new SwingBuilder().edt { | ||
dialog(modal: true, | ||
title: 'Enter password', | ||
alwaysOnTop: true, | ||
resizable: false, | ||
locationRelativeTo: null, | ||
locationByPlatform: true, | ||
// On my Linux multi-monitor setup, the dialog "appears" at | ||
// the top of the virtual desktop below my desktop. So move | ||
// the damned thing somewhere visible. Meh. | ||
location: new Point(100,100), | ||
pack: true, | ||
show: true | ||
) { | ||
vbox { // | ||
label(text: "Please enter key passphrase:") | ||
input = passwordField() | ||
button(defaultButton: true, text: 'OK', actionPerformed: { | ||
pass = input.password; | ||
dispose(); | ||
}) | ||
} | ||
} | ||
} | ||
} else { | ||
pass = System.console().readPassword("\nPlease enter key passphrase: ") | ||
pass = new String(pass) | ||
} | ||
|
||
if (pass.size() <= 0) { | ||
throw new InvalidUserDataException("You must enter a password to proceed.") | ||
} | ||
|
||
allprojects { ext."signing.password" = pass } | ||
|
||
} | ||
} | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> | ||
signing.signPom(deployment) | ||
} | ||
|
||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: sonatypeUsername, password: sonatypePassword) | ||
} | ||
|
||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: sonatypeUsername, password: sonatypePassword) | ||
} | ||
|
||
pom.project { | ||
name 'DocBook XSLT 2.0 Stylesheets' | ||
packaging 'jar' | ||
description 'DocBook XSLT 2.0 stylesheets' | ||
url 'https://github.com/docbook/xslt20-stylesheets' | ||
|
||
scm { | ||
url 'scm:[email protected]:docbook/xslt20-stylesheets.git' | ||
connection 'scm:[email protected]:docbook/xslt20-stylesheets.git' | ||
developerConnection 'scm:[email protected]:docbook/xslt20-stylesheets.git' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'Apache License version 2.0' | ||
url 'https://www.apache.org/licenses/LICENSE-2.0' | ||
distribution 'repo' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id 'ndw' | ||
name 'Norman Walsh' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.docbook | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.Plugin | ||
|
||
class DocBookPlugin implements Plugin<Project> { | ||
void apply(Project target) { | ||
target.task('orgDocBook', type: DocBookTask) | ||
} | ||
} |
Oops, something went wrong.