Skip to content

Commit ade2596

Browse files
committed
Fix bug where umbrella tasks were not reenabled
Closes #2058.
1 parent 0e804a2 commit ade2596

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* [Mix] Use absolute symbolic links on Windows for `_build` instead of copying
1212
* [Mix] Add `Mix.compilers` that returns all default compilers used by mix tasks
1313
* [Mix] Add `mix archive`
14+
* [Mix] Issue warning and reset mtime for source files from the future
1415
* [String] Improve performance of `String.split/1`
1516
* [Typespec] Allow `%Struct{}` syntax to be used in typespecs
1617

@@ -28,6 +29,7 @@
2829
* [Mix] Ensure Mix dependencies are not compiled every second time when `mix deps.compile` is invoked
2930
* [Mix] Fix a bug where `Mix.shell.error/1` and friends choked when printing a map
3031
* [Mix] Ensure multiple `@external_resource` entries are read by Mix compilers
32+
* [Mix] Fix a bug where tasks for umbrella projects were not properly reenabled
3133
* [Stream] Fix bug when `flat_map` is used inside another `flat_map` with an Enumerable
3234
* [Typespec] Fix a bug where the `list` typespec was incorrectly rendered as `[]`
3335

lib/mix/lib/mix/task.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ defmodule Mix.Task do
204204
task = to_string(task)
205205
module = get!(task)
206206

207+
Mix.TasksServer.delete_task(task, Mix.Project.get)
208+
207209
recur module, fn project ->
208210
Mix.TasksServer.delete_task(task, project)
209211
end

lib/mix/test/mix/task_test.exs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ defmodule Mix.TaskTest do
5858
assert Mix.Task.run("hello") == "Hello, World!"
5959
end
6060

61+
test "reenable for umbrella" do
62+
in_fixture "umbrella_dep/deps/umbrella", fn ->
63+
Mix.Project.in_project(:umbrella, ".", fn _ ->
64+
assert [:ok, :ok] = Mix.Task.run "clean"
65+
assert :noop = Mix.Task.run "clean"
66+
67+
Mix.Task.reenable "clean"
68+
assert [:ok, :ok] = Mix.Task.run "clean"
69+
assert :noop = Mix.Task.run "clean"
70+
end)
71+
end
72+
end
73+
6174
test :get! do
6275
assert Mix.Task.get!("hello") == Mix.Tasks.Hello
6376

0 commit comments

Comments
 (0)