Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
223 lines (177 sloc) 5.11 KB
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.13.1'
classpath "me.champeau.gradle:jmh-gradle-plugin:0.4.4"
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: "me.champeau.gradle.jmh"
apply plugin: 'pmd'
apply plugin: 'jacoco'
apply plugin: "com.github.hierynomus.license"
sourceCompatibility = '1.9'
targetCompatibility = '1.9'
group = "com.github.akarnokd"
ext.githubProjectName = 'reactive4javaflow'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
if (!hasProperty('mainClass')) {
ext.mainClass = ''
}
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://oss.sonatype.org/content/groups/public' }
maven { url 'https://oss.jfrog.org/libs-snapshot' }
maven { url 'http://repo.spring.io/libs-snapshot' }
}
apply from: file('gradle/maven.gradle')
apply plugin: 'maven'
apply plugin: 'osgi'
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.testng', name: 'testng', version: '6.11'
testCompile 'org.reactivestreams:reactive-streams-tck-flow:1.0.2'
// testCompile 'org.reactivestreams:reactive-streams-flow-tck:1.0.1'
// compile "org.reactivestreams:reactive-streams:1.0.1"
// compile "io.reactivex.rxjava2:rxjava:2.1.3"
// compile "com.github.akarnokd:rxjava2-extensions:0.17.6"
// compile "io.projectreactor:reactor-core:+"
// compile group: 'io.projectreactor.addons', name: 'reactor-extra', version: '3+'
}
[compileJava, compileTestJava]*.options*.compilerArgs << "-parameters"
tasks.withType(JavaCompile) {
options.compilerArgs << "-parameters";
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
jar {
manifest {
name = 'reactive4javaflow'
instruction 'Bundle-Vendor', 'akarnokd'
instruction 'Bundle-DocURL', 'https://github.com/akarnokd/Reactive4JavaFlow'
instruction 'Import-Package', '!org.junit,!junit.framework,!org.mockito.*,*'
instruction 'Eclipse-ExtensibleAPI', 'true'
}
}
apply plugin: 'maven-publish'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact (sourcesJar) {
classifier = 'sources'
}
}
}
}
jmh {
jmhVersion = '1.19'
humanOutputFile = null
includeTests = false
if (project.hasProperty('jmh')) {
include = ".*" + project.jmh + ".*"
}
}
plugins.withType(EclipsePlugin) {
project.eclipse.classpath.plusConfigurations += [ configurations.jmh ]
}
javadoc {
failOnError = false
exclude "**/impl/**"
exclude "**/test/**"
exclude "**/perf/**"
options {
windowTitle = "Reactive4JavaFlow Javadoc ${project.version}"
}
// Clear the following options to make the docs consistent with the old format
options.addStringOption('top').value = ''
options.addStringOption('doctitle').value = ''
options.addStringOption('header').value = ''
options.links("https://docs.oracle.com/javase/9/docs/api")
}
test {
maxHeapSize = "2g"
testLogging {
events "started", "failed", "skipped" //, "passed"
// showStandardStreams = true
exceptionFormat = 'full'
}
}
task testng(type: Test) {
useTestNG()
testLogging {
events=["skipped", "failed"]
exceptionFormat="full"
debug.events = ["skipped", "failed"]
debug.exceptionFormat="full"
info.events = ["failed", "skipped"]
info.exceptionFormat="full"
warn.events = ["failed", "skipped"]
warn.exceptionFormat="full"
}
}
check.dependsOn testng
license {
header rootProject.file('HEADER')
ext.year = Calendar.getInstance().get(Calendar.YEAR)
skipExistingHeaders true
ignoreFailures true
excludes(["**/*.md", "**/*.txt"])
}
jacoco {
toolVersion = '0.7.9' // See http://www.eclemma.org/jacoco/.
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
build.dependsOn jacocoTestReport
check.dependsOn jacocoTestReport
pmd {
toolVersion = '5.4.2'
ignoreFailures = true
sourceSets = [sourceSets.main]
ruleSets = []
ruleSetFiles = files('pmd.xml')
}
pmdMain {
reports {
html.enabled = true
xml.enabled = true
}
}
task pmdPrint(dependsOn: 'pmdMain') doLast {
File file = rootProject.file('build/reports/pmd/main.xml')
if (file.exists()) {
println("Listing first 100 PMD violations")
file.eachLine { line, count ->
if (count <= 100) {
println(line)
}
}
} else {
println("PMD file not found.")
}
}
build.dependsOn pmdPrint
check.dependsOn pmdPrint