hey. Speaking of cache. Is there any way built into boot to clear the cache? Instead of doing rm -rf ./boot/cache/
Yes. We have a package we release as a snapshot, and from what we can understand the cache is not overwritten even if the snapshot is updated in the .m2 directory. So when we try to build the project it will always look at the first version of the package it downloaded. Say if you run the project on a fresh computer, then it will use the latest Snapshot. But if you release a new version of that package in the same snapshot version, you will update to the newest version of that package inside the .m2 directory, but the .boot/cache/tmp/ or .boot/cache/cache/fileset will not be overwritten with the new version.
So we have found out that if you clear the tmp and fileset you force boot to reload our package to the latest version.
Maven only refreshes snapshots in your .m2 every 24hrs IIRC. Could that be the issue? You can check with boot show -U I think
Do you find files related to your snapshot release in .boot/cache dirs? Have you tried more localized clearing of that cache to find out which files need to be deleted for the desired snapshot to be taken into account?
Yes, but trying to navigate the cache is a bit tricky. I've found that just deleting the tmp and fileset folders are enough to force boot to read our latest snapshot. When we update a package and republish it, boot gives an update before running the project that it's downloading a new version of that package, and overwriting the old version. I have tried boot show -U but it updates every snapshot in the project have, and it's a bit too much and I would prefer if it was possible to update only one snapshot at the time. I don't know if this is noteworthy but the snapshot package we're using is mostly containing assets like css and images.
Does boot show -U fix your problem besides the fact that it updates all Snapshots?
I can try tomorrow.
Boot show -U took 1h10m to run. and did not update the snapshot.
oh, that’s long 😮
it might be because i cleared my chache before, and the project has a lot of dependencies.
but running again after took only 2 minutes.
if I have (comp task1 ... task2)
and I want to have a side effect (e.g println) happen on the dots, what to write? with-pass-thru?
@borkdude that should work, i think i've done that before
well, sort of: https://github.com/daveyarwood/music-theory/blob/1930872/build.boot#L30-L51
i bet with-pass-thru
would work too. i may not have heard of with-pass-thru
back when i wrote that code
I think so yes. but how about an anonymous task on the dots?
e.g. this works:
(deftask foo []
(with-pass-thru [_]
(println “foo”)))
(deftask bar []
(with-pass-thru [_]
(println “bar”)))
(deftask baz []
(comp (foo) (bar)))
i'm pretty sure you can do (comp (foo) (with-pass-thru [_] (println "bar")) (baz))
oh yes
I want to make a task that delegates to other tasks, so it should not check command line args, but just pass them to another task. How?
(deftask metatask []
(fn [next]
(fn [fs]
(if some-condition ((next some-task) fs) (next fs)))))
or maybe ((some-task next) fs)
depending on the order you want
@alandipert when I pass command line args to metatask, then I get an error about unknown option this and that?
are you doing something like (apply metatask *opts*)
?
Say I have task A in build.boot and task B in some other namespace. I want to pass thru the command line options from A to B
without A checking them
so I don’t have to redefine the options
But I may do it another way and just make the task in B a normal function
so never mind 🙂
well, it would be still be useful actually, so if there’s a way
oh, i'm not sure there's a way to do that. avoid checking
might be possible by manipulating the metadata on task function you make - enough metadata for boot ro recognize it as a task, but not enough for it to want to validate any options
I don’t think there is but you also shouldn’t have to do this... could you give some context why you want to do this?