Hi,
What is the intended purpose of the :static-files component-type in ASDF? I see a couple examples of their use in the ASDF manual, but didn't see an explanation or real example of how to use them downstream from including them in the defsystem form in the .asd file.
Presumably they can be used for README, license, example files, and other resources which go with a system but are not Lisp source files to be compiled and loaded with the system.
If so, then what are the supported/expected operations with static-files? For example, is there a way to query a system for files of type :static-file, so that you can do something with them (e.g. copy them to a distribution directory)?
Best Regards,
Dave
P.S. my apologies if this has been discussed in this list before
Dave Cooper wrote:
Hi,
What is the intended purpose of the :static-files component-type in ASDF? I see a couple examples of their use in the ASDF manual, but didn't see an explanation or real example of how to use them downstream from including them in the defsystem form in the .asd file.
Presumably they can be used for README, license, example files, and other resources which go with a system but are not Lisp source files to be compiled and loaded with the system.
If so, then what are the supported/expected operations with static-files? For example, is there a way to query a system for files of type :static-file, so that you can do something with them (e.g. copy them to a distribution directory)?
You are right that the intended purpose of static-files is to support system introspection and human readers.
I have also used them for web content in lisp-powered web applications.
Yes, you can query for all the static files:
CL-USER> (remove-if-not #'(lambda (x) (typep x 'asdf:static-file)) (asdf:component-children (asdf:find-system "alexandria"))) (#<ASDF/COMPONENT:STATIC-FILE "alexandria" "LICENCE"> #<ASDF/COMPONENT:STATIC-FILE "alexandria" "tests.lisp">) CL-USER>
Cheers, r
Hi Dave,
Thanks for asking! Many systems seem to depend on files existing on the disk system "near" the .asd file. However, systems shouldn't depend on that, as e.g. ABCL implements the asdf :bundle-op operation, which compiles an entire system into one monolithic FASL file (which can then be included in a JAR). Back when I did the implementation for :bundle-op I remember people objecting (it being an excercise in futility) because too many systems depend on the previously described behaviour.
Herewith, I'd like system authors to take note and use the :static-file declaration so systems like ECL and ABCL for which it makes sense to compile monolithic bundles for general distribution can include those resources in the bundle.
Regards,
Erik.
On Tue, May 26, 2015 at 6:29 PM, Dave Cooper david.cooper@genworks.com wrote:
Hi,
What is the intended purpose of the :static-files component-type in ASDF? I see a couple examples of their use in the ASDF manual, but didn't see an explanation or real example of how to use them downstream from including them in the defsystem form in the .asd file.
Presumably they can be used for README, license, example files, and other resources which go with a system but are not Lisp source files to be compiled and loaded with the system.
If so, then what are the supported/expected operations with static-files? For example, is there a way to query a system for files of type :static-file, so that you can do something with them (e.g. copy them to a distribution directory)?
Best Regards,
Dave
P.S. my apologies if this has been discussed in this list before
-- My Best,
Dave Cooper, Genworks Support david.cooper@genworks.com, dave.genworks.com(skype) +1 248-330-2979