Skip to content

Commit 06cc1c1

Browse files
author
José Valim
committed
Get rid of Mix.Sup
1 parent cb5806b commit 06cc1c1

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ $(1): lib/$(1)/ebin/Elixir.$(2).beam lib/$(1)/ebin/$(1).app
3232
lib/$(1)/ebin/$(1).app: lib/$(1)/mix.exs
3333
$(Q) mkdir -p lib/$(1)/_build/shared/lib/$(1)
3434
$(Q) cp -R lib/$(1)/ebin lib/$(1)/_build/shared/lib/$(1)/
35-
$(Q) cd lib/$(1) && ../../bin/elixir -e "Mix.Sup.start_link()" -r mix.exs -e "Mix.Task.run('compile.app')"
35+
$(Q) cd lib/$(1) && ../../bin/elixir -e "Mix.start(:permanent, [])" -r mix.exs -e "Mix.Task.run('compile.app')"
3636
$(Q) cp lib/$(1)/_build/shared/lib/$(1)/ebin/$(1).app lib/$(1)/ebin/$(1).app
3737
$(Q) rm -rf lib/$(1)/_build
3838

lib/mix/lib/mix.ex

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,22 @@ defmodule Mix do
2020
end
2121

2222
@doc false
23-
def start(_, []) do
24-
res = Mix.Sup.start_link
23+
def start(_type, []) do
24+
import Supervisor.Spec
25+
26+
children = [
27+
worker(Mix.TasksServer, []),
28+
worker(Mix.ProjectStack, [])
29+
]
30+
31+
opts = [strategy: :one_for_one, name: Mix.Supervisor]
32+
stat = Supervisor.start_link(children, opts)
33+
2534
if env = System.get_env("MIX_ENV") do
2635
env(String.to_atom env)
2736
end
28-
res
37+
38+
stat
2939
end
3040

3141
@doc """

lib/mix/lib/mix/sup.ex

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)