Skip to content

Commit

Permalink
Add frontend/bin/frontend_command.rb for development
Browse files Browse the repository at this point in the history
For during development of Nullarihyon, use the command to generate Xcode build phase script.

```
$ ruby -I lib:bundle bin/frontend_command.rb check --analyzer=../build/driver/Debug/nullarihyon-core --resource-dir=../vendor/clang+llvm-3.8.0-x86_64-apple-darwin/lib/clang/3.8.0/
```

It generate command line with options converted to absolute path. Copy the output and paste it to Xcode.
  • Loading branch information
soutaro committed Jun 2, 2016
1 parent d5abadd commit cb10252
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions frontend/bin/frontend_command.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# print frontend commandline

require "optparse"
require "pathname"

$analyzer_path = nil
$resource_dir_path = nil

OptionParser.new do |opt|
opt.on("--analyzer=PATH") {|path|
$analyzer_path = Pathname(path).realpath
}
opt.on("--resource-dir=PATH") {|path|
$resource_dir_path = Pathname(path).realpath
}
end.parse!(ARGV)

dir_path = Pathname(__dir__).realpath
file_path = Pathname(__FILE__).realpath

puts "/usr/bin/ruby -I#{dir_path + "lib"}:#{dir_path + "bundle"} #{file_path} xcode --analyzer=#{$analyzer_path} --resource-dir=#{$resource_dir_path}"

0 comments on commit cb10252

Please sign in to comment.