-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathbuild.gradle
157 lines (134 loc) · 5.91 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
apply plugin: 'scala' // it extends Java plugin, so you don't need to apply that one separately
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
group = 'com.taskadapter'
version = '0.14'
description = """Trello Java Wrapper"""
// java sources are added to Scala compile phase and removed from Java compile.
// this solution is fix java->scala dependency issue
// see https://discuss.gradle.org/t/how-to-compile-a-java-class-that-depends-on-a-scala-class-in-gradle/6747
sourceSets.test.scala.srcDir "src/test/java"
sourceSets.test.java.srcDirs = []
sourceCompatibility = 11
targetCompatibility = 11
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
configurations.all {
}
repositories {
mavenCentral()
}
ext {
scalaBinaryVersion = '2.12'
scalaFullVersion = '2.12.2'
httpClientVersion = '4.5.7'
okhttpVersion = '3.12.1'
springWebVersion = '3.2.2.RELEASE'
jacksonVersion = '2.9.8'
slf4jVersion = '1.7.25'
}
dependencies {
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version:jacksonVersion
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:jacksonVersion
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version:jacksonVersion
compile group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
compileOnly group: 'org.springframework', name: 'spring-web', version: springWebVersion
compileOnly group: 'org.apache.httpcomponents', name: 'httpclient', version: httpClientVersion
compileOnly group: 'com.ning', name: 'async-http-client', version:'1.7.19'
compileOnly group: 'org.asynchttpclient', name: 'async-http-client', version:'2.5.2'
compileOnly group: 'com.squareup.okhttp3', name: 'okhttp', version: okhttpVersion
testImplementation group: 'org.springframework', name: 'spring-web', version: springWebVersion
testImplementation group: 'org.apache.httpcomponents', name: 'httpclient', version: httpClientVersion
testImplementation group: 'com.ning', name: 'async-http-client', version:'1.7.19'
testImplementation group: 'org.asynchttpclient', name: 'async-http-client', version:'2.5.2'
testImplementation group: 'com.squareup.okhttp3', name: 'okhttp', version: okhttpVersion
implementation (
"org.apache.httpcomponents:httpmime:${httpClientVersion}"
)
testCompile(
[group: 'org.easytesting', name: 'fest-assert', version: '1.4'],
[group: 'junit', name: 'junit', version: '4.12'],
[group: 'org.mockito', name: 'mockito-all', version: '1.9.5'],
"org.scala-lang:scala-library:${scalaFullVersion}",
"org.scalatest:scalatest_${scalaBinaryVersion}:3.0.0"
)
}
task packageSources(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task packageJavadoc(type: Jar, dependsOn: 'javadoc') {
from javadoc.destinationDir
classifier = 'javadoc'
}
// turn off strict Javadoc checks in Java8 that break the build.
// http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
// minor Javadoc issues are not important enough to justify breaking the build.
// adding Captain-Obvious-style garbage javadoc for params just to satisfy this build check is not useful.
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
// A PGP key is required to sign the artifacts before uploading to OSS Sonatype Maven repository.
// Put the PGP key info in your <home>/.gradle/gradle.properties file:
// signing.keyId=...
// signing.password=...
// signing.secretKeyRingFile=c:/Users/ask/.gnupg/secring.gpg
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
// password can be set in gradle.properties or environment variable (check "build environment" on Jenkins)
def ossUserVar = hasProperty("ossUser") ? ossUser : ""
def ossPasswordVar = hasProperty("ossPassword") ? ossPassword : ""
uploadArchives {
repositories {
mavenDeployer {
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
authentication(userName: ossUserVar, password: ossPasswordVar)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') {
authentication(userName: ossUserVar, password: ossPasswordVar)
}
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
pom.project {
name 'Trello Java API'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
url 'https://github.com/taskadapter/trello-java-wrapper'
description 'Java API for Trello'
developers {
developer {
name 'Alexey Skorokhodov'
email '[email protected]'
}
}
scm {
connection 'scm:git:git://github.com/taskadapter/trello-java-wrapper.git'
tag 'HEAD'
// A publicly browsable repository. For example, via ViewCVS
url 'http://github.com/taskadapter/trello-java-wrapper/tree/master/'
}
issueManagement {
system 'github'
url 'http://github.com/taskadapter/trello-java-wrapper/issues'
}
}
}
}
}
// this section is used by "install" command to publish to local Maven repo
artifacts {
archives packageSources, packageJavadoc
}