-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OpenJDKs 8 to 11 in travis and version 0.9.3
- Loading branch information
Showing
11 changed files
with
694 additions
and
691 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") }) {} |
Oops, something went wrong.