Class: Uki_config

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-uki-packager/uki_config.rb

Defined Under Namespace

Modules: Mixin

Constant Summary collapse

PROJECT_SCHEME =

scheme info

['UkiOverseas', 'miaohong'].freeze
PROJECT_WORKSPACENAME =

workspace name

['UkiOverseas.xcworkspace', 'miaohong.xcworkspace']

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.instanceObject



108
109
110
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 108

def self.instance
    @instance ||= new
end

Instance Attribute Details

#build_timeObject

编译耗时



23
24
25
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 23

def build_time
  @build_time
end

#dsymObject

是否产生dsym



19
20
21
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 19

def dsym
  @dsym
end

#fir_urlObject

上传Url



27
28
29
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 27

def fir_url
  @fir_url
end

#no_buildObject

是否执行编译命令



15
16
17
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 15

def no_build
  @no_build
end

#project_seaObject

是否海外



13
14
15
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 13

def project_sea
  @project_sea
end

#releaseObject

是否编译release环境



17
18
19
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 17

def release
  @release
end

#upload_timeObject

上传耗时



25
26
27
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 25

def upload_time
  @upload_time
end

#verbose(v) ⇒ Object

是否展示详细信息



11
12
13
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 11

def verbose
  @verbose
end

#workspace_nameObject

自动workspace名称



21
22
23
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 21

def workspace_name
  @workspace_name
end

Instance Method Details

#app_file_pathObject

读取产物记录文件



99
100
101
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 99

def app_file_path
    return File.join(@installation_root, "app_path")
end

#archive_pathObject



53
54
55
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 53

def archive_path 
    return @installation_root
end

#auto_work_space_nameObject



87
88
89
90
91
92
93
94
95
96
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 87

def auto_work_space_name
    installation_root

    Dir.foreach(@installation_root) do |entry|
        if entry.end_with?('xcworkspace')
            @workspace_name = entry.split('.').first
            next
        end
    end
end

#build_exe_pathObject

产物路径



104
105
106
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 104

def build_exe_path
    return IO.readlines(app_file_path).first      
end

#configurationObject



46
47
48
49
50
51
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 46

def configuration
    unless release
        return "Debug"
    end
    return "Release"
end

#dsym_configObject



57
58
59
60
61
62
63
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 57

def dsym_config
    unless dsym
        return "dwarf"
    end

    return "dwarf-with-dsym"
end

#dsym_pathObject



65
66
67
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 65

def dsym_path
    return File.join(@installation_root.to_s, "dsym")
end

#installation_rootObject

路径相关



79
80
81
82
83
84
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 79

def installation_root
    @installation_root ||= begin
        current_dir = Pathname.new(Dir.pwd.unicode_normalize(:nfkc))
        installation_root = current_dir
    end
end

#ipa_pathObject



69
70
71
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 69

def ipa_path 
    return File.join(@installation_root.to_s, "ipa")
end

#schemeObject



31
32
33
34
35
36
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 31

def scheme
    unless project_sea
        return PROJECT_SCHEME.last
    end
    return PROJECT_SCHEME.first
end

#verbose?Object

是否展示详细信息



29
30
31
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 29

def verbose
  @verbose
end

#workspaceObject



38
39
40
41
42
43
44
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 38

def workspace
    unless project_sea
        return PROJECT_WORKSPACENAME.last
    end

    return PROJECT_WORKSPACENAME.first
end