Skip to content

Commit

Permalink
switch "workflow-runtime's "-Xfriend-paths=__" compiler argument to…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
RBusarow committed Sep 21, 2022
1 parent 3566213 commit 3687b54
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 8 additions & 4 deletions workflow-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import com.squareup.workflow1.buildsrc.iosWithSimulatorArm64
import kotlinx.benchmark.gradle.JvmBenchmarkTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation

plugins {
`kotlin-multiplatform`
Expand All @@ -13,10 +13,14 @@ kotlin {
jvm {
compilations {
val main by getting
val workflowNode by creating {

create("workflowNode") {
val workflowNodeCompilation: KotlinJvmCompilation = this
kotlinOptions {
val compileKotlinJvm: KotlinCompile by tasks
freeCompilerArgs += "-Xfriend-paths=${compileKotlinJvm.destinationDirectory}"
// Associating compilations allows us to access declarations with `internal` visibility.
// It's the new version of the "-Xfriend-paths=___" compiler argument.
// https://youtrack.jetbrains.com/issue/KTIJ-7662/IDE-support-internal-visibility-introduced-by-associated-compilations
workflowNodeCompilation.associateWith(main)
}
defaultSourceSet {
dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
:workflow-core
com.squareup.okio:okio-jvm:3.0.0
com.squareup.okio:okio:3.0.0
net.sf.jopt-simple:jopt-simple:5.0.4
org.apache.commons:commons-math3:3.2
org.jetbrains.kotlin:kotlin-bom:1.6.21
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
org.jetbrains.kotlin:kotlin-stdlib:1.6.21
org.jetbrains.kotlinx:kotlinx-benchmark-runtime-jvm:0.4.2
org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.4.2
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4
org.jetbrains:annotations:13.0
org.openjdk.jmh:jmh-core:1.34

0 comments on commit 3687b54

Please sign in to comment.