-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Allow .module files to be uploaded #843
Conversation
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.
Thanks for implementing this! It looks good, I have just one point for discussion.
src/clojars/routes/repo.clj
Outdated
(defn find-module [dir] | ||
(->> dir | ||
file-seq | ||
(filter module?) | ||
first)) |
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.
Minor: you could use clojars.util/filter-some
here instead:
(defn find-module [dir] | |
(->> dir | |
file-seq | |
(filter module?) | |
first)) | |
(defn find-module [dir] | |
(util/filter-some module? (file-seq dir))) |
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.
Done! Also added a new commit to do the same in find-pom for consistency. I can drop that commit, if you'd prefer not to have that function changed.
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.
Thanks for cleaning up that usage as well! We'll keep the commit.
Gradle module files [1] are Gradle's alternative to POM files. They have a similar goal of defining the primary component group/artifact/version that was published along with its dependencies. Additionally they allow declaring variants of the main component that may have different dependencies or capabilities. We're doing very minimal validation, parsing it as JSON and validating the top-level component group/module/version the upload path (as is already done for POM files). [1] https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html Fixes #835
For consistency with the find-module function.
I merged and deployed this as part of Clojars 177. Let me know if you see any issues with it, and thanks for the contribution! |
Just did a quick test and everything works great! I appreciate the quick reviews and feedback. |
Gradle module files [1] are Gradle's alternative to POM files. They have a similar goal of defining the primary component
group/artifact/version that was published along with its dependencies. Additionally they allow declaring variants of the main
component that may have different dependencies or capabilities.
We're doing very minimal validation, parsing it as JSON and validating the top-level component group/module/version the upload path (as is already done for POM files).
It does look like Gradle uploads
maven-metadata.xml
last, so I believe this should fit in with how the existing validation works. I think this is the line in Gradle's code that implies the order.[1] https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html
Fixes #835
This was my first crack at it. Open to any feedback or changes that you'd like to see.