-
Notifications
You must be signed in to change notification settings - Fork 61
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
Apply kotlinx-atomicfu plugin by id #443
Conversation
dd9c647
to
7f5f64c
Compare
} | ||
|
||
// NOTE: `kotlinx-atomicfu.properties` file appears in the artifact twice, when publishing kotlin-atomicfu plugin using gradlePlugin{} block above | ||
tasks.withType<Copy>().named("processResources") { |
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'm not sure, if this is the best way to resolve the duplicate conflict 🤔:
Execution failed for task ':atomicfu-gradle-plugin:processResources'.
> Entry META-INF/gradle-plugins/kotlinx-atomicfu.properties is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/8.7/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.
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.
https://docs.gradle.org/current/userguide/java_gradle_plugin.html#ex-using-the-gradleplugin-block
Check the text below the example.
You should be able to delete the /atomicfu-gradle-plugin/src/main/resources/META-INF directory instead. As the gradlePlugin block is creating the files itself.
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.
Oh, cool, thank you! That solves the problem)
…nerated by gradlePlugin{} block
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.
It's usually a good idea not to apply Kotlin/JVM in Gradle plugins. Try this instead:
plugins {
// id("kotlin-jvm-conventions")
id("java-gradle-plugin")
id("publish-conventions")
id("common-conventions")
id("kotlin-base-conventions")
}
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.
@dkrasnoff We could look at making this neater as part of #421, e.g. create a kotlin-gradle-plugin
convention.
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.
Hm, without kotlin("jvm")
I get an error: Extension of type 'KotlinProjectExtension' does not exist.
And because of that I can not apply kotlin-base-conventions
plugin.
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.
Ahh yes, that makes sense. So yes, remove kotlin-base-conventions
from the Atomicfu Gradle Plugin.
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.
iirc kotlin-base-conventions
has been reworked in @dkrasnoff's branch.
Fixes #56