From cb1025286e8cdf4ae850146e808940e6a864b3a6 Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Thu, 2 Jun 2016 15:25:00 +0900 Subject: [PATCH] Add frontend/bin/frontend_command.rb for development 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. --- frontend/bin/frontend_command.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 frontend/bin/frontend_command.rb diff --git a/frontend/bin/frontend_command.rb b/frontend/bin/frontend_command.rb new file mode 100644 index 0000000..9817ebe --- /dev/null +++ b/frontend/bin/frontend_command.rb @@ -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}"