Skip to content

Instantly share code, notes, and snippets.

@eerohele
Last active June 5, 2018 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eerohele/777882a04d2fbeb362459c80aba8225a to your computer and use it in GitHub Desktop.
Save eerohele/777882a04d2fbeb362459c80aba8225a to your computer and use it in GitHub Desktop.
A Gradle Script Kotlin buildscript for building Saxon-HE (http://saxonica.com)
// README:
//
// Save this file and settings.gradle into a directory. Then:
//
// $ gradle
// $ gradle jar
// $ java -cp build/libs/saxon9he.jar net.sf.saxon.Transform <options>
import org.gradle.api.tasks.Copy
val saxonVersion: String = "9.8.0-7"
plugins {
java
}
apply<ApplicationPlugin>()
configure<ApplicationPluginConvention> {
mainClassName = "net.sf.saxon.Transform"
}
repositories {
mavenCentral()
}
dependencies {
compile("dom4j:dom4j:1.6.1")
compile("xml-resolver:xml-resolver:1.2")
compile("org.jdom:jdom:1.1.3")
compile("org.jdom:jdom2:2.0.6")
compile("org.apache.ws.commons.axiom:axiom-api:1.2.20")
compile("xom:xom:1.2.5")
compile("net.sf.saxon:Saxon-HE:$saxonVersion:sources")
compile("com.ibm.icu:icu4j:4.8.1.1")
compile("org.jetbrains:annotations:15.0")
}
java.sourceSets {
"main" {
resources {
srcDirs("src/main/java")
}
}
}
tasks {
"copy" (Copy::class) {
into(project.buildDir)
from(configurations.compile) {
include("Saxon-HE-$saxonVersion-sources.jar")
}
}
"extract" (Copy::class) {
dependsOn("copy")
into("src/main/java")
from(zipTree("build/Saxon-HE-$saxonVersion-sources.jar"))
}
"purge" {
doLast {
delete(project.buildDir)
delete("src")
}
}
}
defaultTasks("extract")
rootProject.name = "saxon9he"
rootProject.buildFileName = "build.gradle.kts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment