Skip to content

Commit

Permalink
OpenJDKs 8 to 11 in travis and version 0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jdiazcano committed Mar 5, 2019
1 parent 9dc6465 commit 5491589
Show file tree
Hide file tree
Showing 11 changed files with 694 additions and 691 deletions.
12 changes: 11 additions & 1 deletion .travis.yml
@@ -1,5 +1,15 @@
languaje: kotlin
jdk: oraclejdk8
jdk:
- openjdk8
- openjdk9
- openjdk10
- openjdk11
- openjdk-ea

matrix:
allow_failures:
- jdk: openjdk-ea

sudo: false

notifications:
Expand Down
382 changes: 190 additions & 192 deletions build.gradle
@@ -1,192 +1,190 @@
import java.util.stream.Collectors

buildscript {

apply from: 'gradle/versions.gradle'

repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jetbrains.jfrog.io/jetbrains/spek-snapshots' }
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.jetbrains.kotlin"
classpath "org.junit.platform:junit-platform-gradle-plugin:$versions.junitrunner"
}

}

plugins {
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'com.github.ben-manes.versions' version '0.20.0'
id "com.jfrog.bintray" version "1.8.4"
}

apply plugin: 'jacoco'
apply plugin: 'idea'

idea {
module {
downloadJavadoc = true
downloadSources = true
}
}

project.ext {
artifactGroup = "com.jdiazcano.cfg4k"
artifactVersion = "0.9.2"
}

repositories {
mavenCentral()
}

subprojects { p ->
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'jacoco'
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: "maven-publish"
apply plugin: "com.jfrog.bintray"

sourceCompatibility = 1.8

repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jetbrains.jfrog.io/jetbrains/spek-snapshots' }
}

bintray {
user = 'jdiazcano'
key = System.getenv("BINTRAY_KEY")
publications = ["kotlinPublish"]
//configurations = ["archives"]
publish = true
override = true
pkg {
repo = 'cfg4k'
name = p.name
userOrg = 'jdiazcano'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/jdiazcano/cfg4k.git'
publicDownloadNumbers = true
version {
name = project.artifactVersion
desc = 'Cfg4k is a configuration library made for Kotlin in Kotlin!'
released = new Date()
vcsTag = project.artifactVersion
}
}
}

// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar
}

publishing {
publications {
kotlinPublish(MavenPublication) {
from components.java
groupId 'com.jdiazcano.cfg4k'
artifactId p.name
version project.artifactVersion

artifact sourcesJar
artifact javadocJar
}
}
}

project.afterEvaluate {
def junitPlatformTestTask = project.tasks.getByName('junitPlatformTest')

jacoco {
toolVersion = "+"
reportsDir = file("$buildDir/reports/jacoco")
applyTo junitPlatformTestTask
}

project.task(type: JacocoReport, "junitPlatformJacocoReport", {
sourceDirectories = files("src/main/kotlin")
classDirectories = files("$buildDir/classes/main")
reports {
xml.enabled = true
html.enabled = true
xml.destination = new File("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
html.destination = new File("${buildDir}/reports/jacoco/test/jacocoTestReport.html")
}
executionData junitPlatformTestTask
})
}

coveralls {
sourceDirs += ['src/main/kotlin']
}

// Needed because there's something messy with kotlin version numbers and dependencies
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.jetbrains.kotlin') {
details.useVersion "$versions.jetbrains.kotlin"
}
}
}
}

junitPlatform {
platformVersion "${versions.junitrunner}"
filters {
engines {
include 'spek'
}
}
}

}

def activeSubprojects = subprojects.findAll { it.name.startsWith("cfg4k") }
def subprojectsExecFiles = files( activeSubprojects.stream().map { "${it.name}/build/jacoco/junitPlatformTest.exec" }.collect(Collectors.toList()) )

task junitTest(dependsOn: getTasksByName("junitPlatformTest", true))
task report(dependsOn: getTasksByName("junitPlatformJacocoReport", true))

task jacocoRootReport(type: JacocoReport) {
additionalSourceDirs = files(activeSubprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(activeSubprojects.sourceSets.main.allSource.srcDirs)
classDirectories = files(activeSubprojects.sourceSets.main.output)
executionData = subprojectsExecFiles
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
onlyIf = {
true
}

}

coveralls {
sourceDirs = activeSubprojects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}

task publish(dependsOn: activeSubprojects.collect { it.tasks.findByPath("bintrayUpload") }) {}
task publishLocal(dependsOn: activeSubprojects.collect { it.tasks.findByPath("publishToMavenLocal") }) {}
buildscript {

apply from: 'gradle/versions.gradle'

repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jetbrains.jfrog.io/jetbrains/spek-snapshots' }
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.jetbrains.kotlin"
classpath "org.junit.platform:junit-platform-gradle-plugin:$versions.junitrunner"
}

}

plugins {
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'com.github.ben-manes.versions' version '0.20.0'
id "com.jfrog.bintray" version "1.8.4"
}

apply plugin: 'jacoco'
apply plugin: 'idea'

idea {
module {
downloadJavadoc = true
downloadSources = true
}
}

project.ext {
artifactGroup = "com.jdiazcano.cfg4k"
artifactVersion = "0.9.3"
}

repositories {
mavenCentral()
}

subprojects { p ->
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'jacoco'
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: "maven-publish"
apply plugin: "com.jfrog.bintray"

sourceCompatibility = 1.8

repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jetbrains.jfrog.io/jetbrains/spek-snapshots' }
}

bintray {
user = 'jdiazcano'
key = System.getenv("BINTRAY_KEY")
publications = ["kotlinPublish"]
//configurations = ["archives"]
publish = true
override = true
pkg {
repo = 'cfg4k'
name = p.name
userOrg = 'jdiazcano'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/jdiazcano/cfg4k.git'
publicDownloadNumbers = true
version {
name = project.artifactVersion
desc = 'Cfg4k is a configuration library made for Kotlin in Kotlin!'
released = new Date()
vcsTag = project.artifactVersion
}
}
}

// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar
}

publishing {
publications {
kotlinPublish(MavenPublication) {
from components.java
groupId 'com.jdiazcano.cfg4k'
artifactId p.name
version project.artifactVersion

artifact sourcesJar
artifact javadocJar
}
}
}

project.afterEvaluate {
def junitPlatformTestTask = project.tasks.getByName('junitPlatformTest')

jacoco {
toolVersion = "+"
reportsDir = file("$buildDir/reports/jacoco")
applyTo junitPlatformTestTask
}

project.task(type: JacocoReport, "junitPlatformJacocoReport", {
sourceDirectories = files("src/main/kotlin")
classDirectories = files("$buildDir/classes/main")
reports {
xml.enabled = true
html.enabled = true
xml.destination = new File("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
html.destination = new File("${buildDir}/reports/jacoco/test/jacocoTestReport.html")
}
executionData junitPlatformTestTask
})
}

coveralls {
sourceDirs += ['src/main/kotlin']
}

// Needed because there's something messy with kotlin version numbers and dependencies
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.jetbrains.kotlin') {
details.useVersion "$versions.jetbrains.kotlin"
}
}
}
}

junitPlatform {
platformVersion "${versions.junitrunner}"
filters {
engines {
include 'spek'
}
}
}

}

def activeSubprojects = subprojects.findAll { it.name.startsWith("cfg4k") }
def subprojectsExecFiles = files( activeSubprojects.collect { "${it.name}/build/jacoco/junitPlatformTest.exec" } )

task junitTest(dependsOn: getTasksByName("junitPlatformTest", true))
task report(dependsOn: getTasksByName("junitPlatformJacocoReport", true))

task jacocoRootReport(type: JacocoReport) {
additionalSourceDirs = files(activeSubprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(activeSubprojects.sourceSets.main.allSource.srcDirs)
classDirectories = files(activeSubprojects.sourceSets.main.output)
executionData = subprojectsExecFiles
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
onlyIf = {
true
}

}

coveralls {
sourceDirs = activeSubprojects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}

task publish(dependsOn: activeSubprojects.collect { it.tasks.findByPath("bintrayUpload") }) {}
task publishLocal(dependsOn: activeSubprojects.collect { it.tasks.findByPath("publishToMavenLocal") }) {}

0 comments on commit 5491589

Please sign in to comment.