2
2
[ ![ GitHub license] ( https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat )] ( https://www.apache.org/licenses/LICENSE-2.0 )
3
3
[ ![ Download] ( https://api.bintray.com/packages/kotlin/kotlinx/kotlinx.benchmark/images/download.svg ) ] ( https://bintray.com/kotlin/kotlinx/kotlinx.benchmark/_latestVersion )
4
4
5
+
6
+ > ** _ NOTE:_ **   ; The latest version of the library changes how the plugin and runtime library dependencies are declared:
7
+ > * The library runtime is published to Maven Central and no longer published to Bintray.
8
+ > * The Gradle plugin is published to Gradle Plugin Portal
9
+ > * The Gradle plugin id has changed to ` org.jetbrains.kotlinx.benchmark `
10
+ > * The library runtime artifact id has changed to ` kotlinx-benchmark-runtime `
11
+
12
+
5
13
** kotlinx.benchmark** is a toolkit for running benchmarks for multiplatform code written in Kotlin
6
14
and running on the next supported targets: JVM, JavaScript.
7
15
@@ -14,45 +22,18 @@ the hoods to run benchmarks on JVM.
14
22
15
23
# Requirements
16
24
17
- Gradle 6.0 or newer
25
+ Gradle 6.8 or newer
18
26
19
27
Kotlin 1.4.30 or newer
20
28
21
29
# Gradle plugin
22
30
23
- Add repository in ` settings.gradle ` to enable bintray repository for plugin lookup
24
-
25
- ``` groovy
26
- pluginManagement {
27
- repositories {
28
- maven { url 'https://dl.bintray.com/kotlin/kotlinx' }
29
- gradlePluginPortal()
30
- }
31
- }
32
- ```
33
-
34
31
Use plugin in ` build.gradle ` :
35
32
36
33
``` groovy
37
34
plugins {
38
- id 'kotlinx.benchmark' version "0.2.0-dev-20"
39
- }
40
- ```
41
-
42
- Alternatively, you can use build script dependencies and "apply plugin" syntax:
43
-
44
- ``` groovy
45
- buildscript {
46
- repositories {
47
- …
48
- maven { url 'https://dl.bintray.com/kotlin/kotlinx' }
49
- }
50
- dependencies {
51
- classpath "org.jetbrains.kotlinx:kotlinx.benchmark.gradle:0.2.0-dev-20"
52
- }
35
+ id 'org.jetbrains.kotlinx.benchmark' version '0.3.0'
53
36
}
54
-
55
- apply plugin: 'kotlinx.benchmark'
56
37
```
57
38
58
39
For Kotlin/JS specify building ` nodejs ` flavour:
@@ -89,30 +70,28 @@ then you don't have to make benchmark classes and methods `open`.
89
70
90
71
# Runtime Library
91
72
92
- You need a runtime library with annotations and code that will run benchmarks on JavaScript and Native platforms .
73
+ You need a runtime library with annotations and code that will run benchmarks.
93
74
75
+ Enable Maven Central for dependencies lookup:
94
76
``` groovy
95
77
repositories {
96
- maven { url 'https://dl.bintray.com/kotlin/kotlinx' }
78
+ mavenCentral()
97
79
}
80
+ ```
98
81
82
+ Add the runtime to dependencies of the platform source set, e.g.:
83
+ ```
99
84
kotlin {
100
85
sourceSets {
101
86
commonMain {
102
87
dependencies {
103
- implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.2.0-dev-20 ")
88
+ implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.3.0 ")
104
89
}
105
90
}
106
91
}
107
92
}
108
93
```
109
94
110
- To use the library in a JVM-only project add the platform to the artifact name, e.g.:
111
-
112
- ``` groovy
113
- implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime-jvm:0.2.0-dev-20")
114
- ```
115
-
116
95
# Configuration
117
96
118
97
In a ` build.gradle ` file create ` benchmark ` section, and inside it add a ` targets ` section.
0 commit comments