Sublime Forum

Polyglot projects vs. Build Systems

#1

I have a “meta” project that includes about a dozen folders, and thousands of files. Here is a simplified example

Work/
  cli/         # Go modules project
  website/     # Elixir website
  analysis/    # various Python, Bash scripts

I’d like to run “Ctrl+B” or use a context menu to run builds in a language specific way.

The “normal” integrations won’t work. For instance, an Elixir build doesn’t work, because my “Work” directory itself isn’t the root of an Elixir project:

** (Mix) Could not find a Mix.Project, please ensure you are running Mix in a directory with a mix.exs file

I am resigned to writing my own scripts or even Python modules to deal with this issue, but I am curious how others have approached this problem. I can’t be the only one using Sublime to open all their work projects at once.

I am thinking that a clean way to approach this would be to create a context menu item on the sidebar that runs a build inside that folder. That context menu would use some heuristics to select what command to run. For example, If I right clicked on the “cli” folder mentioned above, my context menu item would somehow execute “go test” intead of “mix test”.

I am interested in hearing about other approaches, though.

0 Likes