- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 422
 
Compat Kotlin Multiplatform plugin #1280
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
Conversation
// Conflicts: // src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt
da479ea    to
    c7f8fef      
    Compare
  
    12f42f4    to
    b0f310f      
    Compare
  
    b0f310f    to
    0ea49ac      
    Compare
  
    This reverts commit 48a84b4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Co-authored-by: Copilot <[email protected]>
| override fun apply(project: Project) { | ||
| with(project) { | ||
| val kmpExtension = extensions.getByType(KotlinMultiplatformExtension::class.java) | ||
| val kotlinJvmMain = kmpExtension.jvm().compilations.named("main") | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't call jvm(). Because this method declares a jvm target in KMP project. And users should do that explicitly.
More over, they can specify a custom name for their jvm target.
The correct API is to lazily iterate over targets collection. And check for KotlinJvmTarget instance.
kmpExtension.targets.configureEach { target ->
   if (target is KotlinJvmTarget) // do configuration here
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I didn't know how to defer this. Thanks for the reporting. Creating a new issue in #1377.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this will also be useful for #1333.
Uh oh!
There was an error while loading. Please reload this page.