-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
156 lines (133 loc) · 3.74 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'net.sf.saxon', name: 'Saxon-HE', version: saxonVersion
}
}
plugins {
id "java"
id "osgi"
id "maven"
// id "maven-publish"
// id "signing"
}
repositories {
mavenLocal()
mavenCentral()
maven { url "http://maven.restlet.org" }
}
configurations {
copydep {
extendsFrom runtime
}
copydep.exclude module: 'xmlcalabash'
copydep.exclude module: 'nwalsh-annotations'
// opydep.exclude module: 'slf4j-api'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'saxon' && details.requested.version == '8.7') {
details.useTarget "net.sf.saxon:Saxon-HE:" + saxonVersion
}
}
}
dependencies {
compile fileTree(dir: 'lib').include("*.jar")
compile (
[group: 'com.nwalsh', name: 'nwalsh-annotations', version: '1.0.0'],
[group: 'com.xmlcalabash', name: 'xmlcalabash', version: '1.1.1-95'],
// https://mvnrepository.com/artifact/com.github.wumpz/diffutils
[group: 'com.github.wumpz', name: 'diffutils', version: '2.2']
)
}
project.ext.saxonRelease = saxonVersion.substring(0,5)
project.ext.saxonBranch = saxonVersion.substring(0,3).replaceAll("\\.", "")
project.ext.releaseVersion = '0.0.0.3'
project.ext.distVersion = '0.0.0.3'
version = '0.0.0.3'
task copyLib(type: Copy) {
FileCollection lib = configurations.copydep
String path = ""
lib.each {
File file -> path += " lib/" + file.name
}
project.ext.runtimeClasspath = path.trim()
from lib
into { "build/dist/lib" }
}
jar {
manifest {
instruction 'Built-By', builtBy
instruction 'Implementation-Vendor', 'Liam Quin'
instruction 'Implementation-Title', 'XML Calabash TextDiff Step'
instruction 'Implementation-Version', project.ext.distVersion
instruction 'Bundle-SymbolicName', 'com.delightfulcomputing.textdiff'
instruction 'Bundle-RequiredExecutionEnvironment', 'J2SE-1.7'
instruction 'Export-Package', '*, etc'
instruction 'Import-Package', 'net.sf.saxon.*;version=' + project.ext.saxonRelease + ',\
javax.crypto.*,\
javax.xml.*,\
org.apache.commons.httpclient.*,\
org.xml.sax.*,\
*;resolution:=optional'
instruction 'DynamicImport-Package', '*'
instruction 'Class-Path', project.ext.runtimeClasspath + " lib"
}
}
task copyNotices(type: Copy) {
from 'resources/notices'
into 'build/dist/docs/notices'
}
jar.dependsOn copyNotices
task copyStuff(type: Copy) {
from 'README.adoc'
from 'LICENSE.md'
into 'build/dist'
}
task copyToDist(dependsOn: [copyLib,copyStuff]) {
// nop
}
jar.dependsOn copyToDist
task javadocJar(type: Jar, dependsOn: javadoc) {
from tasks.javadoc.destinationDir
classifier = 'javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task copyJar(dependsOn: jar, type: Copy) {
from "build/libs/xmlcalabash1-textdiff-" + project.ext.distVersion + ".jar"
into "build/dist"
}
task copyJavaDoc(dependsOn: javadoc, type: Copy) {
from "build/docs"
into "build/dist/docs"
}
task testStep(type: JavaExec) {
// classpath = configurations.copydep + configurations.runtime + sourceSets.main.output
// main = 'com.xmlcalabash.drivers.Main'
// maxHeapSize = "1024m"
// args('-D', '-a', 'src/test/resources/test-pipeline.xpl')
}
task makeDist(dependsOn: [ build, copyJar, copyLib ]) {
doLast {
println "Created distribution in build/dist"
}
}
task zipDist(dependsOn: makeDist, type: Zip) {
from('build/dist')
into 'xmlcalabash1-textdiff-' + project.ext.distVersion
archiveName 'xmlcalabash1-textdiff-' + project.ext.distVersion + ".zip"
}
task dist(dependsOn: [zipDist]) {
doLast {
// nop
}
}
artifacts {
archives javadocJar
archives sourcesJar
}