 defmodule Mix.Tasks.Cure.Deps.Compile do
   use Mix.Task
-
+  
   @shortdoc "Compiles the C-files of all the dependencies (that use Cure)."
   
   @doc """

    c_src = dep_location <> "c_src/"

    mix_file = File.read! mix_exs
    is_list(Regex.run(~r/:cure/, mix_file)) and File.exists? c_src
  end

  @doc false

    # 2. Check if they have a cure dependency;
    # 3. If yes -> compile the program using make.

    IO.puts "Compiling all Cure-based dependencies."

    get_deps |> Enum.map(fn(dep) ->
      spawn(fn ->
        if need_to_compile? dep do
          IO.puts "Compiling #{dep}."
          compile(dep)
        end
      end)
