1 Star 0 Fork 8

pakki/caffeine-nien

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 4.09 KB
一键复制 编辑 原始数据 按行查看 历史
coder001 提交于 2022-12-14 19:17 . first commit
apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'org.owasp.dependencycheck'
buildscript {
apply from: "${rootDir}/gradle/dependencies.gradle"
repositories {
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath gradlePlugins.values()
classpath platforms.collect { platform(it) }
configurations.all { configuration ->
restrictions.each { module, version ->
constraints.add(configuration.name, module).version { require version }
}
}
}
//skip Test tasks
gradle.taskGraph.whenReady {
tasks.each { task ->
if (task.name.contains("test"))
{
task.enabled = false
}
}
}
}
allprojects {
apply plugin: 'com.github.ethankhall.semantic-versioning'
group = 'com.github.ben-manes.caffeine'
version.with {
major = 3 // incompatible API changes
minor = 1 // backwards-compatible additions
patch = 2 // backwards-compatible bug fixes
releaseBuild = rootProject.hasProperty('release')
}
dependencies {
def deprecated = ['apiElements', 'archives', 'compileClasspath', 'default',
'runtimeClasspath', 'runtimeElements', 'testCompileClasspath', 'testRuntimeClasspath']
configurations.all { configuration ->
if (name !in deprecated) {
restrictions.each { module, version ->
constraints.add(configuration.name, module).version { require version }
}
}
}
}
}
subprojects {
apply plugin: 'biz.aQute.bnd.builder'
apply plugin: 'java-library'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply from: "${rootDir}/gradle/dependencies.gradle"
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module('org.hamcrest:hamcrest-core') using module(testLibraries.hamcrest)
}
}
dependencies {
implementation platforms.collect { platform(it) }
annotationProcessor platforms.collect { platform(it) }
testImplementation libraries.guava
testImplementation testLibraries.junit
testImplementation testLibraries.truth
testImplementation testLibraries.testng
testImplementation testLibraries.mockito
testImplementation testLibraries.hamcrest
testImplementation testLibraries.awaitility
testImplementation testLibraries.osgiCompile
testRuntimeOnly testLibraries.osgiRuntime
testRuntimeOnly testLibraries.junitEngines
}
tasks.register('bundle', aQute.bnd.gradle.Bundle) {
from sourceSets.main.output
sourceSet = sourceSets.main
}
if (project != project(':caffeine')) {
javadoc.options.linksOffline(
"https://static.javadoc.io/${group}/caffeine/${version}/",
'../caffeine/build/docs/javadoc/')
javadoc.dependsOn(project(':caffeine').javadoc)
}
//skip Test tasks
gradle.taskGraph.whenReady {
tasks.each { task ->
if (task.name.endsWith("test"))
{
task.enabled = false
}
}
}
}
nexusPublishing {
repositories {
sonatype {
username = project.properties['nexusUsername'] ?: System.env.NEXUS_USERNAME
password = project.properties['nexusPassword'] ?: System.env.NEXUS_PASSWORD
}
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA', 'JRE'].any { version.toUpperCase().contains(it) }
def unstableKeyword = ['PREVIEW'].any { version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return (!stableKeyword || unstableKeyword) && !(version ==~ regex)
}
tasks.named('dependencyUpdates').configure {
resolutionStrategy {
componentSelection {
all {
def unstable = ['javax.json.bind', 'org.jetbrains.kotlin']
if (isNonStable(it.candidate.version) && it.candidate.group in unstable) {
reject('release candidate')
}
}
force libraries.coherence
}
}
}
dependencyCheck {
formats = ['html', 'sarif']
}
dependencyCheckAggregate.dependsOn(subprojects*.tasks.jar)
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.errorprone.nullaway {
severity = CheckSeverity.OFF
}
}
tasks.withType(Javadoc) {
options.encoding = "UTF-8"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pakki/caffeine-nien.git
git@gitee.com:pakki/caffeine-nien.git
pakki
caffeine-nien
caffeine-nien
master

搜索帮助