Skip to content

Commit 3687b54

Browse files
committed
switch "workflow-runtime's "-Xfriend-paths=__" compiler argument to an associated build
"-Xfriend-paths=____" no longer works for accessing internal declarations from other compilation units. The replacement for this is to use `KotlinCompilation.associateWith(...)`. https://youtrack.jetbrains.com/issue/KTIJ-7662/IDE-support-internal-visibility-introduced-by-associated-compilations
1 parent 3566213 commit 3687b54

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

workflow-runtime/build.gradle.kts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import com.squareup.workflow1.buildsrc.iosWithSimulatorArm64
22
import kotlinx.benchmark.gradle.JvmBenchmarkTarget
3-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation
44

55
plugins {
66
`kotlin-multiplatform`
@@ -13,10 +13,14 @@ kotlin {
1313
jvm {
1414
compilations {
1515
val main by getting
16-
val workflowNode by creating {
16+
17+
create("workflowNode") {
18+
val workflowNodeCompilation: KotlinJvmCompilation = this
1719
kotlinOptions {
18-
val compileKotlinJvm: KotlinCompile by tasks
19-
freeCompilerArgs += "-Xfriend-paths=${compileKotlinJvm.destinationDirectory}"
20+
// Associating compilations allows us to access declarations with `internal` visibility.
21+
// It's the new version of the "-Xfriend-paths=___" compiler argument.
22+
// https://youtrack.jetbrains.com/issue/KTIJ-7662/IDE-support-internal-visibility-introduced-by-associated-compilations
23+
workflowNodeCompilation.associateWith(main)
2024
}
2125
defaultSourceSet {
2226
dependencies {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
:workflow-core
2+
com.squareup.okio:okio-jvm:3.0.0
3+
com.squareup.okio:okio:3.0.0
14
net.sf.jopt-simple:jopt-simple:5.0.4
25
org.apache.commons:commons-math3:3.2
6+
org.jetbrains.kotlin:kotlin-bom:1.6.21
37
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
48
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
59
org.jetbrains.kotlin:kotlin-stdlib:1.6.21
610
org.jetbrains.kotlinx:kotlinx-benchmark-runtime-jvm:0.4.2
711
org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.4.2
12+
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4
13+
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4
14+
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4
815
org.jetbrains:annotations:13.0
916
org.openjdk.jmh:jmh-core:1.34

0 commit comments

Comments
 (0)