Skip to content

Commit

Permalink
Allow the CrazyFun ':run: alias to work with tests and binaries.
Browse files Browse the repository at this point in the history
We now no longer assume that ':run' implicit targets are
definitely tests when delegating down to Buck.
  • Loading branch information
shs96c committed Jun 3, 2016
1 parent e59d6c7 commit 56d093e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rake-tasks/buck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,16 @@ def buck(*args, &block)
short = task.name[0..-5]

task.enhance do
Buck::buck_cmd.call('test', short)
# Figure out if this is an executable or a test target.
Buck::buck_cmd.call('query', "#{short} --output-attributes buck.type") do |output|
hash = JSON.parse(output)
type = hash[short]['buck.type']
if type =~ /.*_test/
Buck::buck_cmd.call('test', short)
else
Buck::buck_cmd.call('run', "--verbose 5 #{short}")
end
end
end
end

Expand Down

0 comments on commit 56d093e

Please sign in to comment.