Skip to content

license-gather-plugin: Fixed MANIFEST check is always skipped #48

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

Merged
merged 2 commits into from
Jan 4, 2022

Conversation

DreierF
Copy link
Contributor

@DreierF DreierF commented Jan 3, 2022

Found this while debugging to understand how the plugin actually works. The endsWith extension function does not what it seems to do at first sight

/**
 * Determines whether this file belongs to the same root as [other]
 * and ends with all components of [other] in the same order.
 * So if [other] has N components, last N components of `this` must be the same as in [other].
 * For relative [other], `this` can belong to any root.
 *
 * @return `true` if this path ends with [other] path, `false` otherwise.
 */
public fun File.endsWith(other: String): Boolean = endsWith(File(other))

and therefore always evaluates to false

@DreierF DreierF force-pushed the manifest_check_skipped branch from 4ee95e9 to d400938 Compare January 3, 2022 18:19
@@ -159,6 +169,18 @@ open class EnumGeneratorTask @Inject constructor(objectFactory: ObjectFactory) :
.addStatement("return idToInstance[id]")
.build()
)
.addFunction(
FunSpec.builder("fromUri")
.addParameter("uri", String::class)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be URI:class for consistency. I'm not sure yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't really judge what implications that would have

Comment on lines -487 to +492
if (!file.endsWith(".jar")) {
if (file.extension != "jar") {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice catch. It might be worth filing an IDEA ticket to https://youtrack.jetbrains.com

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DreierF DreierF requested a review from vlsi January 4, 2022 15:56
Previuosly, Bundle-License attribute was unexpectedly ignored
@vlsi vlsi force-pushed the manifest_check_skipped branch from b5ca400 to 6757ea8 Compare January 4, 2022 18:25
@vlsi vlsi force-pushed the manifest_check_skipped branch from 6757ea8 to 1620e01 Compare January 4, 2022 18:29
@vlsi vlsi merged commit 1620e01 into vlsi:master Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants