thrifty/build.gradle

179 строки
4.9 KiB
Groovy

/*
* 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
}