forked from ical4j/ical4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
222 lines (182 loc) · 6.67 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
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
import aQute.bnd.gradle.Bundle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.hidetake:gradle-ssh-plugin:2.10.1', 'com.palantir.gradle.revapi:gradle-revapi:1.5.0'
}
}
plugins {
id 'java'
id 'java-library'
id 'groovy'
id 'maven-publish'
id 'jacoco'
id 'signing'
id "pl.allegro.tech.build.axion-release" version "1.13.6"
id "nebula.provided-base" version "7.0.0"
id "nebula.optional-base" version "7.0.0"
id "com.palantir.revapi" version "1.7.0"
id "net.ltgt.errorprone" version "2.0.2" apply false
id "biz.aQute.bnd.builder" version "$bndVersion"
}
apply from: 'gradle/dist.gradle'
sourceCompatibility = 1.8
targetCompatibility = 1.8
//modularity.mixedJavaRelease 8
repositories {
mavenCentral()
}
dependencies {
// errorprone "com.google.errorprone:error_prone_core:2.3.3"
// errorproneJavac "com.google.errorprone:javac:9+181-r4173-1"
api "org.slf4j:slf4j-api:$slf4jVersion",
"commons-codec:commons-codec:$commonsCodecVersion",
"org.apache.commons:commons-lang3:$commonsLangVersion",
"org.apache.commons:commons-collections4:$commonsCollectionsVersion",
"commons-validator:commons-validator:$commonsValidatorVersion"
// optional timezone caching..
implementation 'javax.cache:cache-api:1.1.1', optional
// optional support for non-Gregorian chronologies..
implementation "org.threeten:threeten-extra:$threetenExtraVersion", optional
// optional parser for filter expressions..
implementation "org.jparsec:jparsec:$jparsecVersion", optional
// optional groovy DSL for calendar builder..
implementation "org.codehaus.groovy:groovy:$groovyVersion", optional
implementation "org.codehaus.groovy:groovy-dateutil:$groovyVersion", optional
// optional JSON schema validation for structured-data..
implementation "com.github.erosb:everit-json-schema:$everitJsonSchemaVersion", optional
compileOnly "biz.aQute.bnd:biz.aQute.bndlib:$bndVersion"
testCompileOnly "org.codehaus.groovy:groovy:$groovyVersion",
"org.slf4j:slf4j-log4j12:$slf4jVersion",
"org.apache.logging.log4j:log4j:$log4jVersion",
"org.ccil.cowan.tagsoup:tagsoup:$tagsoupVersion",
"org.codehaus.groovy:groovy-xml:$groovyVersion"
// A CachingProvider is required for TimeZoneCacheTest.groovy
testImplementation "org.cache2k:cache2k-jcache:$jcacheVersion"
// junit
testImplementation "org.junit.vintage:junit-vintage-engine:$junitVintageVersion"
// groovy-test
testImplementation "org.codehaus.groovy:groovy-test:$groovyVersion"
// spock
testImplementation platform("org.spockframework:spock-bom:2.1-groovy-3.0"),
"org.spockframework:spock-core"
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport // Ensure Jacoco is run after tests have completed
jvmArgs = [ "-Duser.timezone=UTC" ] // Some tests require default timezone to be UTC
}
jacocoTestReport {
reports {
xml.required = true
html.required = jacoco_htmlReport == 'true'
}
}
javadoc {
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
options {
links 'https://docs.oracle.com/en/java/javase/11/docs/api/'
}
}
task bundle(type: Bundle) {
from sourceSets.main.output
bndfile = 'bnd.bnd'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier.set('sources')
}
jar.enabled = false
build.dependsOn bundle
artifacts {
archives bundle
archives javadocJar
archives sourcesJar
}
configurations {
[apiElements, runtimeElements].each {
it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) }
it.outgoing.artifact(bundle)
}
}
scmVersion {
tag {
prefix = 'ical4j-'
branchPrefix = ['ical4j-1.x-maintenance' : 'jdk14_ical4j']
branchPrefix = ['ical4j-2.x-maintenance' : 'jdk7_ical4j']
}
versionCreator 'versionWithBranch'
branchVersionCreator = ['master': 'simple']
branchVersionCreator = ['ical4j-1.x-maintenance': 'simple']
branchVersionCreator = ['ical4j-2.x-maintenance': 'simple']
nextVersion {
suffix = 'pre'
separator = '-'
}
}
group = 'org.mnode.ical4j'
description = '''
A Java library for reading and writing iCalendar (*.ics) files
'''
version = scmVersion.version
revapi {
oldVersion = revApiOldVersion
}
ext {
isReleaseVersion = !version.endsWith("SNAPSHOT")
}
publishing {
publications {
ical4j(MavenPublication) {
from components.java
artifact javadocJar
artifact sourcesJar
pom.withXml {
asNode().appendNode('name', project.name)
asNode().appendNode('description', project.description)
asNode().appendNode('url', 'http://ical4j.github.io')
def scmNode = asNode().appendNode('scm')
scmNode.appendNode('url', 'https://github.com/ical4j/ical4j')
scmNode.appendNode('connection', 'scm:[email protected]:ical4j/ical4j.git')
scmNode.appendNode('developerConnection', 'scm:[email protected]:ical4j/ical4j.git')
def licenseNode = asNode().appendNode('licenses').appendNode('license')
licenseNode.appendNode('name', 'BSD-3-Clause')
licenseNode.appendNode('url', 'https://raw.githubusercontent.com/ical4j/ical4j/master/LICENSE.txt')
licenseNode.appendNode('distribution', 'repo')
def developerNode = asNode().appendNode('developers').appendNode('developer')
developerNode.appendNode('id', 'fortuna')
developerNode.appendNode('name', 'Ben Fortuna')
}
}
}
repositories {
maven {
name = "OSSRH"
url = !isReleaseVersion ? "https://oss.sonatype.org/content/repositories/snapshots/" : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
// maven {
// name = "GitHubPackages"
// url = uri("https://maven.pkg.github.com/ical4j/ical4j")
// credentials {
// username = System.getenv("GPR_USERNAME")
// password = System.getenv("GPR_TOKEN")
// }
// }
}
}
signing {
required { isReleaseVersion }
sign publishing.publications.ical4j
}