This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-16
Channels
- # announcements (33)
- # atom-editor (1)
- # aws (21)
- # babashka (174)
- # babashka-sci-dev (2)
- # beginners (59)
- # calva (4)
- # chlorine-clover (9)
- # clj-kondo (51)
- # clojars (7)
- # clojure (86)
- # clojure-czech (4)
- # clojure-europe (21)
- # clojure-france (6)
- # clojure-nl (1)
- # clojure-uk (2)
- # conjure (7)
- # core-async (3)
- # core-logic (3)
- # cursive (10)
- # data-science (8)
- # datalevin (14)
- # datomic (12)
- # events (1)
- # fulcro (5)
- # graalvm (10)
- # gratitude (3)
- # honeysql (3)
- # hyperfiddle (3)
- # introduce-yourself (4)
- # joyride (3)
- # leiningen (3)
- # malli (13)
- # minecraft (15)
- # music (1)
- # off-topic (40)
- # pathom (16)
- # polylith (28)
- # portal (25)
- # rdf (15)
- # remote-jobs (3)
- # shadow-cljs (23)
- # specter (1)
- # sql (5)
- # tools-deps (25)
- # xtdb (31)
Did a little exploration/prototype to see how hard it would be to get lein to add arbitrary files (specifically FUNDING.yml
) into the deployed JAR, read out those files in the upload process from the JAR in Clojars and persist the data to the db. Turns out, wasn't that complicated. Here is a preliminary screenshot. Unpolished code as I just wanted to see how hard it would be in reality.
This is great! I like this idea. I think the proper place to put FUNDING.yml files is under META-INF. lein already puts the project.clj, etc there:
$ jar tvf ring-1.9.2.jar
217 Sat Mar 20 17:31:08 EDT 2021 META-INF/MANIFEST.MF
2619 Sat Mar 20 17:31:08 EDT 2021 META-INF/maven/ring/ring/pom.xml
998 Sat Mar 20 17:31:08 EDT 2021 META-INF/leiningen/ring/ring/project.clj
2119 Sat Mar 20 17:31:08 EDT 2021 META-INF/leiningen/ring/ring/README.md
1105 Sat Mar 20 17:31:08 EDT 2021 META-INF/leiningen/ring/ring/LICENSE
0 Sat Mar 20 17:31:04 EDT 2021 META-INF/
0 Sat Mar 20 17:31:04 EDT 2021 META-INF/maven/
0 Sat Mar 20 17:31:04 EDT 2021 META-INF/maven/ring/
0 Sat Mar 20 17:31:04 EDT 2021 META-INF/maven/ring/ring/
93 Sat Mar 20 17:31:04 EDT 2021 META-INF/maven/ring/ring/pom.properties
I think it would be straightforward to expand lein here: https://github.com/technomancy/leiningen/blob/master/src/leiningen/jar.clj#L194> I think the proper place to put FUNDING.yml files is under META-INF. lein already puts the project.clj, etc there:
Yeah, probably. My thinking was firsthand that it would be great to capture everyone who is already using FUNDING.yml without them having to change anything. Current script actually just scans the entire JAR file for a FUNDING.yml, so doesn't really matter where it ends up.
The way I hacked it into lein was with the filespecs
key in project.clj
, which allows you to put arbitrary files into the final artifact. Unfortunately, it doesn't seem to expose any control on where the file ends up in the JAR file, just puts it at the root level. But the following snippet does the trick:
:filespecs [{:type :path :path "FUNDING.yml"}
{:type :path :path ".github/FUNDING.yml"}]
The better way is obviously the way you're describing, to have it work without changing project.clj
at all, but we can suggest a patch to lein at a later point, after deploying the Clojars changesUnfortunate side-effect of requiring the FUNDING.yml to be in the JAR file is that people are gonna have to release a new version in order for it to show up at Clojars 😕