Skip to content

Commit 4998910

Browse files
authored
Merge pull request #67 from esl/upgrade-deps-loading
Fix no-deps option, Stop importing deps manually
2 parents efd00e9 + 7989e53 commit 4998910

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

lib/mix/tasks/gradient.ex

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ defmodule Mix.Tasks.Gradient do
6363
{options, user_paths, _invalid} = OptionParser.parse(args, strict: @options)
6464

6565
options = Enum.reduce(options, [], &prepare_option/2)
66-
66+
# Load dependencies
67+
maybe_load_deps(options)
68+
# Start Gradualizer application
6769
Application.ensure_all_started(:gradualizer)
6870
# Compile the project before the analysis
6971
maybe_compile_project(options)
70-
# Load dependencies
71-
maybe_load_deps(options)
7272
# Get paths to files
7373
files = get_paths(user_paths)
7474

@@ -100,11 +100,10 @@ defmodule Mix.Tasks.Gradient do
100100
end
101101

102102
defp maybe_load_deps(options) do
103-
unless options[:no_deps] || false do
103+
if options[:no_deps] || false do
104+
Application.put_env(:gradualizer, :options, autoimport: false)
105+
else
104106
IO.puts("Loading deps...")
105-
106-
get_deps_beam_paths()
107-
|> :gradualizer_db.import_beam_files()
108107
end
109108
end
110109

@@ -179,10 +178,4 @@ defmodule Mix.Tasks.Gradient do
179178
end)
180179
|> Map.new()
181180
end
182-
183-
defp get_deps_beam_paths() do
184-
(Mix.Project.build_path() <> "/lib/*/**/*.beam")
185-
|> Path.wildcard()
186-
|> Enum.map(&String.to_charlist/1)
187-
end
188181
end

0 commit comments

Comments
 (0)