Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Added buildlog_path option to change the location of the xcodebuild logs #99

Merged
merged 2 commits into from
Sep 23, 2015
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/gym/generators/build_command_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def pipe

def xcodebuild_log_path
file_name = "#{Gym.project.app_name}-#{Gym.config[:scheme]}.log"
containing = File.expand_path("~/Library/Logs/gym")
containing = File.expand_path(Gym.config[:buildlog_path])
FileUtils.mkdir_p(containing)

return File.join(containing, file_name)
Expand Down
5 changes: 5 additions & 0 deletions lib/gym/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ def self.plain_options
verify_block: proc do |value|
value.gsub!(".ipa", "")
end),
FastlaneCore::ConfigItem.new(key: :buildlog_path,
short_option: "-l",
env_name: "GYM_BUILDLOG_PATH",
description: "The directory were to store the build log",
default_value: "~/Library/Logs/gym"),
FastlaneCore::ConfigItem.new(key: :sdk,
short_option: "-k",
env_name: "GYM_SDK",
Expand Down
12 changes: 12 additions & 0 deletions spec/build_command_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@
regex = %r{Library/Developer/Xcode/Archives/\d\d\d\d\-\d\d\-\d\d/ExampleProductName \d\d\d\d\-\d\d\-\d\d \d\d\.\d\d\.\d\d.xcarchive}
expect(result).to match(regex)
end

it "#buildlog_path is used when provided" do
options = { project: "./examples/standard/Example.xcodeproj", buildlog_path: "/tmp/my/path" }
Gym.config = FastlaneCore::Configuration.create(Gym::Options.available_options, options)
result = Gym::BuildCommandGenerator.xcodebuild_log_path
expect(result).to include("/tmp/my/path")
end

it "#buildlog_path is not used when not provided" do
result = Gym::BuildCommandGenerator.xcodebuild_log_path
expect(result.to_s).to include("Library/Logs/gym")
end
end
end
end