Class: Uki_config

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

Defined Under Namespace

Modules: Mixin

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.instanceObject



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

def self.instance
    @instance ||= new
end

Instance Attribute Details

#build_timeObject

编译耗时



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

def build_time
  @build_time
end

#dsymObject

是否产生dsym



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

def dsym
  @dsym
end

#fir_urlObject

上传Url



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

def fir_url
  @fir_url
end

#ipa_sizeObject

包体积



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

def ipa_size
  @ipa_size
end

#no_buildObject

是否执行编译命令



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

def no_build
  @no_build
end

#project_seaObject

是否海外



7
8
9
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 7

def project_sea
  @project_sea
end

#releaseObject

是否编译release环境



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

def release
  @release
end

#s_timeObject

开始上传时间



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

def s_time
  @s_time
end

#upload_timeObject

上传耗时



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

def upload_time
  @upload_time
end

#verbose(v) ⇒ Object

是否展示详细信息



5
6
7
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 5

def verbose
  @verbose
end

#workspace_nameObject

自动workspace名称



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

def workspace_name
  @workspace_name
end

#xcode_envsObject

xcode环境变量



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

def xcode_envs
  @xcode_envs
end

Instance Method Details

#app_file_pathObject

读取产物记录文件



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

def app_file_path
    return Pathname.new(huxue_target).join("app_path")
end

#app_versionObject



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

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

#archive_pathObject



50
51
52
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 50

def archive_path 
    return @installation_root
end

#auto_work_space_nameObject



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

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

#build_exe_pathObject

产物路径



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

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

#build_versionObject



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

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

#configurationObject



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

def configuration
  c = if release == 1
    "Test"
   elsif  release == 2
    "Release"
   else
    "Debug"
   end
   return c
end

#dsym_configObject



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

def dsym_config
    unless dsym
        return "dwarf"
    end

    return "dwarf-with-dsym"
end

#dsym_pathObject



62
63
64
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 62

def dsym_path
    return Pathname.new(huxue_target).join("dsym")
end

#group_nameObject



118
119
120
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 118

def group_name
    return "沪学习打包已完成"
end

#huxue_targetObject



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

def huxue_target
   return File.join(@installation_root, "huxue")
end

#installation_rootObject

路径相关



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

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

#ipa_pathObject



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

def ipa_path 
    return File.join(build_exe_path.to_s, "#{self.xcode_envs["target"]}.ipa")
end

#pgyer_apiKeyObject



130
131
132
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 130

def pgyer_apiKey 
    "12c406fb60a9b3f83f65b349ab48771e"
end

#schemeObject



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

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

#verbose?Object

是否展示详细信息



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

def verbose
  @verbose
end

#workspaceObject



35
36
37
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 35

def workspace
    return self.workspace_name
end

#xcode_env_pathObject



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

def xcode_env_path
    return  Pathname.new(huxue_target).join("xcode_env.json")
end