-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
230 lines (202 loc) · 6.09 KB
/
build.gradle
File metadata and controls
230 lines (202 loc) · 6.09 KB
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
plugins {
id 'application'
id 'maven-publish'
id 'signing'
id 'org.beryx.runtime' version '1.1.7'
}
mainClassName = "org.daisy.dotify.cli.DotifyCLI"
startScripts.applicationName = 'dotify'
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
def repoRevision = System.getenv("REPO_REVISION")!=null?System.getenv("REPO_REVISION"):repositoryRevision
group = "org.daisy.dotify"
ext {
versions = [
'osgi' : '5.0.0',
'junit' : '4.12',
'felix' : '5.6.10',
'paxExam' : '4.11.0',
'paxUrl' : '2.5.4',
]
}
sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'src'
}
}
test {
java {
srcDir 'test'
srcDir 'integrationtest'
}
resources {
srcDir 'test'
srcDir 'integrationtest'
}
}
}
// required for gradle build outside of Eclipse
task copyTestResources(type: Copy) {
from "${projectDir}/integrationtest"
into "${buildDir}/classes/java/test"
}
processTestResources.dependsOn copyTestResources
//
jar.doFirst {
manifest {
attributes ('Built-By': System.getProperty("user.name"),
'Main-Class': mainClassName,
'Built-On': new Date().format('yyyy-MM-dd'),
'Repository-Revision': "$repoRevision",
'Implementation-Title': "$releaseName",
'Implementation-Version': version,
'Implementation-URL': "$repositoryURL",
'Class-Path': configurations.runtimeClasspath.collect { it.getName() }.join(' ') //'${core.classpath.attribute}'
)
}
from sourceSets.main.allJava
baseName = 'dotify-cli'
}
repositories {
mavenCentral()
//mavenLocal()
//maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://oss.sonatype.org/content/groups/staging" }
}
dependencies {
compileOnly 'org.osgi:org.osgi.service.component.annotations:1.3.0'
compile 'org.daisy.streamline:streamline-cli:1.0.0'
compile ('org.daisy.braille:braille-utils.pef-tools:6.0.0') {
exclude module: 'Saxon-HE'
}
compile 'org.daisy.dotify:dotify.api:5.0.0'
compile 'org.daisy.dotify:dotify.common:4.4.0'
compile ('org.daisy.streamline:streamline-engine:1.3.0') {
exclude module: 'streamline-api'
}
compile 'org.daisy.streamline:streamline-api:1.3.0'
runtimeOnly 'org.daisy.braille:braille-utils.impl:7.0.0'
runtimeOnly ('org.daisy.dotify:dotify.formatter.impl:5.0.2') {
exclude module: 'Saxon-HE'
}
runtimeOnly 'org.daisy.dotify:dotify.hyphenator.impl:5.0.0'
runtimeOnly 'org.daisy.dotify:dotify.text.impl:5.0.0'
runtimeOnly 'org.daisy.dotify:dotify.translator.impl:5.0.0'
runtimeOnly ('org.daisy.dotify:dotify.task.impl:4.7.0') {
exclude module: 'Saxon-HE'
exclude module: 'streamline-api'
}
runtimeOnly group: "com.googlecode.texhyphj", name: "texhyphj", version: "1.2"
//runtimeOnly 'xerces:xercesImpl:2.11.0'
runtimeOnly 'org.slf4j:slf4j-jdk14:1.7.2'
testImplementation group: 'junit', name: 'junit', version: "$versions.junit"
testImplementation "javax.inject:javax.inject:1"
testImplementation "org.ops4j.pax.exam:pax-exam-junit4:$versions.paxExam"
testRuntimeOnly "org.ops4j.pax.exam:pax-exam-container-native:$versions.paxExam"
testRuntimeOnly "org.ops4j.pax.exam:pax-exam-link-mvn:$versions.paxExam"
testRuntimeOnly "org.ops4j.pax.url:pax-url-aether:$versions.paxUrl"
testRuntimeOnly "org.ops4j.pax.url:pax-url-reference:$versions.paxUrl"
testRuntimeOnly "org.ops4j.pax.url:pax-url-wrap:$versions.paxUrl"
testRuntimeOnly "org.apache.felix:org.apache.felix.framework:$versions.felix"
testCompile("org.osgi:org.osgi.core:$versions.osgi")
testCompile("org.osgi:org.osgi.compendium:$versions.osgi")
}
applicationDistribution.from(file('docs')) {
into 'docs'
}
applicationDistribution.from(file('licenses')) {
into 'licenses'
}
def versionFile = file("$buildDir/version")
task writeVersionFile() {
doLast() {
versionFile.getParentFile().mkdirs()
versionFile.write(version)
}
outputs.file versionFile
outputs.upToDateWhen{ file('gradle.properties').lastModified()<file(versionFile).lastModified() }
}
applicationDistribution.from(versionFile)
jar.dependsOn writeVersionFile
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
signing {
required { isReleaseVersion }
sign publishing.publications
}
publishing {
//Only upload if a git hash is supplied. On Travis only upload snapshots.
//enabled = repoRevision.size()==40 && System.getenv("TRAVIS_BUILD_ID")!=null
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
artifact distZip
artifact distTar
/*
if (isReleaseVersion) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}*/
pom {
name = 'dotify-cli'
packaging = 'jar'
description = 'Dotify CLI'
url = "$repositoryURL"
scm {
connection = "$repositorySCM"
developerConnection = "$repositorySCM"
url = "$repositoryURL"
}
licenses {
license {
name = 'LGPL'
url = 'http://www.gnu.org/licenses/lgpl.html'
}
}
developers {
developer {
id = 'joel'
name = 'Joel Håkansson'
}
}
}
}
}
repositories {
maven {
def stagingRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : stagingRepoUrl
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}
import org.gradle.internal.os.OperatingSystem
def os = OperatingSystem.current().getFamilyName()
runtime {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
modules = ['java.base', 'java.desktop', 'java.logging', 'java.prefs', 'java.xml']
imageDir = file("$buildDir/image/$name-${version}")
imageZip = file("$buildDir/distributions/$name-${version}-${os}.zip")
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}