From 62887f0be0fa7b06af874e381205399c24b73246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Fri, 13 Dec 2013 11:00:23 +0100 Subject: [PATCH 1/3] [vendor] Import XCPretty. --- .gitmodules | 3 +++ vendor/XCPretty | 1 + 2 files changed, 4 insertions(+) create mode 160000 vendor/XCPretty diff --git a/.gitmodules b/.gitmodules index 4472ff4e..64f39c6b 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/mneorr/XCPretty.git diff --git a/vendor/XCPretty b/vendor/XCPretty new file mode 160000 index 00000000..aedbdee9 --- /dev/null +++ b/vendor/XCPretty @@ -0,0 +1 @@ +Subproject commit aedbdee921591ce3e4b643666ae12c99078f91d3 From 44e93a2759063e2ebb21e756e397c6236f6f9dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Fri, 13 Dec 2013 14:52:18 +0100 Subject: [PATCH 2/3] [vendor] Use custom XCPretty printer when building an Xcode project. --- .gitmodules | 2 +- lib/motion/project/vendor.rb | 9 +++++++-- vendor/XCPretty | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 64f39c6b..70df23c9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,4 +3,4 @@ url = git@github.com:lrz/RubyMotionVM.git [submodule "vendor/XCPretty"] path = vendor/XCPretty - url = https://github.com/mneorr/XCPretty.git + url = https://github.com/alloy/XCPretty.git 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 index aedbdee9..a1c8e6a4 160000 --- a/vendor/XCPretty +++ b/vendor/XCPretty @@ -1 +1 @@ -Subproject commit aedbdee921591ce3e4b643666ae12c99078f91d3 +Subproject commit a1c8e6a40d47231f8daad9b67f706166f7d33d1b From a4b6bc00e808e93ab3e350140e1d40ea6b7e2644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Fri, 13 Dec 2013 15:02:35 +0100 Subject: [PATCH 3/3] [install] Include XCPretty files in installation. --- Rakefile | 4 ++++ 1 file changed, 4 insertions(+) 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/) }