forked from microsoft/thrifty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
179 lines (151 loc) · 4.86 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
/*
* Thrifty
*
* Copyright (c) Microsoft Corporation
*
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
* WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE,
* FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
*
* See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
allprojects {
repositories {
mavenCentral()
}
group GROUP
version VERSION
project.ext {
kotlin_version = '1.3.0'
libraries = [
clikt: [
'com.github.ajalt:clikt:1.4.0'
],
guava: [
'com.google.guava:guava:23.0'
],
javaPoet: [
'com.squareup:javapoet:1.11.1'
],
kotlin: [
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version",
],
kotlinPoet: [
dependencies.create('com.squareup:kotlinpoet:1.0.0-RC1') {
exclude module: 'kotlin-stdlib'
exclude module: 'kotlin-reflect'
},
"org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
],
okio: [
'com.squareup.okio:okio:1.14.1'
],
testing: [
'junit:junit:4.12',
'com.nhaarman.mockitokotlin2:mockito-kotlin:2.0.0',
'com.google.truth:truth:0.28',
'org.hamcrest:hamcrest-all:1.3',
dependencies.create('io.kotlintest:kotlintest-assertions:3.1.8') {
exclude module: 'kotlin-stdlib'
exclude module: 'kotlin-reflect'
},
"org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
]
]
}
}
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.14'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.0"
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.9.17'
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.2'
}
}
subprojects { sp ->
apply plugin: 'java-library'
apply plugin: 'idea'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
checkstyle {
configFile = rootProject.file("config/checkstyle/checkstyle.xml")
configProperties = ["checkstyle.cache.file": file('build/checkstyle.cache')]
showViolations = true
sourceSets = [sourceSets.main]
}
tasks.withType(Checkstyle) {
exclude '**/antlr/**'
}
tasks.withType(JavaCompile) {
options.fork = true
options.incremental = true
}
test {
testLogging {
events "failed"
exceptionFormat "full"
showStackTraces true
showExceptions true
showCauses true
}
}
}
apply plugin: 'jacoco'
task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include('**/build/jacoco/*.exec')
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled = true
xml.destination file("$buildDir/reports/jacoco/report.xml")
html.enabled = true
csv.enabled = false
}
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it,
exclude: [
// leave out auto-generated code in thrifty-schema
'**/AutoValue_*',
'**/antlr/*',
// ditto for Apache-compiler-generated test classes
'com/microsoft/thrifty/test/gen/*',
])
})
}
}
codeCoverageReport.dependsOn {
subprojects*.test
}
afterEvaluate {
subprojects {
apply from: file("${rootDir}/gradle/gradle-mvn-push.gradle")
configurations.all { Configuration c ->
if (c.name == "errorprone") {
resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.3.2'
}
}
}
}
wrapper{
gradleVersion = "4.7"
distributionType = Wrapper.DistributionType.ALL
}