Closed ghost closed 6 years ago
Can you give me a robust algorithm to detect a jbuilder project ?
Checking if the project contains at least one jbuild file.
Isn't there something more evident ? Tools that start scanning your whole hard drive because you happen to invoke them at the wrong place are not very user friendly and I don't want topkg
to be one of these.
Unfortunately no. Maybe we need some toplevel file to mark the root of projects, I guess we can look at this when we rename jbuilder. Looking for a jbuild
file at depth 0, 1 and 2 without following symlinks should be enough for most projects, is that acceptable?
Yes seems ok.
I'm not up-to-date with what topkg-jbuilder.auto
does but wouldn't the easiest be to upstream what this does in topkg
itself and then simply invoke this whenever a jbuilder is detected and it lacks a pkg/pkg.ml
files ?
That would be better indeed! /cc @samoht who is now the maintainer of topkg-jbuilder
.
yea upstreaming stuff in topkg
would definitely makes thing simpler. The code is there: https://github.com/samoht/topkg-jbuilder/blob/master/src/topkg_jbuilder.ml
It's a bit hackish (especially the doc
command) but if we put that in topkg-care
we could probably remove all the unix stuff and use bos. @dbuenzli where's the best place to copy this in topkg
?
If I understand correctly jbuilder
users are only interested in the topkg-care
aspect (i.e. the topkg
tool) so I guess simply into topkg_care_jbuilder.ml
and as a submodule in the Topkg_care
API.
@samoht is working on brining the topkg
release experience to dune
via a dedicated tool (https://github.com/samoht/dune-release) so I'm closing this.
Pretty much all jbuilder projects use the same
pkg/pkg.ml
file, which is:Can topkg automatically use this configuration when it detects a jbuilder project and there is no
pkg/pkg.ml
? This will avoid having to write the same file everywhere.