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

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.instanceObject



125
126
127
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 125

def self.instance
    @instance ||= new
end

Instance Attribute Details

#build_timeObject

编译耗时



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

def build_time
  @build_time
end

#dsymObject

是否产生dsym



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

def dsym
  @dsym
end

#fir_urlObject

上传Url



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

def fir_url
  @fir_url
end

#ipa_sizeObject

包体积



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

def ipa_size
  @ipa_size
end

#no_buildObject

是否执行编译命令



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

def no_build
  @no_build
end

#project_seaObject

是否海外



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

def project_sea
  @project_sea
end

#releaseObject

是否编译release环境



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

def release
  @release
end

#upload_timeObject

上传耗时



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

def upload_time
  @upload_time
end

#verbose(v) ⇒ Object

是否展示详细信息



9
10
11
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 9

def verbose
  @verbose
end

#workspace_nameObject

自动workspace名称



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

def workspace_name
  @workspace_name
end

#xcode_envsObject

xcode环境变量



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

def xcode_envs
  @xcode_envs
end

Instance Method Details

#app_file_pathObject

读取产物记录文件



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

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

#app_versionObject



93
94
95
96
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 93

def app_version
    buildSettings = self.xcode_envs["buildSettings"]
    return buildSettings["MARKETING_VERSION"]
end

#archive_pathObject



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

def archive_path 
    return @installation_root
end

#auto_work_space_nameObject



82
83
84
85
86
87
88
89
90
91
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 82

def auto_work_space_name
    installation_root

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

#build_exe_pathObject

产物路径



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

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

#build_versionObject



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

def build_version
    buildSettings = self.xcode_envs["buildSettings"]
    return buildSettings["CURRENT_PROJECT_VERSION"]
end

#configurationObject



41
42
43
44
45
46
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 41

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

#dsym_configObject



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

def dsym_config
    unless dsym
        return "dwarf"
    end

    return "dwarf-with-dsym"
end

#dsym_pathObject



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

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

#group_nameObject



113
114
115
116
117
118
119
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 113

def group_name
    unless @workspace_name == "miaohong.xcworkspace"
        return "iOS海外极速打包已完成"
    end

    return "iOS国内极速打包已完成"
end

#installation_rootObject

路径相关



74
75
76
77
78
79
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 74

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

#ipa_pathObject



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

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

#schemeObject



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

def scheme
    return self.xcode_envs["target"]
end

#verbose?Object

是否展示详细信息



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

def verbose
  @verbose
end

#workspaceObject



37
38
39
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 37

def workspace
    return self.workspace_name
end

#xcode_env_pathObject



121
122
123
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 121

def xcode_env_path
    return File.join(@installation_root, "xcode_env.json")
end