Skip to content

Commit

Permalink
Sub-structure reactor-core to prepare some room for reactor-test
Browse files Browse the repository at this point in the history
- Improve build
- Top level src hosts doc and produce reactor-core-docs zip
- subdirectory reactor-core produce reactor-core jar
  • Loading branch information
Stephane Maldini authored and smaldini committed May 31, 2017
1 parent 954458a commit 6243b91
Show file tree
Hide file tree
Showing 573 changed files with 609 additions and 550 deletions.
272 changes: 151 additions & 121 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,37 @@

buildscript {
repositories {
maven { url "http://repo.spring.io/plugins-release" }
maven { url "http://repo.spring.io/plugins-release" }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7',
'io.spring.gradle:spring-io-plugin:0.0.4.RELEASE',
'com.github.jengelman.gradle.plugins:shadow:1.2.0',
'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.11'
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7',
'io.spring.gradle:spring-io-plugin:0.0.4.RELEASE',
'com.github.jengelman.gradle.plugins:shadow:1.2.0',
'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.11'
}
}

plugins {
id 'org.asciidoctor.convert' version '1.5.2'
id "me.champeau.gradle.jmh" version "0.3.1"
}

apply from: "gradle/doc.gradle"
apply from: "gradle/setup.gradle"

description = 'Non-Blocking Reactive Foundation for the JVM'
group = 'io.projectreactor'

ext {
gradleVersion = '3.1'
gradleScriptDir = "${rootProject.projectDir}/gradle"
gradleVersion = '3.5'

// Logging
slf4jVersion = '1.7.12'
logbackVersion = '1.1.2'

// Testing
assertJVersion = '3.6.1'
testAddonVersion = '3.1.0.BUILD-SNAPSHOT'
mockitoVersion = '2.7.22'

javadocLinks = ["http://docs.oracle.com/javase/8/docs/api/",
"http://docs.oracle.com/javaee/6/api/",
"http://www.reactive-streams.org/reactive-streams-1.0.0-javadoc/"] as String[]
Expand All @@ -58,136 +59,172 @@ ext {

}

apply plugin: 'java'
apply plugin: 'jacoco'
apply from: "$gradleScriptDir/setup.gradle"
apply plugin: 'propdeps'
apply plugin: 'osgi'
apply from: "${gradleScriptDir}/ide.gradle"

jacoco {
toolVersion = '0.7.7.201606060606'
}
configure(subprojects) { p ->
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'propdeps'
apply plugin: 'osgi'

repositories {
mavenLocal()
if (version.endsWith('BUILD-SNAPSHOT') || project.hasProperty('platformVersion')) {
maven { url 'http://repo.spring.io/libs-snapshot' }
}

mavenCentral()
jcenter()
maven { url 'http://repo.spring.io/libs-milestone' }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }

jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}

if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'
jacoco {
toolVersion = '0.7.7.201606060606'
}

dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:$platformVersion"
}
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
}

[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:-varargs", // intentionally disabled
"-Xlint:cast",
"-Xlint:classfile",
"-Xlint:dep-ann",
"-Xlint:divzero",
"-Xlint:empty",
"-Xlint:finally",
"-Xlint:overrides",
"-Xlint:path",
"-Xlint:processing",
"-Xlint:static",
"-Xlint:try",
"-Xlint:deprecation",
"-Xlint:unchecked",
"-Xlint:-serial", // intentionally disabled
"-Xlint:-options", // intentionally disabled
"-Xlint:-fallthrough", // intentionally disabled
"-Xlint:-rawtypes" // TODO enable and fix warnings
]

compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
[compileJava, compileTestJava]*.options*.compilerArgs =
["-Xlint:-varargs", // intentionally disabled
"-Xlint:cast",
"-Xlint:classfile",
"-Xlint:dep-ann",
"-Xlint:divzero",
"-Xlint:empty",
"-Xlint:finally",
"-Xlint:overrides",
"-Xlint:path",
"-Xlint:processing",
"-Xlint:static",
"-Xlint:try",
"-Xlint:deprecation",
"-Xlint:unchecked",
"-Xlint:-serial", // intentionally disabled
"-Xlint:-options", // intentionally disabled
"-Xlint:-fallthrough", // intentionally disabled
"-Xlint:-rawtypes" // TODO enable and fix warnings
]

compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

if (JavaVersion.current().isJava8Compatible()) {
compileTestJava.options.compilerArgs += "-parameters"
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
javadoc {
dependsOn jar
group = "Reactor Core Javadoc"
description = "Generates aggregated Javadoc API documentation."
title = "Reactor Core $version"

options.addStringOption('charSet', 'UTF-8')

options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = "$p.name"
options.overview = "$rootDir/src/api/overview.html"
options.stylesheetFile = file("$rootDir/src/api/stylesheet.css")
options.links(rootProject.ext.javadocLinks)
options.tags = [ "apiNote:a:API Note:", "implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:" ]

maxMemory = "1024m"
destinationDir = new File(p.buildDir, "docs/javadoc")
source p.sourceSets.main.allJava
doFirst {
classpath = files(p.sourceSets.main.compileClasspath)
}
}
}

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
if (JavaVersion.current().isJava8Compatible()) {
compileTestJava.options.compilerArgs += "-parameters"
p.tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}

test {
testLogging {
events "passed", "failed"
showExceptions true
exceptionFormat "full"
maxGranularity 3
}
}

project.tasks.withType(Test).all {
systemProperty("java.awt.headless", "true")
systemProperty("reactor.trace.cancel", "true")
systemProperty("reactor.trace.nocapacity", "true")
systemProperty("testGroups", project.properties.get("testGroups"))
scanForTestClasses = false
include '**/*Tests.*'
include '**/*Test.*'
include '**/*Spec.*'
if(!version.contains("SNAPSHOT")){
include '**/*Loop.*'
p.tasks.withType(Test).all {
systemProperty("java.awt.headless", "true")
systemProperty("reactor.trace.cancel", "true")
systemProperty("reactor.trace.nocapacity", "true")
systemProperty("testGroups", p.properties.get("testGroups"))
scanForTestClasses = false
include '**/*Tests.*'
include '**/*Test.*'
include '**/*Spec.*'
if (!version.contains("SNAPSHOT")) {
include '**/*Loop.*'
}
exclude '**/*Abstract*.*'
exclude '**/*OperatorTest*.*'
}
exclude '**/*Abstract*.*'
exclude '**/*OperatorTest*.*'
}

configure(rootProject) {
repositories {
mavenLocal()
if (version.endsWith('BUILD-SNAPSHOT') || project.hasProperty('platformVersion')) {
maven { url 'http://repo.spring.io/libs-snapshot' }
if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'

dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:$platformVersion"
}
}
}
}

mavenCentral()
jcenter()
maven { url 'http://repo.spring.io/libs-milestone' }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }

}
project('reactor-core') {
apply from: rootProject.file('gradle/jmh.gradle')

configurations {
compileOnly.extendsFrom jsr166backport
testCompile.extendsFrom jsr166backport
compileOnly.extendsFrom jsr166backport
testCompile.extendsFrom jsr166backport
}

// dependencies that are common across all java projects
dependencies {
// Reactive Streams
compile "org.reactivestreams:reactive-streams:1.0.0"
testCompile "org.reactivestreams:reactive-streams-tck:1.0.0"
// Reactive Streams
compile "org.reactivestreams:reactive-streams:1.0.0"
testCompile "org.reactivestreams:reactive-streams-tck:1.0.0"

// JSR-305 annotations
optional "com.google.code.findbugs:jsr305:3.0.0"
// JSR-305 annotations
optional "com.google.code.findbugs:jsr305:3.0.0"

//Optional Logging Operator
optional "org.slf4j:slf4j-api:$slf4jVersion"
//Optional Logging Operator
optional "org.slf4j:slf4j-api:$slf4jVersion"

//Optional JDK 9 Converter
jsr166backport "io.projectreactor:jsr166:1.0.0.RELEASE"

//Optional JDK 9 Converter
jsr166backport "io.projectreactor:jsr166:1.0.0.RELEASE"

testCompile 'junit:junit:4.12'

testRuntime "ch.qos.logback:logback-classic:$logbackVersion"
// Testing
testCompile("io.projectreactor.addons:reactor-test:$testAddonVersion"){
// Testing
testCompile(project(":reactor-test")) {
exclude module: 'reactor-core'
}

testCompile "org.hamcrest:hamcrest-library:1.3",
"org.testng:testng:6.8.5",
testCompile "org.hamcrest:hamcrest-library:1.3",
"org.testng:testng:6.8.5",
"org.assertj:assertj-core:$assertJVersion",
"org.mockito:mockito-core:$mockitoVersion"
}
Expand All @@ -205,30 +242,23 @@ configure(rootProject) {

sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"]

test {
testLogging {
events "passed", "failed"
showExceptions true
exceptionFormat "full"
maxGranularity 3
}
}

if (!JavaVersion.current().isJava9Compatible()) {
test {
jvmArgs = ["-Xbootclasspath/p:" + configurations.jsr166backport.asPath]
}
}


jar {
manifest {
manifest {
attributes 'Implementation-Title': 'reactor-core',
'Implementation-Version': version
instruction 'Import-Package', bundleImportPackages.join(',')
}
'Implementation-Version': version
instruction 'Import-Package', bundleImportPackages.join(',')
}
}

jacocoTestReport.dependsOn testNG
check.dependsOn jacocoTestReport
}

jacocoTestReport.dependsOn testNG
check.dependsOn jacocoTestReport
assemble.dependsOn docsZip
34 changes: 0 additions & 34 deletions gradle/doc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,8 @@
* limitations under the License.
*/
configure(rootProject) {
apply plugin: "java"
apply plugin: 'org.asciidoctor.convert'

javadoc {
dependsOn jar
group = "Reactor Core Javadoc"

description = "Generates aggregated Javadoc API documentation."
title = "Reactor Core $version"

if (JavaVersion.current().isJava8Compatible()) {
compileTestJava.options.compilerArgs += "-parameters"
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}

options.addStringOption('charSet', 'UTF-8')

options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = "Reactor Core"
options.overview = "src/api/overview.html"
options.stylesheetFile = file("src/api/stylesheet.css")
options.links(rootProject.ext.javadocLinks)
options.tags = [ "apiNote:a:API Note:", "implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:" ]

maxMemory = "1024m"
destinationDir = new File(buildDir, "docs/javadoc")
source rootProject.sourceSets.main.allJava
doFirst {
classpath = files(rootProject.sourceSets.main.compileClasspath)
}
}

asciidoctor {
sources {
include "index.asciidoc"
Expand Down
Loading

0 comments on commit 6243b91

Please sign in to comment.