File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -75,20 +75,23 @@ Set up a separate benchmark source set by following these simple steps:
75
75
}
76
76
```
77
77
78
- 2. **Propagate Dependencies **
78
+ 2. **Associate compilations **
79
79
80
- Next, propagate dependencies and output from the ` main` source set to your `benchmark` source set.
81
- This ensures the ` benchmark` source set has access to classes and resources from the `main` source set.
80
+ We then associate the benchmark compilation with the main compilation. This will allow the
81
+ benchmark compilation to access internal APIs from ' main ' as well as propagate dependencies
82
82
83
83
```kotlin
84
84
// build.gradle.kts
85
- dependencies {
86
- add("benchmarkImplementation", sourceSets.main.get().output + sourceSets.main.get().runtimeClasspath)
85
+ kotlin {
86
+ target {
87
+ compilations.getByName("benchmark")
88
+ .associateWith(compilations.getByName("main"))
89
+ }
87
90
}
88
91
```
89
92
90
- You can also add output and `compileClasspath` from `sourceSets. test` in the same way
91
- if you wish to reuse some of the test infrastructure .
93
+ You can associate the benchmark compilation with the " test" compilation as well if you would like
94
+ to re-use test-code in benchmarks .
92
95
93
96
3. **Register Benchmark Source Set**
94
97
You can’t perform that action at this time.
0 commit comments