forked from sergluka/ib-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·203 lines (170 loc) · 4.77 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
plugins {
id 'java-library'
id 'checkstyle'
id 'groovy'
id 'maven-publish'
id 'org.ajoberstar.grgit' version '1.7.2'
id 'com.github.johnrengelman.shadow' version '5.2.0'
id 'org.unbroken-dome.test-sets' version '3.0.1'
id 'com.jfrog.bintray' version '1.8.5'
id 'com.jfrog.artifactory' version '4.15.2'
}
group 'lv.sergluka.ib-client'
version '3.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext {
codeUrl = 'https://github.com/SergeyLukashevich/ib-client'
isSnapshot = version.endsWith('SNAPSHOT')
reactorVersion = '3.3.5.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
implementation files('libs/TwsApi.jar')
api "io.projectreactor:reactor-core:${reactorVersion}"
implementation 'org.slf4j:slf4j-api:1.7.29'
implementation 'com.google.guava:guava:28.1-jre'
testImplementation "io.projectreactor:reactor-test:${reactorVersion}"
testImplementation 'org.spockframework:spock-core:1.3-groovy-2.5'
testImplementation 'org.objenesis:objenesis:2.6'
testImplementation 'net.bytebuddy:byte-buddy:1.9.0'
testImplementation 'ch.qos.logback:logback-classic:1.2.+'
testImplementation 'org.assertj:assertj-core:3.14.0'
checkstyle('com.github.sevntu-checkstyle:sevntu-checks:1.34.0')
}
checkstyle {
toolVersion = '8.27'
configFile = new File('checkstyle.xml')
ignoreFailures = false
maxWarnings = 0
}
testSets {
integrationTest {
dirName = 'test-integration'
}
}
shadowJar {
archiveBaseName.set('ib-client')
archiveClassifier.set(null)
}
javadoc {
excludes = ['lv/sergluka/ib/impl/**']
options.stylesheetFile = new File(projectDir, 'docs/stylesheet.css');
options.overview = new File(projectDir, 'docs/overview.html');
options.tags = ['apiNote:a:API Note:',
'implSpec:a:Implementation Requirements:',
'implNote:a:Implementation Note:']
options.addBooleanOption('-allow-script-in-comments', true)
}
task packageJavadoc(type: Jar, dependsOn: 'javadoc') {
from javadoc.destinationDir
archiveClassifier.set('javadoc')
}
test {
testLogging {
events 'passed', 'skipped', 'failed'
}
}
task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allJava
}
javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives packageJavadoc
}
def pomConfig = {
licenses {
license {
name 'MIT License'
url 'http://www.opensource.org/licenses/mit-license.php'
distribution "repo"
}
}
developers {
developer {
id "sergluka"
name "Sergey Lukashevich"
email "[email protected]"
}
}
scm {
url codeUrl
}
}
publishing {
publications {
shadow(MavenPublication) { publication ->
groupId = 'lv.sergluka.ib-client'
artifactId = 'ib-client'
project.shadow.component(publication)
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom.withXml {
def root = asNode()
root.appendNode('description', 'Wrapper around Interactive Brokers TWS API')
root.appendNode('name', 'Wrapper around Interactive Brokers TWS API')
root.appendNode('url', codeUrl)
root.children().last() + pomConfig
}
}
}
}
bintray {
user = project.findProperty("bintray.user")
key = project.findProperty("bintray.key")
publications = ['shadow']
pkg {
repo = 'maven'
name = 'ib-client'
version {
name = project.version
desc = project.version
released = new Date()
}
}
}
artifactory {
contextUrl = 'https://oss.jfrog.org'
publish {
repository {
repoKey = 'oss-snapshot-local'
username = project.findProperty('bintray.user')
password = project.findProperty('bintray.key')
}
defaults {
publications 'shadow'
publishArtifacts = true
publishPom = true
}
}
resolve {
repoKey = 'jcenter'
}
clientConfig.info.setBuildNumber('' + System.currentTimeMillis())
}
bintrayPublish { task ->
doFirst {
if (isSnapshot) {
throw new GradleException('Cannot publish SNAPSHOT versions to Bintray')
}
}
}
artifactoryPublish { task ->
doFirst {
if (!isSnapshot) {
throw new GradleException('Cannot publish non-SNAPSHOT versions to OJO')
}
}
}