Class: CBin::LocalFramework

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-imy-bin/helpers/local/local_framework.rb,
lib/cocoapods-imy-bin/helpers/local/local_framework_builder.rb

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, platform, local_build_dir) ⇒ LocalFramework

Returns a new instance of LocalFramework.



15
16
17
18
19
# File 'lib/cocoapods-imy-bin/helpers/local/local_framework.rb', line 15

def initialize(name, platform, local_build_dir)
  @name = name
  @platform = platform
  @local_build_dir = local_build_dir
end

Instance Attribute Details

#fwk_pathObject (readonly)

Returns the value of attribute fwk_path.



13
14
15
# File 'lib/cocoapods-imy-bin/helpers/local/local_framework.rb', line 13

def fwk_path
  @fwk_path
end

#headers_pathObject (readonly)

Returns the value of attribute headers_path.



7
8
9
# File 'lib/cocoapods-imy-bin/helpers/local/local_framework.rb', line 7

def headers_path
  @headers_path
end

#module_map_pathObject (readonly)

Returns the value of attribute module_map_path.



8
9
10
# File 'lib/cocoapods-imy-bin/helpers/local/local_framework.rb', line 8

def module_map_path
  @module_map_path
end

#resources_pathObject (readonly)

Returns the value of attribute resources_path.



9
10
11
# File 'lib/cocoapods-imy-bin/helpers/local/local_framework.rb', line 9

def resources_path
  @resources_path
end

#root_pathObject (readonly)

Returns the value of attribute root_path.



10
11
12
# File 'lib/cocoapods-imy-bin/helpers/local/local_framework.rb', line 10

def root_path
  @root_path
end

#swift_module_pathObject (readonly)

Returns the value of attribute swift_module_path.



12
13
14
# File 'lib/cocoapods-imy-bin/helpers/local/local_framework.rb', line 12

def swift_module_path
  @swift_module_path
end

#versions_pathObject (readonly)

Returns the value of attribute versions_path.



11
12
13
# File 'lib/cocoapods-imy-bin/helpers/local/local_framework.rb', line 11

def versions_path
  @versions_path
end

Instance Method Details

#delete_resourcesObject



29
30
31
32
# File 'lib/cocoapods-imy-bin/helpers/local/local_framework.rb', line 29

def delete_resources
  Pathname.new(@resources_path).rmtree
  (Pathname.new(@fwk_path) + Pathname.new('Resources')).delete
end

#makeObject



21
22
23
24
25
26
27
# File 'lib/cocoapods-imy-bin/helpers/local/local_framework.rb', line 21

def make
  make_root
  make_framework
  make_headers
  make_resources
  make_current_version
end

#remove_current_versionObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/cocoapods-imy-bin/helpers/local/local_framework.rb', line 34

def remove_current_version
  FileUtils.rm_f(File.join(@fwk_path,@name))
  FileUtils.rm_f(File.join(@fwk_path,"Headers"))
  FileUtils.rm_f(File.join(@fwk_path,"Resources"))

  FileUtils.cp_r("#{@versions_path}/.", @fwk_path)
  # FileUtils.remove_dir(@versions_path)
  FileUtils.remove_dir("#{@fwk_path}/Versions")

  # current_version_path = @versions_path + Pathname.new('../Current')
  # `ln -sf A #{current_version_path}`
  # `ln -sf Versions/Current/Headers #{@fwk_path}/`
  # `ln -sf Versions/Current/Resources #{@fwk_path}/`
  # `ln -sf Versions/Current/#{@name} #{@fwk_path}/`
end