diff --git a/.gitmodules b/.gitmodules index 4472ff4e..70df23c9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "vm"] path = vm url = git@github.com:lrz/RubyMotionVM.git +[submodule "vendor/XCPretty"] + path = vendor/XCPretty + url = https://github.com/alloy/XCPretty.git diff --git a/Rakefile b/Rakefile index 992369a2..03f62eef 100644 --- a/Rakefile +++ b/Rakefile @@ -162,6 +162,10 @@ task :install do end end + # Include the XCPretty gem. + binaries << './vendor/XCPretty/bin/xcpretty' + data.concat(FileList["./vendor/XCPretty/{LICENSE.txt,lib/**/*.rb}"]) + # Android support is not ready yet. data.delete_if { |x| x.match(/^.\/lib\/motion\/project\/template\/android/) } diff --git a/lib/motion/project/vendor.rb b/lib/motion/project/vendor.rb index fb9fc507..d7cfcc30 100644 --- a/lib/motion/project/vendor.rb +++ b/lib/motion/project/vendor.rb @@ -39,7 +39,6 @@ module Motion; module Project; attr_reader :path, :libs, :bs_files, :opts def build(platform) - App.info 'Build', @path send gen_method('build'), platform, @opts.dup if @libs.empty? App.fail "Building vendor project `#{@path}' failed to create at least one `.a' library." @@ -62,6 +61,7 @@ module Motion; module Project; end def build_static(platform, opts) + App.info 'Build', @path Dir.chdir(@path) do build_dir = "build-#{platform}" @@ -146,6 +146,7 @@ EOS end def build_xcode(platform, opts) + project_dir = File.expand_path(@config.project_dir) Dir.chdir(@path) do build_dir = "build-#{platform}" if !File.exist?(build_dir) or Dir.glob('**/*').any? { |x| File.mtime(x) > File.mtime(build_dir) } @@ -178,7 +179,11 @@ EOS xcopts = '' xcopts << "-target \"#{target}\" " if target xcopts << "-scheme \"#{scheme}\" " if scheme - sh "/usr/bin/xcodebuild -project \"#{xcodeproj}\" #{xcopts} -configuration \"#{configuration}\" -sdk #{platform.downcase}#{@config.sdk_version} #{@config.arch_flags(platform)} CONFIGURATION_BUILD_DIR=\"#{xcode_build_dir}\" IPHONEOS_DEPLOYMENT_TARGET=#{@config.deployment_target} build" + command = "/usr/bin/xcodebuild -project \"#{xcodeproj}\" #{xcopts} -configuration \"#{configuration}\" -sdk #{platform.downcase}#{@config.sdk_version} #{@config.arch_flags(platform)} CONFIGURATION_BUILD_DIR=\"#{xcode_build_dir}\" IPHONEOS_DEPLOYMENT_TARGET=#{@config.deployment_target} build" + unless App::VERBOSE + command << " | env RM_XCPRETTY_PRINTER_PROJECT_ROOT='#{project_dir}' '#{File.join(@config.motiondir, 'vendor/XCPretty/bin/xcpretty')}' --printer '#{File.join(@config.motiondir, 'lib/motion/project/vendor/xcpretty_printer.rb')}'" + end + sh command # Copy .a files into the platform build directory. prods = opts.delete(:products) diff --git a/vendor/XCPretty b/vendor/XCPretty new file mode 160000 index 00000000..a1c8e6a4 --- /dev/null +++ b/vendor/XCPretty @@ -0,0 +1 @@ +Subproject commit a1c8e6a40d47231f8daad9b67f706166f7d33d1b