Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/slather/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,21 @@ def derived_data_path
build_settings = `xcodebuild #{projectOrWorkspaceArgument} #{schemeArgument} -showBuildSettings #{buildAction} CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO 2>&1`

if build_settings
derived_data_path = build_settings.match(/ OBJROOT = (.+)/)
derived_data_path = build_settings.match(/ BUILT_PRODUCTS_DIR = (.+)/)
# => /Users/.../Library/Developer/Xcode/DerivedData/app-bqrfaojicpsqnoglloisfftjhksc/Build/Products/Release-iphoneos
# when match fails derived_data_path is nil
derived_data_path = derived_data_path[1] if derived_data_path
if derived_data_path
derived_data_path = derived_data_path[1]
derived_data_path = File.expand_path("../../..", derived_data_path)
Copy link
Member

Choose a reason for hiding this comment

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

It'd be nice to have an automated test to verify this path is now correct.

end
end

if derived_data_path == nil
derived_data_path = File.expand_path('~') + "/Library/Developer/Xcode/DerivedData/"
end

puts "Derived Data Path: #{derived_data_path}"
Copy link
Member

Choose a reason for hiding this comment

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

puts shouldn't be in production code


derived_data_path
end
private :derived_data_path
Expand Down