Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External Build Tool: add support for things like make #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/xcpretty/formatters/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def format_build_target(target, project, configuration); EMPTY; end
def format_aggregate_target(target, project, configuration); EMPTY; end
def format_analyze_target(target, project, configuration); EMPTY; end
def format_check_dependencies; EMPTY; end
def format_external_build_tool(target); EMPTY; end
def format_clean(project, target, configuration); EMPTY; end
def format_clean_target(target, project, configuration); EMPTY; end
def format_clean_remove; EMPTY; end
Expand Down
4 changes: 4 additions & 0 deletions lib/xcpretty/formatters/simple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ def format_check_dependencies
format('Check Dependencies')
end

def format_external_build_tool(target)
format('External Build Tool', target)
end

private

def heading(prefix, text, description)
Expand Down
6 changes: 6 additions & 0 deletions lib/xcpretty/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ module Matchers
# @regex Nothing returned here for now
CHECK_DEPENDENCIES_MATCHER = /^Check dependencies/

# @regex Captured groups
# $1 target
EXTERNAL_BUILD_TOOL_MATCHER = /^ExternalBuildToolExecution (.*)$/

# @regex Captured groups
# $1 command path
# $2 arguments
Expand Down Expand Up @@ -299,6 +303,8 @@ def parse(text)
formatter.format_copy_strings_file($1)
when CHECK_DEPENDENCIES_MATCHER
formatter.format_check_dependencies
when EXTERNAL_BUILD_TOOL_MATCHER
formatter.format_external_build_tool($1)
when CLANG_ERROR_MATCHER
formatter.format_error($1)
when CODESIGN_FRAMEWORK_MATCHER
Expand Down
14 changes: 14 additions & 0 deletions spec/fixtures/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,20 @@
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -strip-debug-symbols -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks /Users/dustin/Source/CocoaChip/build/Release/CocoaChipCore.framework /Users/dustin/Source/CocoaChip/build/Release/CocoaChip.app/Contents/Frameworks
warning: skipping copy phase strip, binary is code signed: /Users/dustin/Source/CocoaChip/build/Release/CocoaChipCore.framework/Versions/A/CocoaChipCore
)
SAMPLE_EXTERNAL_BUILD_TOOL = %Q(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Freeze mutable objects assigned to constants.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

ExternalBuildToolExecution MyTargetName
cd /Users/musalj/code/OSS/ObjectiveSugar/Example
export ACTION build
export AD_HOC_CODE_SIGNING_ALLOWED NO
export ALTERNATE_GROUP staff
export ALTERNATE_MODE u+w,go-w,a+rX
export ALTERNATE_OWNER musalj
export ALWAYS_SEARCH_USER_PATHS NO
export ALWAYS_USE_SEPARATE_HEADERMAPS YES
export arch i386
export variant normal
/usr/bin/make -j8
).freeze

SAMPLE_SCREENSHOT_FILE = 'RACCommandSpec, line 80, hello xcpretty.png'
SAMPLE_UNRELATED_IMAGE_FILE = 'apple_raw.png'
Expand Down
5 changes: 5 additions & 0 deletions spec/xcpretty/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ module XCPretty
@parser.parse(SAMPLE_PBXCP)
end

it "parses ExternalBuildToolExecution" do
@formatter.should receive(:format_external_build_tool).with('MyTargetName')
@parser.parse(SAMPLE_EXTERNAL_BUILD_TOOL)
end

it 'parses changing directories' do
@formatter.should receive(:format_shell_command).with('cd',
'/some/place/out\ there')
Expand Down