/* * 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.3.72' 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.11.1' ], kotlin: [ "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version", ], kotlinPoet: [ dependencies.create('com.squareup:kotlinpoet:1.5.0') { 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.2.0', 'com.google.truth:truth:1.0.1', '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' }, "org.jetbrains.kotlin:kotlin-reflect:$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.3.72" classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.10.1' classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.11.1' } } subprojects { sp -> apply plugin: 'java-library' apply plugin: 'idea' apply plugin: 'checkstyle' apply plugin: 'jacoco' 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.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.4" distributionType = Wrapper.DistributionType.ALL }