Repository navigation
feat: accept either .java or .kt files in sources jar - #7956
Merged
Merged
Conversation
Contributor
Pull request changelogAppAddedChangedDeprecatedRemovedFixedSecurityWebsiteAddedChangedDeprecatedRemovedFixedSecurityHostingAddedChangedDeprecatedRemovedFixedSecurity |
rahul05ranjan
left a comment
There was a problem hiding this comment.
Straightforward and correct — this is the only place enforcing the sources-jar rule (I checked for other .java guards), and the error message is updated to match, so a Kotlin developer uploading a sources jar stops getting a nonsense rejection telling them they need .java files.
Two small notes while you're in here:
- The check is case-sensitive, so
Foo.KT/Foo.Javawould still be rejected. Unlikely in practice from Gradle'ssourcesJaroutput, but if you're touching this line anyway, a lowercase extension list ([".java", ".kt"]compared against the lowercased name) would make it robust in one move. - If the intent is "this jar actually contains sources, not a repackaged binary", Groovy (
.groovy) and Scala (.scala) projects are still in the same boat Kotlin was. Not this PR's job to fix, just flagging the next likely report.
Either way, this is a real papercut fix — no concerns with merging as is.
aecsocket
approved these changes
Oct 21, 2026
Contributor
Author
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 14 minutes 36 seconds in the queue, including 14 minutes 4 seconds running CI. Required conditions to merge
|
6 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some people write their mod in kotlin so jar can contain just
.ktfiles