Class: Xcodeproj::Project::Object::XCLocalSwiftPackageReference

Inherits:
Object
  • Object
show all
Includes:
PkgRefMixin
Defined in:
lib/xccache/xcodeproj/pkg.rb

Instance Method Summary collapse

Methods included from PkgRefMixin

#create_pkg_product_dependency_ref, #create_target_dependency_ref, #id, #local?, #non_xccache_pkg?, #slug, #xccache_pkg?

Instance Method Details

#absolute_pathObject



57
58
59
# File 'lib/xccache/xcodeproj/pkg.rb', line 57

def absolute_path
  path.nil? ? project.dir / relative_path : path
end

#ascii_plist_annotationObject



45
46
47
48
49
# File 'lib/xccache/xcodeproj/pkg.rb', line 45

def ascii_plist_annotation
  # Workaround: Xcode is using display_name while Xcodeproj is using File.basename(display_name)
  # Here, the plugin forces to use display_name so that updates either by Xcode or Xcodeproj are consistent
  " #{isa} \"#{display_name}\" "
end

#to_hObject



51
52
53
54
55
# File 'lib/xccache/xcodeproj/pkg.rb', line 51

def to_h
  {
    "path_from_root" => absolute_path.relative_path_from(Pathname.pwd).to_s,
  }
end