Permalink
Browse files

Update CI to Xcode 9 (#8948)

* [CI] Upgrade to 8.3.x

* Override default circleci setting

* Xcode 9!

* Ensure set_additional_default_values is called

* Attempt to stub out file existing logic
  • Loading branch information...
DanToml committed Sep 28, 2017
1 parent 2f5aa80 commit b65b463fa68259d2eeafb90eb80f87f0005f8a79
Showing with 14 additions and 7 deletions.
  1. +2 −1 circle.yml
  2. +8 −4 gym/lib/gym/detect_values.rb
  3. +4 −2 gym/spec/detect_values_spec.rb
View
@@ -1,8 +1,9 @@
machine:
environment:
FL_BUILDLOG_PATH: ~/Library/Logs
SCAN_INCLUDE_SIMULATOR_LOGS: false
xcode:
version: "8.2"
version: "9.0"
dependencies:
pre:
- brew install shellcheck
@@ -37,22 +37,26 @@ def self.archive_path_from_local_xcode_preferences
day = Time.now.strftime("%F") # e.g. 2015-08-07
archive_path = File.expand_path("~/Library/Developer/Xcode/Archives/#{day}/")
path = xcode_preference_plist_path
return archive_path unless File.exist?(path.to_s) # this file only exists when you edit the Xcode preferences to set custom values
return archive_path unless has_xcode_preferences_plist?
custom_archive_path = xcode_preferences_dictionary(path)['IDECustomDistributionArchivesLocation']
custom_archive_path = xcode_preferences_dictionary['IDECustomDistributionArchivesLocation']
return archive_path if custom_archive_path.to_s.length == 0
return File.join(custom_archive_path, day)
end
# Helper Methods
# this file only exists when you edit the Xcode preferences to set custom values
def self.has_xcode_preferences_plist?
File.exist?(xcode_preference_plist_path)
end
def self.xcode_preference_plist_path
File.expand_path("~/Library/Preferences/com.apple.dt.Xcode.plist")
end
def self.xcode_preferences_dictionary(path)
def self.xcode_preferences_dictionary(path = xcode_preference_plist_path)
CFPropertyList.native_types(CFPropertyList::List.new(file: path).value)
end
@@ -4,6 +4,7 @@
describe 'Xcode config handling', :stuff do
it "fetches the custom build path from the Xcode config" do
expect(Gym::DetectValues).to receive(:has_xcode_preferences_plist?).and_return(true)
expect(Gym::DetectValues).to receive(:xcode_preferences_dictionary).and_return({ "IDECustomDistributionArchivesLocation" => "/test/path" })
options = { project: "./gym/examples/multipleSchemes/Example.xcodeproj" }
@@ -14,6 +15,7 @@
end
it "fetches the default build path from the Xcode config when preference files exists but not archive location defined" do
expect(Gym::DetectValues).to receive(:has_xcode_preferences_plist?).and_return(true)
expect(Gym::DetectValues).to receive(:xcode_preferences_dictionary).and_return({})
options = { project: "./gym/examples/multipleSchemes/Example.xcodeproj" }
@@ -24,8 +26,8 @@
expect(path).to eq(archive_path)
end
it "fetches the default build path from the Xcode config when missing Xcode preferences plit" do
expect(Gym::DetectValues).to receive(:xcode_preference_plist_path).and_return(nil)
it "fetches the default build path from the Xcode config when missing Xcode preferences plist" do
expect(Gym::DetectValues).to receive(:has_xcode_preferences_plist?).and_return(false)
options = { project: "./gym/examples/multipleSchemes/Example.xcodeproj" }
Gym.config = FastlaneCore::Configuration.create(Gym::Options.available_options, options)

0 comments on commit b65b463

Please sign in to comment.