Projects
Compatibility information
The project feature has been introduced in version 7 of arara and is still experimental. It will not vanish in the next versions but it might receive major changes based on user feedback. If you have certain use cases or ideas for projects, please open an issue in our repo.

Instead of passing one or multiple files with directives to the arara command-line you may pass one .lua file (the exact extension is important) with a project specification. arara will process the Lua script and then execute all the projects as specified in the Lua script.

Important remark: If arara encounters a single Lua file as its argument, it tries to parse it as a project. If it fails for any reason (e.g. malformed Lua), it will treat the Lua file as regular input file and scan it for directives which will fail if you did not define a Lua input file type. However, that allows to continue using Lua files as input files to arara.

Rationale

Projects have been identified as the sweet spot between arara's already make-like directive system and actual external specification of directives and dependencies. Though currently unable to express dependencies between single files, arara is able to handle dependencies between projects.

We have built projects with the following use cases in mind:

However, the basic idea is to be explicit about what belongs to a project and what does not. In that sense, a declarative notion of a project spanning multiple files is what should be covered by this feature.

File structure

A project specification file is a Lua file which contains a script returning a list/table of project specfications or a project specification itself (if it is too technical at this point, stay with us, examples will follow). A single project minimally requires a list of files, so a minimal project.lua could look like

return {
  files = { ["file.tex"] = { } }
}

There are a number of optional parameters:

A more complete example showcasing the list of project specifications approach would be

return {
  {
    name = "My awesome book",
    workingDirectory = "book",
    files = {
      ["a.mp"] = {
        directives = { "% arara: metapost" },
        priority = 1
      },
      ["file.tex"] = { }
    }
  },
  {
    name = "My awesome book vol. 2",
    workingDirectory = "bookv2",
    files = { ["file.tex"] = { } },
    dependencies = { "My awesome book" }
  }
}

Note how the second project depends on the first one and the a.mp file has additional parameters. For files, there are the following additional options:

Apart from the return expression you are free to use Lua code to perform computations or other actions within the project specification file. Please note that for technical reasons arara's Lua interpreter only accepts Lua 5.2.