forked from sportnginlegacy/objective-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
24 lines (22 loc) · 770 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require "bundler/gem_tasks"
namespace :bin do
task :setup do
binaries_location = "./externals"
%W(sloccount oclint/bin).each do |executable_dir|
executable_dir_path = "#{binaries_location}/#{executable_dir}"
binaries = Dir.entries(executable_dir_path).select {|f| !File.directory? f}
binaries.each do |binary|
contents = <<-RUBY
require 'pathname'
pn = Pathname.new(__FILE__)
opts = ARGV.join(" ")
puts `"\#{pn.dirname}/../#{executable_dir_path}/\#{pn.basename}" \#{opts}`
RUBY
gem_binary_path = "./bin/#{binary}"
File.open(gem_binary_path, 'w') { |file| file.write(contents) }
FileUtils.chmod('a+x', [gem_binary_path])
puts "#{gem_binary_path} generated"
end
end
end
end