forked from twitch4j/twitch4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
207 lines (179 loc) · 4.95 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
/*
* Gradle Configuration
*/
// Apply the java plugin to add support for Java
plugins {
id 'java'
id 'idea'
id 'eclipse'
id 'application'
id 'maven-publish'
id "net.ltgt.apt" version "0.17"
id "net.ltgt.apt-idea" version "0.17"
id 'com.jfrog.bintray' version '1.8.4'
id "net.ltgt.apt-eclipse" version "0.17"
id 'io.ratpack.ratpack-java' version '1.5.4'
}
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
// Artifact Info
group = "com.github.twitch4j"
description = "This is a api client for the Twitch API V5/IRC/PubSub. (And related services: Streamlabs, ...)"
version = "v0.11.1"
// Doesn't matter, only so that spring doesn't fail
mainClassName = 'me.philippheuer.twitch4j.TwitchClient'
/**
* Javadoc
*/
javadoc {
options {
overview = new File("${projectDir}/src/javadoc/overview.html")
title = "Twitch 4 Java (${project.version})"
windowTitle = "${project.name} (${project.version})"
stylesheetFile = new File("${projectDir}/src/javadoc/css/style.css")
encoding = "UTF-8"
}
}
// Dependencies
dependencies {
// Logging
compile "org.slf4j:slf4j-api:1.7.25"
//compile group: 'com.jcabi', name: 'jcabi-log', version: '0.17.2'
// Spring (RestTemplate)
compile "org.springframework:spring-web:5.0.7.RELEASE" // contains Tomcat
compile "org.springframework.social:spring-social-core:1.1.6.RELEASE"
// WebSocket Client for Twitch PubSub and Twitch IRC
// TODO: Change to Jetty WebSocket
compile "com.neovisionaries:nv-websocket-client:2.5"
// Apache Commons
// - Lang
compile "org.apache.commons:commons-lang3:3.7"
// - IO
compile "commons-io:commons-io:2.6"
// JSON / YAML
compile "com.fasterxml.jackson.core:jackson-databind:2.9.6"
// Bucket for rate-limiting
compile "org.isomorphism:token-bucket:1.7"
// Expiring Map
compile "net.jodah:expiringmap:0.5.8"
// TypeTools
compile "net.jodah:typetools:0.5.0"
// Args4J - CommandLineArgumentParser
compile "args4j:args4j:2.33"
// Nullable Annotation
compile "com.google.code.findbugs:jsr305:3.0.2"
// Project Lombok for annotating processor
compile "org.projectlombok:lombok:1.18.0"
annotationProcessor "org.projectlombok:lombok:1.18.0"
// Testing
testCompile "junit:junit:4.12"
testCompile "ch.qos.logback:logback-classic:1.2.3"
}
/**
* Define SourceSets
*/
sourceSets {
integration {
java.srcDir 'src/integration/java'
resources.srcDir 'src/integration/resources'
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
}
}
// Configuration
configurations {
// Integration compile task
integrationCompile.extendsFrom testCompile
integrationRuntime.extendsFrom testRuntime
}
configurations.all {
// Disable Gradle Caching
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
/**
* Test Task `test` - Run Unit Tests
*/
test {
useJUnit {
includeCategories 'me.philippheuer.util.test.UnitTestCategory'
excludeCategories 'me.philippheuer.util.test.IntegrationTestCategory'
}
}
/**
* Test Task `testIntegration` - Run Integration Tests
*/
task testIntegration(type: Test, description: 'Runs the integration tests.', group: 'Verification') {
useJUnit {
includeCategories 'me.philippheuer.util.test.IntegrationTestCategory'
excludeCategories 'me.philippheuer.util.test.UnitTestCategory'
}
}
/**
* Sources - build a jar with source files
*/
task sourcesJar(type: Jar, dependsOn: classes, description: 'Builds the sourcesJar.', group: 'build') {
from sourceSets.main.allSource
baseName = baseName.toLowerCase()
classifier = 'sources'
}
// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: javadoc, description: 'Builds the javadocJar.', group: 'build') {
classifier = 'javadoc'
baseName = baseName.toLowerCase()
from javadoc.destinationDir
}
/**
* Artifacts
*/
artifacts {
archives sourcesJar
archives javadocJar
}
/**
* Deployment
*/
publishing {
publications {
mainProject(MavenPublication) {
from project.components.java
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId project.name.toLowerCase()
version project.version
}
}
}
/**
* Bintray Upload
*/
bintray {
user = findProperty("bintrayUser").toString() ?: System.getenv("BINTRAY_USER")
key = findProperty("bintrayApiKey").toString() ?: System.getenv("BINTRAY_API_KEY")
publications = ['mainProject']
dryRun = false
pkg {
// jcenter repository namespace and name
userOrg = 'twitch4j'
repo = 'maven'
name = "Twitch4J"
desc = project.description
websiteUrl = "https://github.com/twitch4j/twitch4j"
issueTrackerUrl = "https://github.com/twitch4j/twitch4j/issues"
vcsUrl = "https://github.com/twitch4j/twitch4j.git"
licenses = ['MIT']
labels = ['twitch', 'twitch-api-v5', 'kraken', 'twitch-pubsub', 'twitch-irc', 'helix']
publicDownloadNumbers = true
version {
name = String.valueOf(project.version).replace("v", "")
vcsTag = project.version
released = new Date()
}
}
}
wrapper {
gradleVersion = "4.8.1" // newer version
distributionType = Wrapper.DistributionType.ALL
}