File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,6 @@ Rake.application.instance_variable_set "@name", "go"
14
14
orig_verbose = verbose
15
15
verbose ( false )
16
16
17
- # Buck integration
18
- require 'rake-tasks/buck'
19
-
20
17
# The CrazyFun build grammar. There's no magic here, just ruby
21
18
require 'rake-tasks/crazy_fun'
22
19
require 'rake-tasks/crazy_fun/mappings/export'
102
99
# from rake.
103
100
crazy_fun . create_tasks ( Dir [ "**/build.desc" ] )
104
101
102
+ # Buck integration. Loaded after CrazyFun has initialized all the tasks it'll handle.
103
+ # This is because the buck integration creates a rule for "//.*"
104
+ require 'rake-tasks/buck'
105
+
106
+
105
107
# Notice that because we're using rake, anything you can do in a normal rake
106
108
# build can also be done here. For example, here we set the default task
107
109
task :default => [ :test ]
Original file line number Diff line number Diff line change @@ -96,11 +96,15 @@ def buck(*args, &block)
96
96
end
97
97
98
98
rule /\/ \/ .*/ do |task |
99
- # Task is a FileTask, but that's not what we need. Instead, just delegate down to buck in all cases
99
+ # Task is a FileTask, but that's not what we need. Instead, just delegate down to buck in all
100
+ # cases where the rule was not created by CrazyFun. Rules created by the "rule" method will
101
+ # be a FileTask, whereas those created by CrazyFun are normal rake Tasks.
100
102
101
- task . enhance do
102
- Buck ::buck_cmd . call ( 'build' , task . name )
103
- end
103
+ if task . class == Rake ::FileTask && !task . out
104
+ task . enhance do
105
+ Buck ::buck_cmd . call ( 'build' , task . name )
106
+ end
104
107
105
- Buck ::enhance_task ( task )
108
+ Buck ::enhance_task ( task )
109
+ end
106
110
end
You can’t perform that action at this time.
0 commit comments