1 Star 0 Fork 0

Wang Jup/caffeine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 4.35 KB
一键复制 编辑 原始数据 按行查看 历史
import net.ltgt.gradle.errorprone.CheckSeverity
apply plugin: 'com.github.mjdetullio.gradle.coverity'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'jacoco'
buildscript {
apply from: "${rootDir}/gradle/dependencies.gradle"
repositories {
maven { url "https://repo.spring.io/plugins-release" }
gradlePluginPortal()
mavenCentral()
jcenter()
}
dependencies {
classpath gradlePlugins.values()
}
}
buildScan {
termsOfServiceAgree = 'yes'
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
}
task testReport(type: TestReport, group: 'Build') {
description = 'Generates an aggregate test report'
destinationDir = file("${buildDir}/reports/allTests")
}
allprojects {
apply plugin: 'com.github.ethankhall.semantic-versioning'
apply from: "${rootDir}/gradle/eclipse.gradle"
repositories {
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}
group = 'com.github.ben-manes.caffeine'
version.with {
major = 2 // incompatible API changes
minor = 8 // backwards-compatible additions
patch = 6 // backwards-compatible bug fixes
releaseBuild = rootProject.hasProperty('release')
}
}
subprojects {
apply plugin: 'biz.aQute.bnd.builder'
apply plugin: 'java-library'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply from: "${rootDir}/gradle/publish.gradle"
apply from: "${rootDir}/gradle/codeQuality.gradle"
apply from: "${rootDir}/gradle/dependencies.gradle"
apply from: "${rootDir}/gradle/objectLayout.gradle"
sourceCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = path[1..-1].replaceAll(':', '-').toLowerCase()
dependencies {
testImplementation libraries.guava
testImplementation testLibraries.mockito
testImplementation testLibraries.hamcrest
testImplementation testLibraries.awaitility
testImplementation testLibraries.osgiCompile
testRuntimeOnly testLibraries.osgiRuntime
}
task bundle(type: aQute.bnd.gradle.Bundle) {
from sourceSets.main.output
sourceSet = sourceSets.main
}
tasks.withType(JavaCompile) {
if (name.contains('Test') || name.contains('Jmh')) {
options.errorprone.nullaway {
severity = CheckSeverity.OFF
}
}
}
tasks.withType(Test) {
if (!it.name.startsWith('slow')) {
rootProject.testReport.reportOn it
}
it.dependsOn('jar')
// ensure tasks don't overwrite the default report directories used by the 'test' task
reports.html.destination = file("${buildDir}/reports/${name}")
reports.junitXml.destination = file("${buildDir}/reports/${name}/results")
binResultsDir = file("${buildDir}/reports/${name}/results/binary/${name}")
}
if (project != project(':caffeine')) {
javadoc.options.linksOffline(
"https://static.javadoc.io/${group}/caffeine/${version}/",
"${project(':caffeine').buildDir}/docs/javadoc/",
)
javadoc.dependsOn(project(':caffeine').javadoc)
}
}
// Only report code coverage for projects that are distributed
def publishedProjects = subprojects.findAll { it.path != ':simulator' }
task jacocoMerge(type: JacocoMerge) {
publishedProjects.each { subproject ->
executionData subproject.tasks.withType(Test)
}
doFirst {
executionData = files(executionData.findAll { it.exists() })
}
}
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
description = 'Generates an aggregate report from all subprojects'
dependsOn publishedProjects.test, jacocoMerge
additionalSourceDirs.from = files(publishedProjects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from = files(publishedProjects.sourceSets.main.allSource.srcDirs)
classDirectories.from = files(publishedProjects.sourceSets.main.output)
executionData jacocoMerge.destinationFile
reports {
html.enabled = true // human readable
xml.enabled = true // required by coveralls
}
}
coveralls {
sourceDirs = publishedProjects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}
tasks.coveralls {
group = 'Coverage reports'
description = 'Uploads the aggregated coverage report to Coveralls'
dependsOn jacocoRootReport
onlyIf { System.env.'CI' && !JavaVersion.current().isJava9Compatible() }
}
dependencyUpdates.resolutionStrategy {
force libraries.googleJavaFormat
force testLibraries.truth
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/anjup/caffeine.git
git@gitee.com:anjup/caffeine.git
anjup
caffeine
caffeine
master

搜索帮助