Skip to content

Commit 9a082f1

Browse files
committed
Update to Kotlin 1.3.50 RC and get rid of CLI lib dependency
1 parent a6935a4 commit 9a082f1

File tree

22 files changed

+176
-187
lines changed

22 files changed

+176
-187
lines changed

examples/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ subprojects {
1212
mavenCentral()
1313
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
1414
maven { url 'https://dl.bintray.com/kotlin/kotlin-dev' }
15-
maven { url "https://dl.bintray.com/orangy/maven" } // for kotlinx.cli
1615
// maven { url "$rootProject.projectDir/../kotlin-libraries-infra/build/maven" }
1716
}
1817
}

examples/kotlin-kts/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import org.jetbrains.kotlin.gradle.tasks.*
77
plugins {
88
java
99
kotlin("jvm")
10-
kotlin("plugin.allopen") version "1.3.41"
10+
kotlin("plugin.allopen") version "1.3.50-release-105"
1111
id("kotlinx.benchmark") version "0.2.0"
1212
}
1313

examples/kotlin-multiplatform/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66

77
plugins {
88
id 'org.jetbrains.kotlin.multiplatform'
9-
id 'org.jetbrains.kotlin.plugin.allopen' version "1.3.41"
9+
id 'org.jetbrains.kotlin.plugin.allopen' version "1.3.50-release-105"
1010
id 'kotlinx.benchmark' version "0.2.0"
1111
}
1212

@@ -31,7 +31,9 @@ kotlin {
3131
}
3232

3333
js {
34-
nodejs()
34+
nodejs {
35+
36+
}
3537
}
3638

3739
sourceSets.all {

examples/kotlin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id 'java'
33
id 'org.jetbrains.kotlin.jvm'
4-
id 'org.jetbrains.kotlin.plugin.allopen' version "1.3.41"
4+
id 'org.jetbrains.kotlin.plugin.allopen' version "1.3.50-release-105"
55
id 'kotlinx.benchmark' version '0.2.0'
66
}
77

gradle.properties

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ group = org.jetbrains.kotlinx
33
version = 0.2.0
44

55
kotlin.code.style=official
6-
kotlin_version=1.3.41
6+
kotlin_version=1.3.50-release-105
77
jmhVersion=1.21
88
junit_version=4.12
99

10-
infra_version=0.1.0-dev-47
11-
cli_version=0.1.0-dev-5
10+
infra_version=0.1.0-dev-49
1211

1312
node_version = 8.9.4
1413
npm_version = 5.7.1

plugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ buildscript {
1313

1414
plugins {
1515
id 'java-gradle-plugin'
16-
id 'org.jetbrains.kotlin.jvm' version "1.3.41"
16+
id 'org.jetbrains.kotlin.jvm' version "1.3.50-release-105"
1717
}
1818

1919
apply plugin: 'kotlinx.team.infra'

plugin/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ group = org.jetbrains.kotlinx
77
# Put link to your OSS repository. Bintray requires this to be filled for free OpenSource tiers.
88
vcs=https://github.com/kotlin/kotlinx-benchmark
99

10-
kotlin_version=1.3.41
10+
kotlin_version=1.3.50-release-105
1111
jmhVersion=1.21
12-
infra_version=0.1.0-dev-47
12+
infra_version=0.1.0-dev-49
1313

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class BenchmarksPlugin : Plugin<Project> {
4040
if (kotlinClass != null) {
4141
plugins.findPlugin(kotlinClass)?.run {
4242
logger.info("Detected Kotlin plugin version '$kotlinPluginVersion'")
43-
if (VersionNumber.parse(kotlinPluginVersion) < VersionNumber(1, 3, 40, null))
43+
if (VersionNumber.parse(kotlinPluginVersion) < VersionNumber(1, 3, 50, null))
4444
logger.error("JetBrains Gradle Benchmarks plugin requires Kotlin version 1.3.40 or higher")
4545
}
4646
}

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

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ fun Project.createJsBenchmarkExecTask(
1111
target: JsBenchmarkTarget,
1212
compilation: KotlinJsCompilation
1313
) {
14-
task<JsBenchmarkExec>(
15-
"${target.name}${config.capitalizedName()}${BenchmarksPlugin.BENCHMARK_EXEC_SUFFIX}",
16-
depends = config.prefixName(RUN_BENCHMARKS_TASKNAME)
17-
) {
14+
val taskName = "${target.name}${config.capitalizedName()}${BenchmarksPlugin.BENCHMARK_EXEC_SUFFIX}"
15+
val task = NodeJsExec.create(compilation, taskName) {
1816
dependsOn(compilation.runtimeDependencyFiles)
1917

2018
group = BenchmarksPlugin.BENCHMARKS_TASK_GROUP
@@ -30,40 +28,17 @@ fun Project.createJsBenchmarkExecTask(
3028
workingDir = compilation.npmProject.dir
3129

3230
onlyIf { executableFile.exists() }
33-
34-
args("-n", target.name)
35-
args("-r", reportFile.toString())
36-
config.iterations?.let { args("-i", it.toString()) }
37-
config.warmups?.let { args("-w", it.toString()) }
38-
config.iterationTime?.let { args("-it", it.toString()) }
39-
config.iterationTimeUnit?.let { args("-itu", it) }
40-
config.outputTimeUnit?.let { args("-otu", it) }
41-
config.mode?.let { args("-m", it) }
42-
43-
config.includes.forEach {
44-
args("-I", it)
45-
}
46-
config.excludes.forEach {
47-
args("-E", it)
48-
}
49-
config.params.forEach { (param, values) ->
50-
values.forEach { value -> args("-P", "\"$param=$value\"") }
51-
}
31+
5232

5333
doFirst {
5434
val ideaActive = (extensions.extraProperties.get("idea.internal.test") as? String)?.toBoolean() ?: false
55-
args("-t", if (ideaActive) "xml" else "text")
35+
args(writeParameters(target.name, reportFile, if (ideaActive) "xml" else "text", config))
5636
reportsDir.mkdirs()
5737
logger.lifecycle("Running '${config.name}' benchmarks for '${target.name}'")
5838
}
5939
}
60-
}
6140

62-
open class JsBenchmarkExec : NodeJsExec() {
63-
/*
64-
@Option(option = "filter", description = "Configures the filter for benchmarks to run.")
65-
var filter: String? = null
66-
*/
41+
tasks.getByName(config.prefixName(RUN_BENCHMARKS_TASKNAME)).dependsOn(task.getTaskOrProvider())
6742
}
6843

6944

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.gradle.api.*
44
import org.gradle.api.file.*
55
import org.gradle.api.tasks.*
66
import org.gradle.workers.*
7+
import org.jetbrains.kotlin.builtins.*
78
import org.jetbrains.kotlin.config.*
89
import org.jetbrains.kotlin.descriptors.*
910
import org.jetbrains.kotlin.descriptors.impl.*
@@ -80,6 +81,7 @@ open class JsSourceGeneratorTask
8081
dependencies: List<ModuleDescriptorImpl> = listOf()
8182
): List<ModuleDescriptorImpl> {
8283
val modules = KotlinJavascriptMetadataUtils.loadMetadata(lib)
84+
val builtIns = org.jetbrains.kotlin.js.resolve.JsPlatformAnalyzerServices.builtIns
8385
return modules.map { metadata ->
8486
val skipCheck = languageVersionSettings.getFlag(AnalysisFlags.skipMetadataVersionCheck)
8587
assert(metadata.version.isCompatible() || skipCheck) {
@@ -89,7 +91,7 @@ open class JsSourceGeneratorTask
8991
val module = ModuleDescriptorImpl(
9092
Name.special("<" + metadata.moduleName + ">"),
9193
storageManager,
92-
JsPlatform.builtIns
94+
builtIns
9395
)
9496
val (header, body) = KotlinJavascriptSerializationUtil.readModuleAsProto(
9597
metadata.body,
@@ -104,7 +106,7 @@ open class JsSourceGeneratorTask
104106
CompilerDeserializationConfiguration(languageVersionSettings),
105107
LookupTracker.DO_NOTHING
106108
)
107-
module.setDependencies(listOf(module, JsPlatform.builtIns.builtInsModule) + dependencies)
109+
module.setDependencies(listOf(module, builtIns.builtInsModule) + dependencies)
108110
module.initialize(provider)
109111
module
110112
}

0 commit comments

Comments
 (0)