diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-10-25 14:53:54 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-10-25 14:53:54 +0200 |
| commit | aa9b32f8cd1467e9718959f400f6777e5d71737d (patch) | |
| tree | b88bbede15108c6855d7f94ded4c7054df186a72 /buildSrc/src | |
| parent | eb0e0a3bc557c05a70eead388797ab850ea87366 (diff) | |
| parent | b7a71e5b4aa77b41ef41deec2ace42b67a5a13a7 (diff) | |
merge: Integrate v2.1 progress into public repository
This pull request integrates the changes planned for the v2.1 release of
OpenDC into the public Github repository in order to sync the progress
of both repositories.
Diffstat (limited to 'buildSrc/src')
7 files changed, 17 insertions, 82 deletions
diff --git a/buildSrc/src/main/kotlin/Libs.kt b/buildSrc/src/main/kotlin/Libs.kt index 9567845a..f538b1ad 100644 --- a/buildSrc/src/main/kotlin/Libs.kt +++ b/buildSrc/src/main/kotlin/Libs.kt @@ -58,6 +58,6 @@ public class Libs(project: Project) { /** * The JVM version to target. */ - val jvmTarget = JavaVersion.VERSION_1_8 + val jvmTarget = JavaVersion.VERSION_11 } } diff --git a/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts b/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts index 4e73d4d3..65608e8f 100644 --- a/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts @@ -20,49 +20,21 @@ * SOFTWARE. */ -import kotlinx.benchmark.gradle.* import org.jetbrains.kotlin.allopen.gradle.* plugins { - id("org.jetbrains.kotlinx.benchmark") `java-library` kotlin("plugin.allopen") -} - -sourceSets { - register("jmh") { - compileClasspath += sourceSets["main"].output - runtimeClasspath += sourceSets["main"].output - } -} - -configurations { - named("jmhImplementation") { - extendsFrom(configurations["implementation"]) - } + id("me.champeau.jmh") } configure<AllOpenExtension> { annotation("org.openjdk.jmh.annotations.State") } -benchmark { - targets { - register("jmh") { - this as JvmBenchmarkTarget - jmhVersion = "1.21" - } - } -} - -dependencies { - val libs = Libs(project) - implementation(libs["kotlinx-benchmark-runtime-jvm"]) -} +jmh { + jmhVersion.set("1.33") -// Workaround for https://github.com/Kotlin/kotlinx-benchmark/issues/39 -afterEvaluate { - tasks.named<org.gradle.jvm.tasks.Jar>("jmhBenchmarkJar") { - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - } + profilers.add("stack") + profilers.add("gc") } diff --git a/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts b/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts index 26780205..c1750a40 100644 --- a/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts @@ -1,5 +1,3 @@ -import gradle.kotlin.dsl.accessors._9bf86420fccbde1948375f641de89b70.sourceSets - /* * Copyright (c) 2021 AtLarge Research * diff --git a/buildSrc/src/main/kotlin/jacoco-aggregation.gradle.kts b/buildSrc/src/main/kotlin/jacoco-aggregation.gradle.kts index 3e8aa741..5afd3e0d 100644 --- a/buildSrc/src/main/kotlin/jacoco-aggregation.gradle.kts +++ b/buildSrc/src/main/kotlin/jacoco-aggregation.gradle.kts @@ -1,7 +1,5 @@ /* - * MIT License - * - * Copyright (c) 2019 atlarge-research + * Copyright (c) 2021 AtLarge Research * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,10 +35,10 @@ tasks.register<JacocoReport>("codeCoverageReport") { description = "Generates an aggregate report based on all subprojects" reports { - xml.isEnabled = true - xml.destination = file("${buildDir}/reports/jacoco/report.xml") + xml.required.set(true) + xml.outputLocation.set(file("${buildDir}/reports/jacoco/report.xml")) - html.isEnabled = true + html.required.set(true) } subprojects { diff --git a/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts b/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts index d0534d4f..6fb9ccc3 100644 --- a/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts @@ -27,39 +27,6 @@ plugins { tasks.jacocoTestReport { reports { - html.isEnabled = true + html.required.set(true) } } - -/* Share sources folder with other projects for aggregated JaCoCo reports */ -configurations.create("transitiveSourcesElements") { - isVisible = false - isCanBeResolved = false - isCanBeConsumed = true - extendsFrom(configurations.implementation.get()) - attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION)) - attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named("source-folders")) - } - sourceSets.main.get().java.srcDirs.forEach { - outgoing.artifact(it) - } -} - -/* Share the coverage data to be aggregated for the whole product */ -configurations.create("coverageDataElements") { - isVisible = false - isCanBeResolved = false - isCanBeConsumed = true - extendsFrom(configurations.implementation.get()) - attributes { - attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION)) - attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named("jacoco-coverage-data")) - } - // This will cause the test task to run if the coverage data is requested by the aggregation task - outgoing.artifact(tasks.test.map { task -> - task.extensions.getByType<JacocoTaskExtension>().destinationFile!! - }) -} diff --git a/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts b/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts index 703e9938..6e4cab89 100644 --- a/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts @@ -39,6 +39,6 @@ java { tasks.withType<KotlinCompile>().configureEach { kotlinOptions.jvmTarget = Libs.jvmTarget.toString() - kotlinOptions.useIR = true kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + kotlinOptions.freeCompilerArgs += "-Xjvm-default=all" } diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 7d344500..ebeb58a4 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -28,16 +28,16 @@ tasks.test { useJUnitPlatform() reports { - html.isEnabled = true - junitXml.isEnabled = true + html.required.set(true) + junitXml.required.set(true) } } dependencies { val libs = Libs(project) - testImplementation(libs["junit-jupiter-api"]) - testImplementation(libs["junit-jupiter-params"]) + testImplementation(libs["junit.jupiter.api"]) + testImplementation(libs["junit.jupiter.params"]) testImplementation(libs["mockk"]) - testRuntimeOnly(libs["junit-jupiter-engine"]) + testRuntimeOnly(libs["junit.jupiter.engine"]) } |
