Module: Xcodeproj::Project::Object::PkgRefMixin
- Included in:
- XCLocalSwiftPackageReference, XCRemoteSwiftPackageReference
- Defined in:
- lib/xccache/xcodeproj/pkg.rb
Instance Method Summary collapse
- #create_pkg_product_dependency_ref(product) ⇒ Object
- #create_target_dependency_ref(product) ⇒ Object
- #id ⇒ Object
- #local? ⇒ Boolean
- #non_xccache_pkg? ⇒ Boolean
- #slug ⇒ Object
- #xccache_pkg? ⇒ Boolean
Instance Method Details
#create_pkg_product_dependency_ref(product) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/xccache/xcodeproj/pkg.rb', line 27 def create_pkg_product_dependency_ref(product) ref = project.new(XCSwiftPackageProductDependency) ref.package = self ref.product_name = product ref end |
#create_target_dependency_ref(product) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/xccache/xcodeproj/pkg.rb', line 34 def create_target_dependency_ref(product) ref = project.new(PBXTargetDependency) ref.name = product ref.product_ref = create_pkg_product_dependency_ref(product) ref end |
#id ⇒ Object
7 8 9 |
# File 'lib/xccache/xcodeproj/pkg.rb', line 7 def id local? ? (relative_path || path) : repositoryURL end |
#local? ⇒ Boolean
15 16 17 |
# File 'lib/xccache/xcodeproj/pkg.rb', line 15 def local? is_a?(XCLocalSwiftPackageReference) end |
#non_xccache_pkg? ⇒ Boolean
23 24 25 |
# File 'lib/xccache/xcodeproj/pkg.rb', line 23 def non_xccache_pkg? !xccache_pkg? end |
#slug ⇒ Object
11 12 13 |
# File 'lib/xccache/xcodeproj/pkg.rb', line 11 def slug File.basename(id, File.extname(id)) end |
#xccache_pkg? ⇒ Boolean
19 20 21 |
# File 'lib/xccache/xcodeproj/pkg.rb', line 19 def xccache_pkg? local? && ["xccache/packages/umbrella", "xccache/packages/proxy"].include?(id) end |