Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed absolute path cache miss in workflow-testing. #1115

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions workflow-testing/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
@file:Suppress("SuspiciousCollectionReassignment")

import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType

plugins {
id("java-library")
id("kotlin-jvm")
id("published")
}

val friendPathsConfiguration by configurations.creating {
isCanBeConsumed = false
isCanBeResolved = true
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY))
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))
attribute(
TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,
objects.named(TargetJvmEnvironment.STANDARD_JVM)
)
attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm)
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
// Configure friend paths so the testing module can access internal declarations from the
// following modules. Note that the IntelliJ Kotlin plugin won't be aware of this configuration
// so it will still complain about internal accesses across modules, but they will actually
// compile just fine. See https://youtrack.jetbrains.com/issue/KT-20760.
val friendModule = project(":workflow-core")

// Pointing to jar instead of classes dir since :workflow-core is a multiplatform project.
val jarPath = friendModule.configurations["jvmRuntimeElements"].artifacts.first().file.path
freeCompilerArgs += "-Xfriend-paths=$jarPath"
friendPaths.from(friendPathsConfiguration)
}
}

dependencies {
api(libs.kotlin.jdk7)
api(libs.kotlinx.coroutines.test)

api(project(":workflow-core"))
friendPathsConfiguration(project(":workflow-core"))
api(project(":workflow-runtime"))

compileOnly(libs.jetbrains.annotations)
Expand Down
Loading