Skip to content

Streamline and update Rakefile #18852

@mokagio

Description

@mokagio

While working on #18845 and #18850, I noticed a few things that could be improved in the Rakefile:

  • DRY how we load Podfile.lock
  • We have tasks such as test and clean that are redundant given our use of Fastlane. We should either remove them or make them run the appropriate Faslane lane under the hood.

WordPress-iOS/Rakefile

Lines 216 to 224 in 2185a1e

desc 'Run test suite'
task test: [:dependencies] do
xcodebuild(:build, :test)
end
desc 'Remove any temporary products'
task :clean do
xcodebuild(:clean)
end

  • Same goes for this custom xcodebuild call. Fastlane can do this for us with extra parameter and safety checks.

WordPress-iOS/Rakefile

Lines 732 to 743 in 2185a1e

def xcodebuild(*build_cmds)
cmd = 'xcodebuild'
cmd += " -destination 'platform=iOS Simulator,name=iPhone 6s'"
cmd += ' -sdk iphonesimulator'
cmd += " -workspace #{XCODE_WORKSPACE}"
cmd += " -scheme #{XCODE_SCHEME}"
cmd += " -configuration #{xcode_configuration}"
cmd += ' '
cmd += build_cmds.map(&:to_s).join(' ')
cmd += ' | bundle exec xcpretty -f `bundle exec xcpretty-travis-formatter` && exit ${PIPESTATUS[0]}' unless ENV['verbose']
sh(cmd)
end

Also note that xcodebuild call will likely fail, because "iPhone 6s" is no longer one of the Simulator that ship with Xcode out of the box:

image

Metadata

Metadata

Assignees

Labels

ToolingBuild, Release, and Validation Tools

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions