Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies and clean up build scripts #423

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
/*
* Copyright 2019-2023 JetBrains s.r.o. and contributors.
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
*/
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

plugins {
id("kotlin")
kotlin("jvm")
id("me.champeau.jmh")
}


val mainJavaToolchainVersion by ext(project.property("java.mainToolchainVersion"))
val modularJavaToolchainVersion by ext(project.property("java.modularToolchainVersion"))
val jmhVersion: String by project

sourceSets {
dependencies {
implementation(project(":kotlinx-datetime"))
implementation("org.openjdk.jmh:jmh-core:1.35")
implementation("org.openjdk.jmh:jmh-core:$jmhVersion")
}
}

// Publish benchmarks to the root for the easier 'java -jar benchmarks.jar`
// publish benchmarks to the repository root for easier `java -jar benchmarks.jar`
tasks.named<Jar>("jmhJar") {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tasks.named<Jar>("jmhJar") {
tasks.jmhJar {

archiveBaseName = "benchmarks"
archiveClassifier = null
Expand All @@ -28,6 +23,9 @@ tasks.named<Jar>("jmhJar") {
destinationDirectory = file("$rootDir")
}

repositories {
mavenCentral()
// compile all Kotlin code from the module during full-repository builds
tasks.named("assemble") {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tasks.named("assemble") {
tasks.assemble {

tasks.withType<KotlinCompilationTask<*>>().forEach { compileKotlinTask ->
dependsOn(compileKotlinTask)
Comment on lines +28 to +29
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tasks.withType<KotlinCompilationTask<*>>().forEach { compileKotlinTask ->
dependsOn(compileKotlinTask)
dependsOn(tasks.withType<KotlinCompilationTask<*>>())

}
}
22 changes: 8 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
plugins {
id("kotlinx.team.infra") version "0.4.0-dev-81"
id("kotlinx.team.infra")
id("org.jetbrains.kotlinx.kover")

kotlin("multiplatform") apply false
id("org.jetbrains.kotlinx.kover") version "0.8.0-Beta2"
}

fun javaLanguageVersionProperty(propertyName: String) = JavaLanguageVersion.of(property(propertyName) as String)
val mainJavaToolchainVersion by extra(javaLanguageVersionProperty("java.mainToolchainVersion"))
val modularJavaToolchainVersion by extra(javaLanguageVersionProperty("java.modularToolchainVersion"))

infra {
teamcity {
}
publishing {
include(":kotlinx-datetime")
libraryRepoUrl = "https://github.com/Kotlin/kotlinx-datetime"
Expand All @@ -16,20 +19,11 @@ infra {
}
}

val mainJavaToolchainVersion by ext(project.property("java.mainToolchainVersion"))
val modularJavaToolchainVersion by ext(project.property("java.modularToolchainVersion"))

allprojects {
repositories {
mavenCentral()
}
}

kover {
reports {
verify {
rule {
// requirement for a minimum lines coverage of 85%
// requirement for a minimum line coverage of 85%
minBound(85)
}
}
Expand Down
Loading