Class: Uki_config
- Inherits:
-
Object
- Object
- Uki_config
- 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
-
#build_time ⇒ Object
编译耗时.
-
#dsym ⇒ Object
是否产生dsym.
-
#fir_url ⇒ Object
上传Url.
-
#ipa_size ⇒ Object
包体积.
-
#no_build ⇒ Object
是否执行编译命令.
-
#project_sea ⇒ Object
是否海外.
-
#release ⇒ Object
是否编译release环境.
-
#upload_time ⇒ Object
上传耗时.
-
#verbose(v) ⇒ Object
是否展示详细信息.
-
#workspace_name ⇒ Object
自动workspace名称.
-
#xcode_envs ⇒ Object
xcode环境变量.
Instance Method Summary collapse
-
#app_file_path ⇒ Object
读取产物记录文件.
- #app_version ⇒ Object
- #archive_path ⇒ Object
- #auto_work_space_name ⇒ Object
-
#build_exe_path ⇒ Object
产物路径.
- #build_version ⇒ Object
- #configuration ⇒ Object
- #dsym_config ⇒ Object
- #dsym_path ⇒ Object
- #group_name ⇒ Object
-
#installation_root ⇒ Object
路径相关.
- #ipa_path ⇒ Object
- #scheme ⇒ Object
-
#verbose? ⇒ Object
是否展示详细信息.
- #workspace ⇒ Object
- #xcode_env_path ⇒ Object
Class Attribute Details
.instance ⇒ Object
125 126 127 |
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 125 def self.instance @instance ||= new end |
Instance Attribute Details
#build_time ⇒ Object
编译耗时
21 22 23 |
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 21 def build_time @build_time end |
#dsym ⇒ Object
是否产生dsym
17 18 19 |
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 17 def dsym @dsym end |
#fir_url ⇒ Object
上传Url
25 26 27 |
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 25 def fir_url @fir_url end |
#ipa_size ⇒ Object
包体积
29 30 31 |
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 29 def ipa_size @ipa_size end |
#no_build ⇒ Object
是否执行编译命令
13 14 15 |
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 13 def no_build @no_build end |
#project_sea ⇒ Object
是否海外
11 12 13 |
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 11 def project_sea @project_sea end |
#release ⇒ Object
是否编译release环境
15 16 17 |
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 15 def release @release end |
#upload_time ⇒ Object
上传耗时
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_name ⇒ Object
自动workspace名称
19 20 21 |
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 19 def workspace_name @workspace_name end |
#xcode_envs ⇒ Object
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_path ⇒ Object
读取产物记录文件
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_version ⇒ Object
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_path ⇒ Object
48 49 50 |
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 48 def archive_path return @installation_root end |
#auto_work_space_name ⇒ Object
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_path ⇒ Object
产物路径
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_version ⇒ Object
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 |
#configuration ⇒ Object
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_config ⇒ Object
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_path ⇒ Object
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_name ⇒ Object
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_root ⇒ Object
路径相关
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_path ⇒ Object
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 |
#scheme ⇒ Object
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 |
#workspace ⇒ Object
37 38 39 |
# File 'lib/cocoapods-uki-packager/uki_config.rb', line 37 def workspace return self.workspace_name end |
#xcode_env_path ⇒ Object
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 |