1 Star 0 Fork 0

cdy1996 / reactor-for-study

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 6.65 KB
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
cdy1996 提交于 2020-01-11 20:02 . 说明: 关闭asciidoctor的生成
/*
* Copyright (c) 2011-2017 Pivotal Software Inc, 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
buildscript {
//we define kotlin version for benefit of both core and test (see kotlin-gradle-plugin below)
ext.kotlinVersion = '1.3.31'
repositories {
maven { url "https://repo.spring.io/plugins-release" }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7' //still uses the old ways
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
}
}
plugins {
id "com.github.johnrengelman.shadow" version "4.0.2"
//id 'org.asciidoctor.convert' version '1.5.11'
id "me.champeau.gradle.japicmp" version "0.2.6"
id "de.undercouch.download" version "3.4.3"
id "org.unbroken-dome.test-sets" version "2.1.1" apply false // 2.x version does not work with Gradle 4.10
id 'com.gradle.build-scan' version '2.4.2'
id "com.jfrog.artifactory" version "4.9.8" apply false
}
apply plugin: "io.reactor.gradle.detect-ci"
//apply from: "gradle/asciidoc.gradle" //asciidoc (which is generated from root dir)
apply from: "gradle/releaser.gradle"
ext {
jdk = JavaVersion.current().majorVersion
jdkJavadoc = "https://docs.oracle.com/javase/$jdk/docs/api/"
if (JavaVersion.current().isJava11Compatible()) {
jdkJavadoc = "https://docs.oracle.com/en/java/javase/$jdk/docs/api/"
}
println "JDK Javadoc link for this build is ${rootProject.jdkJavadoc}"
bundleImportPackages = ['org.slf4j;resolution:=optional;version="[1.5.4,2)"',
'kotlin.*;resolution:=optional',
'io.micrometer.*;resolution:=optional',
'reactor.blockhound.*;resolution:=optional',
'!javax.annotation',
'!javax.annotation.meta',
'*']
/*
* Note that some versions can be bumped by a script.
* These are found in `gradle.properties`...
*
* Versions not necessarily bumped by a script (testing, etc...) below:
*/
// Misc not often upgraded
jsr305Version = '3.0.2'
jsr166BackportVersion = '1.0.0.RELEASE'
// Blockhound
blockhoundVersion = '1.0.0.RELEASE'
// Logging
slf4jVersion = '1.7.12'
logbackVersion = '1.1.2'
// Testing
jUnitVersion = '4.12'
jUnitJupiterVersion = '5.5.2' //for newer modules without legacy tests
assertJVersion = '3.11.1'
mockitoVersion = '2.23.0'
jUnitParamsVersion = '1.1.1'
awaitilityVersion = '3.1.2'
throwingFunctionVersion = '1.5.0'
javaObjectLayoutVersion = '0.9'
testNgVersion = '6.8.5'
}
//only publish scan if a specific gradle entreprise server is passed
//typically, for local usage, you would temporarily set the env with:
// `GRADLE_ENTERPRISE_URL=https://myge.example.com/ gradle foo`
if (System.getenv('GRADLE_ENTERPRISE_URL')) {
buildScan {
captureTaskInputFiles = true
obfuscation {
ipAddresses { addresses -> addresses.collect { '0.0.0.0' } }
}
publishAlways()
server = System.getenv('GRADLE_ENTERPRISE_URL')
}
}
configure(subprojects) { p ->
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'propdeps' //TODO replace with a simpler local plugin?
apply from: "${rootDir}/gradle/setup.gradle"
description = 'Non-Blocking Reactive Foundation for the JVM'
group = 'io.projectreactor'
repositories {
mavenLocal()
if (version.endsWith('BUILD-SNAPSHOT')) {
maven { url 'https://repo.spring.io/libs-snapshot' }
}
mavenCentral()
jcenter()
maven { url 'https://repo.spring.io/libs-milestone' }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
jacoco {
toolVersion = '0.8.5'
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
//includes for base test task (see below for additional common configurations)
test {
include '**/*Tests.*'
include '**/*Test.*'
include '**/*Spec.*'
}
//all test tasks will show FAILED for each test method,
// common exclusions, no scanning
p.tasks.withType(Test).all {
testLogging {
events "FAILED"
showExceptions true
exceptionFormat "FULL"
stackTraceFilters "ENTRY_POINT"
maxGranularity 3
}
if (isCiServer) {
def stdout = new LinkedList<TestOutputEvent>()
beforeTest { TestDescriptor td ->
stdout.clear()
}
onOutput { TestDescriptor td, TestOutputEvent toe ->
stdout.add(toe)
}
afterTest { TestDescriptor td, TestResult tr ->
if (tr.resultType == TestResult.ResultType.FAILURE && stdout.size() > 0) {
def stdOutput = stdout.collect {
it.getDestination().name() == "StdErr"
? "STD_ERR: ${it.getMessage()}"
: "STD_OUT: ${it.getMessage()}"
}
.join()
println "This is the console output of the failing test below:\n$stdOutput"
}
}
}
if (JavaVersion.current().isJava9Compatible()) {
println "Java 9+: lowering MaxGCPauseMillis to 20ms in ${project.name} ${name}"
jvmArgs = ["-XX:MaxGCPauseMillis=20"]
}
systemProperty("java.awt.headless", "true")
systemProperty("testGroups", p.properties.get("testGroups"))
scanForTestClasses = false
exclude '**/*Abstract*.*'
exclude '**/*OperatorTest*.*'
//allow re-run of failed tests only without special test tasks failing
// because the filter is too restrictive
filter.setFailOnNoMatchingTests(false)
//display intermediate results for special test tasks
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println('\n' + "${desc} Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)")
}
}
}
}
//assemble.dependsOn docsZip
gradle.allprojects() { p ->
apply plugin: "io.reactor.gradle.custom-version"
}
configure(subprojects) { p ->
//these apply once the above configure is done, but before project-specific build.gradle have applied
apply plugin: "io.reactor.gradle.java-conventions"
apply from: "${rootDir}/gradle/javadoc.gradle"
//these apply AFTER project-specific build.gradle have applied
afterEvaluate {
if (p.plugins.hasPlugin("kotlin")) {
println "Applying Kotlin conventions to ${p.name}"
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = ["-Xjsr305=strict"]
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = ["-Xjsr305=strict"]
}
}
}
}
Java
1
https://gitee.com/cdy1996/reactor-for-study.git
git@gitee.com:cdy1996/reactor-for-study.git
cdy1996
reactor-for-study
reactor-for-study
master

搜索帮助