Class: Pod::SPM::Config::ProjectConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-spm/config/project.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instanceObject



11
12
13
# File 'lib/cocoapods-spm/config/project.rb', line 11

def self.instance
  @instance ||= ProjectConfig.new
end

Instance Method Details

#default_derived_data_pathObject



23
24
25
26
27
28
# File 'lib/cocoapods-spm/config/project.rb', line 23

def default_derived_data_path
  @default_derived_data_path ||= begin
    raw = `xcodebuild -showBuildSettings -workspace #{workspace.shellescape} -scheme #{scheme.shellescape}`
    Pathname(raw[/BUILD_DIR = (.*)/, 1]).parent.parent
  end
end

#schemeObject



19
20
21
# File 'lib/cocoapods-spm/config/project.rb', line 19

def scheme
  workspace.parent.glob("*.xcodeproj/**/*.xcscheme").first.basename(".xcscheme")
end

#workspaceObject



15
16
17
# File 'lib/cocoapods-spm/config/project.rb', line 15

def workspace
  @workspace ||= Pod::Config.instance.podfile.defined_in_file.parent.glob("*.xcworkspace").first
end