thrifty/build.gradle

166 строки
4.7 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()
jcenter() // for dokka, remove this if/when https://github.com/Kotlin/dokka/issues/791 lands
}
group GROUP
version VERSION_NAME
project.ext {
kotlin_version = '1.4.0'
libraries = [
antlr: [
'org.antlr:antlr4:4.8-1'
],
clikt: [
'com.github.ajalt:clikt:2.6.0'
],
guava: [
'com.google.guava:guava:29.0-jre'
],
javaPoet: [
'com.squareup:javapoet:1.13.0'
],
kotlin: [
dependencies.platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version"),
"org.jetbrains.kotlin:kotlin-reflect",
],
kotlinPoet: [
dependencies.create('com.squareup:kotlinpoet:1.6.0') {
exclude module: 'kotlin-stdlib'
exclude module: 'kotlin-reflect'
},
"org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
],
okio: [
'com.squareup.okio:okio:2.8.0'
],
testing: [
'junit:junit:4.12',
'org.hamcrest:hamcrest-all:1.3',
dependencies.create('io.kotest:kotest-assertions-jvm:4.0.5') {
exclude module: 'kotlin-stdlib'
exclude module: 'kotlin-reflect'
},
dependencies.create('io.kotest:kotest-assertions-core:4.0.5') {
exclude module: 'kotlin-stdlib'
exclude module: 'kotlin-reflect'
},
dependencies.platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version"),
]
]
}
}
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
jcenter() // for dokka only - ugh
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0"
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.10.1'
classpath 'com.github.jengelman.gradle.plugins:shadow:6.0.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.11.1'
}
}
subprojects { sp ->
apply plugin: 'java-library'
apply plugin: 'idea'
apply plugin: 'jacoco'
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.setFrom(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
}
wrapper {
gradleVersion = "6.6"
distributionType = Wrapper.DistributionType.ALL
}