Skip to content

Commit 8d2afb6

Browse files
wldehAbduqodiri Qurbonzoda
authored andcommitted
Cleanup :plugin code for Legacy JS support
1 parent e7a353f commit 8d2afb6

File tree

3 files changed

+2
-72
lines changed

3 files changed

+2
-72
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ private fun Project.createJsBenchmarkGenerateSourceTask(
7373
group = BenchmarksPlugin.BENCHMARKS_TASK_GROUP
7474
description = "Generate JS source files for '${target.name}'"
7575
title = target.name
76-
ir = target.compilation is KotlinJsIrCompilation
7776
useBenchmarkJs = target.jsBenchmarksExecutor == JsBenchmarksExecutor.BenchmarkJs
7877
inputClassesDirs = compilationOutput.output.allOutputs
7978
inputDependencies = compilationOutput.compileDependencyFiles

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

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ open class JsSourceGeneratorTask
1717
@Input
1818
lateinit var title: String
1919

20-
@Input
21-
var ir: Boolean = false
22-
2320
@Input
2421
var useBenchmarkJs: Boolean = true
2522

@@ -48,7 +45,7 @@ open class JsSourceGeneratorTask
4845
}
4946

5047
private fun generateSources(lib: File) {
51-
val modules = load(lib)
48+
val modules = loadIr(lib, LockBasedStorageManager("Inspect"))
5249
modules.forEach { module ->
5350
val generator = SuiteSourceGenerator(
5451
title,
@@ -60,29 +57,11 @@ open class JsSourceGeneratorTask
6057
}
6158
}
6259

63-
private fun load(lib: File): List<ModuleDescriptor> {
64-
val storageManager = LockBasedStorageManager("Inspect")
65-
return if (ir) {
66-
loadIr(lib, storageManager)
67-
} else {
68-
loadLegacy(lib, storageManager)
69-
}
70-
}
71-
7260
private fun loadIr(lib: File, storageManager: StorageManager): List<ModuleDescriptor> {
73-
//skip processing of empty dirs (fail if not to do it)
61+
// skip processing of empty dirs (fails if not to do it)
7462
if (lib.listFiles() == null) return emptyList()
7563
val dependencies = inputDependencies.files.filterNot { it.extension == "js" }.toSet()
7664
val module = KlibResolver.JS.createModuleDescriptor(lib, dependencies, storageManager)
7765
return listOf(module)
7866
}
79-
80-
private fun loadLegacy(lib: File, storageManager: StorageManager): List<ModuleDescriptor> {
81-
val dependencies = inputDependencies.flatMap {
82-
loadJsDescriptors(it, storageManager)
83-
}
84-
return loadJsDescriptors(lib, storageManager, dependencies)
85-
}
8667
}
87-
88-

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

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)