elixirelixir-mixhex-pm

Preventing a mix task being included when your project is included as a mix dep


An Elixir library I'm writing has two custom mix tasks, one intended to be used by users who have made my library a dependency of their project, one intended to be used only within my project.

The problem here is that both mix tasks are available to users in their projects after they have added mine as a dep.

How do I prevent this? I tried to avoid the task in package: [ files: [ etc ] ] in my Mix config, but it was still available in my test project that specifies my library as a dep via git.


Solution

  • Currently Mix does not really support the idea of private tasks directly. A couple options are: