Copying a non-code file into build context

In my jsoo-based project, there is a manifest.json file and an icons dir besides dune file.

project_dir
|- dune
|- manifest.json
|- icons
|- main.ml

How do I mark this json file and the icons dir as a dependency so that it is copied into the _build/default context?

_build
|- default
   |- manifest.json
   |- icons
   |- main.bc.js
   |- main.ml

Until now, my dune-project used (lang dune 2.9) due to which all artifacts in the project directory were copied to the build context automatically. But with (lang dune 3.0), that doesn’t happen anymore.

(install) stanza does not apply here, at least in my opinion, because I am not looking to install the output. Further parts of the pipeline packages the output into an archive later.

Hello,

The simplest way is to add these files as actual dependencies of the rule that needs them (eg the “packaging” rule).

Cheers,
Nicolas

3 Likes

I got it done with an alias:

(alias
  (name default)
  (deps 
    output.bc.js
    manifest.json 
    preferences.html 
    (source_tree icons)
    (glob_files *.sh)
    (glob_files *.md)))
1 Like