Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import kotlinx.benchmark.gradle.JvmBenchmarkTarget
import org.gradle.jvm.tasks.Jar
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
id("kotlin-multiplatform")
Expand Down Expand Up @@ -30,6 +31,7 @@ kotlin {
}
}

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
nodejs()
}
Expand Down
111 changes: 0 additions & 111 deletions benchmarks/runner/build.gradle

This file was deleted.

126 changes: 126 additions & 0 deletions benchmarks/runner/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
plugins {
id("org.jetbrains.kotlin.jvm")
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.openjdk.jmh:jmh-core:1.21")

runtimeOnly(project(path = ":benchmarks", configuration = "benchmarksJar"))
runtimeOnly(project(":kotlinx-collections-immutable"))
}

sourceSets.main {
kotlin.srcDirs("src")
}

// map
val benchmarkHashMap by tasks.registering(JavaExec::class) {
group = "Benchmark"
mainClass = "runners.HashMapRunnerKt"
}

val benchmarkHashMapBuilder by tasks.registering(JavaExec::class) {
group = "Benchmark"
mainClass = "runners.HashMapBuilderRunnerKt"
}

val benchmarkOrderedMap by tasks.registering(JavaExec::class) {
group = "Benchmark"
mainClass = "runners.OrderedMapRunnerKt"
}

val benchmarkOrderedMapBuilder by tasks.registering(JavaExec::class) {
group = "Benchmark"
mainClass = "runners.OrderedMapBuilderRunnerKt"
}

val benchmarkAllMaps by tasks.registering {
group = "Benchmark"
dependsOn(benchmarkHashMap)
dependsOn(benchmarkHashMapBuilder)
dependsOn(benchmarkOrderedMap)
dependsOn(benchmarkOrderedMapBuilder)
}

// set
val benchmarkHashSet by tasks.registering(JavaExec::class) {
group = "Benchmark"
mainClass = "runners.HashSetRunnerKt"
}

val benchmarkHashSetBuilder by tasks.registering(JavaExec::class) {
group = "Benchmark"
mainClass = "runners.HashSetBuilderRunnerKt"
}

val benchmarkOrderedSet by tasks.registering(JavaExec::class) {
group = "Benchmark"
mainClass = "runners.OrderedSetRunnerKt"
}

val benchmarkOrderedSetBuilder by tasks.registering(JavaExec::class) {
group = "Benchmark"
mainClass = "runners.OrderedSetBuilderRunnerKt"
}

val benchmarkAllSets by tasks.registering {
group = "Benchmark"
dependsOn(benchmarkHashSet)
dependsOn(benchmarkHashSetBuilder)
dependsOn(benchmarkOrderedSet)
dependsOn(benchmarkOrderedSetBuilder)
}

// list
val benchmarkList by tasks.registering(JavaExec::class) {
group = "Benchmark"
mainClass = "runners.ListRunnerKt"
}

val benchmarkListBuilder by tasks.registering(JavaExec::class) {
group = "Benchmark"
mainClass = "runners.ListBuilderRunnerKt"
}

val benchmarkAllLists by tasks.registering {
group = "Benchmark"
dependsOn(benchmarkList)
dependsOn(benchmarkListBuilder)
}

// all
val benchmarkAll by tasks.registering {
group = "Benchmark"
dependsOn(benchmarkAllMaps)
dependsOn(benchmarkAllSets)
dependsOn(benchmarkAllLists)
}

// configure runner tasks

val benchmarkParams = listOf(
"remote",
"forks",
"measurementIterations",
"measurementTime",
"warmupIterations",
"warmupTime",
// "exclude",
// "include",
"size",
"hashCodeType",
"immutablePercentage"
)

tasks.withType<JavaExec>().configureEach {
if (group == "Benchmark") {
classpath = sourceSets.main.get().runtimeClasspath

benchmarkParams.forEach { param ->
if (project.hasProperty(param)) {
systemProperty(param, requireNotNull(project.property(param)))
}
}
}
}
7 changes: 5 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import kotlinx.team.infra.mavenPublicationsPom
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
id("kotlin-multiplatform")
`maven-publish`
}

base {
archivesBaseName = "kotlinx-collections-immutable" // doesn't work
archivesName = "kotlinx-collections-immutable" // doesn't work
}

mavenPublicationsPom {
description.set("Kotlin Immutable Collections multiplatform library")
description = "Kotlin Immutable Collections multiplatform library"
}

kotlin {
Expand Down Expand Up @@ -69,6 +70,7 @@ kotlin {
}
}

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
nodejs {
testTask {
Expand All @@ -79,6 +81,7 @@ kotlin {
}
}

@OptIn(ExperimentalWasmDsl::class)
wasmWasi {
nodejs {
testTask {
Expand Down
14 changes: 0 additions & 14 deletions settings.gradle

This file was deleted.

16 changes: 16 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pluginManagement {
repositories {
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlinx/maven")
gradlePluginPortal()
}
}

rootProject.name = "Kotlin-Immutable-Collections" // TODO: Make readable name when it's not used in js module names

include(":core")
project(":core").name="kotlinx-collections-immutable"

include(
":benchmarks",
":benchmarks:runner"
)