Class: Pod::Xcode::XCFramework::Slice

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods/xcode/xcframework/xcframework_slice.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, identifier, archs, platform, platform_variant = nil) ⇒ Slice

Returns a new instance of Slice.


25
26
27
28
29
30
31
# File 'lib/cocoapods/xcode/xcframework/xcframework_slice.rb', line 25

def initialize(path, identifier, archs, platform, platform_variant = nil)
  @path = path
  @identifier = identifier
  @supported_archs = archs
  @platform = Pod::Platform.new(platform)
  @platform_variant = platform_variant.to_sym unless platform_variant.nil?
end

Instance Attribute Details

#identifierString (readonly)

Returns the framework identifier.

Returns:

  • (String)

    the framework identifier


15
16
17
# File 'lib/cocoapods/xcode/xcframework/xcframework_slice.rb', line 15

def identifier
  @identifier
end

#pathPathname (readonly)

Returns the path to the .framework root of this framework slice.

Returns:

  • (Pathname)

    the path to the .framework root of this framework slice


7
8
9
# File 'lib/cocoapods/xcode/xcframework/xcframework_slice.rb', line 7

def path
  @path
end

#platformPlatform (readonly)

Returns the supported platform.

Returns:

  • (Platform)

    the supported platform


19
20
21
# File 'lib/cocoapods/xcode/xcframework/xcframework_slice.rb', line 19

def platform
  @platform
end

#platform_variantSymbol (readonly)

Returns the platform variant. Either :simulator or nil.

Returns:

  • (Symbol)

    the platform variant. Either :simulator or nil


23
24
25
# File 'lib/cocoapods/xcode/xcframework/xcframework_slice.rb', line 23

def platform_variant
  @platform_variant
end

#supported_archsArray<String> (readonly)

Returns list of supported architectures.

Returns:

  • (Array<String>)

    list of supported architectures


11
12
13
# File 'lib/cocoapods/xcode/xcframework/xcframework_slice.rb', line 11

def supported_archs
  @supported_archs
end

Instance Method Details

#binary_pathPathname

Returns the path to the bundled binary.

Returns:

  • (Pathname)

    the path to the bundled binary


45
46
47
# File 'lib/cocoapods/xcode/xcframework/xcframework_slice.rb', line 45

def binary_path
  path + name
end

#nameString

Returns the name of the framework.

Returns:

  • (String)

    the name of the framework


35
36
37
# File 'lib/cocoapods/xcode/xcframework/xcframework_slice.rb', line 35

def name
  @name ||= File.basename(path, '.framework')
end

#simulator_variant?Boolean

Returns:

  • (Boolean)

39
40
41
# File 'lib/cocoapods/xcode/xcframework/xcframework_slice.rb', line 39

def simulator_variant?
  @platform_variant == :simulator
end