Skip to content

Commit ac44fd9

Browse files
author
Abduqodiri Qurbonzoda
committed
Remove BenchmarksPlugin.RUNTIME_DEPENDENCY_BASE and redundant dependency declarations
1 parent c98e7bb commit ac44fd9

File tree

5 files changed

+0
-35
lines changed

5 files changed

+0
-35
lines changed

plugin/main/src/kotlinx/benchmark/gradle/BenchmarksPlugin.kt

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class BenchmarksPlugin : Plugin<Project> {
1919
const val BENCHMARK_EXEC_SUFFIX = "Benchmark"
2020
const val BENCHMARK_COMPILATION_NAME = "benchmark"
2121

22-
const val RUNTIME_DEPENDENCY_BASE = "kotlinx.benchmark:runtime"
2322
const val JMH_CORE_DEPENDENCY = "org.openjdk.jmh:jmh-core"
2423
const val JMH_GENERATOR_DEPENDENCY = "org.openjdk.jmh:jmh-generator-bytecode:"
2524

plugin/main/src/kotlinx/benchmark/gradle/JsMultiplatformTasks.kt

-11
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ fun Project.processJsCompilation(target: JsBenchmarkTarget) {
77
project.logger.info("Configuring benchmarks for '${target.name}' using Kotlin/JS")
88
val compilation = target.compilation
99

10-
configureMultiplatformJsCompilation(target)
11-
1210
createJsBenchmarkGenerateSourceTask(target, compilation)
1311

1412
val benchmarkCompilation = createJsBenchmarkCompileTask(target)
@@ -66,12 +64,3 @@ private fun Project.createJsBenchmarkGenerateSourceTask(
6664
outputSourcesDir = file("$benchmarkBuildDir/sources")
6765
}
6866
}
69-
70-
private fun Project.configureMultiplatformJsCompilation(target: JsBenchmarkTarget) {
71-
// Add runtime library as an implementation dependency to the specified compilation
72-
val runtime = dependencies.create("${BenchmarksPlugin.RUNTIME_DEPENDENCY_BASE}-js:${target.extension.version}")
73-
74-
target.compilation.dependencies {
75-
//implementation(runtime)
76-
}
77-
}

plugin/main/src/kotlinx/benchmark/gradle/JvmJavaTasks.kt

-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ private fun Project.configureJmhDependency(target: JavaBenchmarkTarget) {
3636

3737
// Add dependency to JMH core library to the source set designated by config.name
3838
val jmhCore = dependencies.create("${BenchmarksPlugin.JMH_CORE_DEPENDENCY}:${target.jmhVersion}")
39-
val runtimeJvm = dependencies.create("${BenchmarksPlugin.RUNTIME_DEPENDENCY_BASE}-jvm:${target.extension.version}")
4039
val configurationRoot = "implementation"
4140

4241
val dependencyConfiguration = if (target.name == "main")
@@ -45,5 +44,4 @@ private fun Project.configureJmhDependency(target: JavaBenchmarkTarget) {
4544
"${target.name}${configurationRoot.capitalize()}"
4645

4746
dependencies.add(dependencyConfiguration, jmhCore)
48-
//dependencies.add(dependencyConfiguration, runtimeJvm)
4947
}

plugin/main/src/kotlinx/benchmark/gradle/JvmMultiplatformTasks.kt

-4
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ private fun Project.configureMultiplatformJvmCompilation(target: KotlinJvmBenchm
2727
// Add JMH core library as an implementation dependency to the specified compilation
2828
val jmhCore = dependencies.create("${BenchmarksPlugin.JMH_CORE_DEPENDENCY}:${target.jmhVersion}")
2929

30-
// Add runtime library as an implementation dependency to the specified compilation
31-
val runtime = dependencies.create("${BenchmarksPlugin.RUNTIME_DEPENDENCY_BASE}-jvm:${target.extension.version}")
32-
3330
target.compilation.dependencies {
3431
implementation(jmhCore)
35-
//implementation(runtime)
3632
}
3733
}

plugin/main/src/kotlinx/benchmark/gradle/NativeMultiplatformTasks.kt

-17
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ fun Project.processNativeCompilation(target: NativeBenchmarkTarget) {
1414
}
1515

1616
project.logger.info("Configuring benchmarks for '${target.name}' using Kotlin/Native")
17-
18-
configureMultiplatformNativeCompilation(target, compilation)
1917

2018
createNativeBenchmarkGenerateSourceTask(target)
2119

@@ -141,18 +139,3 @@ open class NativeBenchmarkExec : Exec() {
141139
var filter: String? = null
142140
*/
143141
}
144-
145-
private fun Project.configureMultiplatformNativeCompilation(
146-
target: NativeBenchmarkTarget,
147-
compilation: KotlinNativeCompilation
148-
) {
149-
val konanTarget = compilation.target.konanTarget
150-
151-
// Add runtime library as an implementation dependency to the specified compilation
152-
val runtime =
153-
dependencies.create("${BenchmarksPlugin.RUNTIME_DEPENDENCY_BASE}-${konanTarget.presetName}:${target.extension.version}")
154-
155-
compilation.dependencies {
156-
//implementation(runtime)
157-
}
158-
}

0 commit comments

Comments
 (0)