cocoapods-jxedt 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-jxedt/binary/config.rb +10 -0
- data/lib/cocoapods-jxedt/binary/helper/prebuild_installer.rb +11 -0
- data/lib/cocoapods-jxedt/binary/helper/prebuild_sandbox.rb +58 -53
- data/lib/cocoapods-jxedt/binary/hooks/post_install.rb +2 -2
- data/lib/cocoapods-jxedt/binary/hooks/pre_install.rb +7 -7
- data/lib/cocoapods-jxedt/binary/pod-room/xcodebuild_command.rb +9 -5
- data/lib/cocoapods-jxedt/binary/prebuild.rb +2 -2
- data/lib/cocoapods-jxedt/command/binary/binary.rb +2 -0
- data/lib/cocoapods-jxedt/command/binary/command/build.rb +3 -3
- data/lib/cocoapods-jxedt/command/binary/command/clean.rb +2 -2
- data/lib/cocoapods-jxedt/command/binary/command/code.rb +66 -0
- data/lib/cocoapods-jxedt/command/binary/command/source_project.rb +51 -0
- data/lib/cocoapods-jxedt/command/jxedt.rb +1 -0
- data/lib/cocoapods-jxedt/command/user/user.rb +57 -0
- data/lib/cocoapods-jxedt/gem_version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a42af93bf587f17cb6256301bdcc0b744cad56e731f8d00b4c11e072bf22058
|
4
|
+
data.tar.gz: bfd62a6afcaf885d939778b70d21779730ce3b5bc1c59df7cf1d781ea10fb77a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d6963c2b36104bc5dbbd8b9d87c354d1074219662de03fac82b757245997a1b149c0c77711ca1cd640eb73181824aa9606181edf25372f0d891d91c1d2a7b42
|
7
|
+
data.tar.gz: 7bf5ed75aae47c6eb983962d8a4e6f13725e179351d4b2a48f46876932a6f6e406f445248f0a780bf9c853489fb01a84f63e3b93d8b115ecbf02529a943897c0
|
@@ -26,6 +26,7 @@ module Jxedt
|
|
26
26
|
:disable_dsym => "禁止编译dsym产物。默认true",
|
27
27
|
:disable_resource_compilable_pods => "禁止编译有需要编译的resource文件(xib、xcdatamodeld等)的pod",
|
28
28
|
:build_log_path => "编译的log输出路径",
|
29
|
+
:prebuild_sandbox_path => '预编译的sandbox路径,可以配置一个多台电脑都可访问的路径,可以做源码和二进制的link。必须以`/Users/cocoapods-jxedt`开头',
|
29
30
|
:build_args => "编译的配置。了解xcodebuild命令的可以配置编译参数,例如配置 ARCHS='arm64 armv7'",
|
30
31
|
:git_cache => 'git缓存配置,A Hash. 详情查看 GIT_CACHE_CONFIG'
|
31
32
|
}.freeze
|
@@ -134,6 +135,15 @@ module Jxedt
|
|
134
135
|
@dsl_config[:build_log_path]
|
135
136
|
end
|
136
137
|
|
138
|
+
def prebuild_sandbox_path
|
139
|
+
@sandbox_path ||= begin
|
140
|
+
sandbox_path = @dsl_config[:prebuild_sandbox_path]
|
141
|
+
sandbox_path = nil unless sandbox_path =~ /^\/Users\/cocoapods-jxedt\/.{1,}$/
|
142
|
+
sandbox_path = nil unless File.exist?('/Users/cocoapods-jxedt')
|
143
|
+
sandbox_path
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
137
147
|
def build_args
|
138
148
|
@args ||= begin
|
139
149
|
args = @dsl_config[:build_args] || {}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
module Pod
|
3
|
+
class JxedtPrebuildInstaller < Installer # rubocop:disable Metrics/ClassLength
|
4
|
+
def installation_options
|
5
|
+
# Skip integrating user targets for prebuild Pods project.
|
6
|
+
@installation_options ||= Pod::Installer::InstallationOptions.new(
|
7
|
+
super.to_h.merge(:integrate_targets => false)
|
8
|
+
)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -1,4 +1,13 @@
|
|
1
1
|
module Pod
|
2
|
+
class Sandbox
|
3
|
+
attr_accessor :standard_sandbox
|
4
|
+
|
5
|
+
def standard_sandbox_root
|
6
|
+
return root if standard_sandbox.nil?
|
7
|
+
standard_sandbox.root
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
2
11
|
# The sandbox provides support for the directory that CocoaPods uses for an
|
3
12
|
# installation. In this directory the Pods projects, the support files and
|
4
13
|
# the sources of the Pods are stored.
|
@@ -41,60 +50,69 @@ module Pod
|
|
41
50
|
# +-- PodTargetN.xcodeproj
|
42
51
|
#
|
43
52
|
#
|
44
|
-
class
|
45
|
-
# [
|
46
|
-
def self.
|
47
|
-
prebuild_sandbox_path = Pathname.new(
|
48
|
-
new(prebuild_sandbox_path)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
+
class JxedtPrebuildSandbox < Sandbox
|
54
|
+
# [Pod::Sandbox] standard_sandbox
|
55
|
+
def self.from_standard_sandbox(sandbox, sandbox_path: nil, real_path_compiler: false)
|
56
|
+
prebuild_sandbox_path = Pathname.new(sandbox.root).realpath + '../Pods-Source'
|
57
|
+
prebuild_sandbox = new(prebuild_sandbox_path)
|
58
|
+
# initialize
|
59
|
+
prebuild_sandbox.standard_sandbox = sandbox
|
60
|
+
# prepare
|
61
|
+
prebuild_sandbox.prepare_dir
|
62
|
+
prebuild_sandbox
|
53
63
|
end
|
54
64
|
|
55
|
-
def
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
65
|
+
def real_path_compiler?
|
66
|
+
@real_path_compiler ||= begin
|
67
|
+
prebuild_sandbox_path = Jxedt.config.prebuild_sandbox_path
|
68
|
+
real_path_compiler = prebuild_sandbox_path && prebuild_sandbox_path.length > 0
|
69
|
+
if real_path_compiler
|
70
|
+
prebuild_sources_root = Pathname.new(prebuild_sandbox_path)
|
71
|
+
prebuild_sources_root.rmtree if prebuild_sources_root.exist?
|
72
|
+
prebuild_sources_root.mkpath
|
73
|
+
end
|
74
|
+
real_path_compiler
|
75
|
+
end
|
66
76
|
end
|
67
77
|
|
68
|
-
def
|
69
|
-
|
70
|
-
|
78
|
+
def prepare_dir
|
79
|
+
# clear
|
80
|
+
root.children.each { |child| child.rmtree if '.xcodeproj' != child.extname }
|
71
81
|
|
72
|
-
|
73
|
-
root
|
74
|
-
|
82
|
+
# copy
|
83
|
+
standard_sandbox.root.children.each do |child|
|
84
|
+
# skip headers_root & target_support_files_root & project_path
|
85
|
+
should_skip_paths = [standard_sandbox.headers_root, standard_sandbox.target_support_files_root, standard_sandbox.project_path]
|
86
|
+
next if should_skip_paths.include?(child)
|
75
87
|
|
76
|
-
|
77
|
-
|
78
|
-
|
88
|
+
should_copy_paths = [standard_sandbox.specifications_root, standard_sandbox.manifest_path]
|
89
|
+
if should_copy_paths.include?(child)
|
90
|
+
# copy Local Podspecs & manifest path
|
91
|
+
FileUtils.cp_r(child, root + child.basename)
|
92
|
+
else
|
93
|
+
# 真实的路径去编译,则拷贝文件到prebuild_sandbox
|
94
|
+
FileUtils.cp_r(child, sources_root) if real_path_compiler?
|
95
|
+
end
|
96
|
+
end
|
79
97
|
end
|
80
98
|
|
81
|
-
def
|
82
|
-
|
99
|
+
def sources_root
|
100
|
+
if real_path_compiler?
|
101
|
+
# 真实的路径去编译,则返回prebuild sources root
|
102
|
+
return @prebuild_sources_root ||= Pathname.new(Jxedt.config.prebuild_sandbox_path)
|
103
|
+
end
|
104
|
+
standard_sandbox.root
|
83
105
|
end
|
84
106
|
|
85
|
-
def
|
86
|
-
root
|
87
|
-
next if ['Headers', 'Local Podspecs', 'Target Support Files'].include? child.basename.to_s
|
88
|
-
next if ['.lock', '.xcodeproj'].include? child.extname.to_s
|
89
|
-
make_source_link(child, root + source_path + child.basename)
|
90
|
-
end
|
107
|
+
def project_path
|
108
|
+
root + 'Pods-Source.xcodeproj'
|
91
109
|
end
|
92
110
|
|
93
111
|
def clean_source_project!
|
94
112
|
return if Jxedt.config.keep_source_project?
|
95
113
|
|
96
|
-
|
97
|
-
|
114
|
+
sources_root.rmtree if sources_root.exist?
|
115
|
+
root.rmtree if root.exist?
|
98
116
|
end
|
99
117
|
end
|
100
118
|
end
|
@@ -108,20 +126,7 @@ module Pod
|
|
108
126
|
class UserProjectIntegrator
|
109
127
|
alias_method :old_create_workspace, :create_workspace
|
110
128
|
def create_workspace
|
111
|
-
old_create_workspace unless sandbox.is_a?(Pod::
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
module Pod
|
118
|
-
class Installer
|
119
|
-
# Cleans up the sandbox directory by removing stale target support files and headers.
|
120
|
-
#
|
121
|
-
class SandboxDirCleaner
|
122
|
-
alias_method :old_clean!, :clean!
|
123
|
-
def clean!
|
124
|
-
old_clean! unless @sandbox.is_a?(Pod::PrebuildSandbox)
|
129
|
+
old_create_workspace unless sandbox.is_a?(Pod::JxedtPrebuildSandbox)
|
125
130
|
end
|
126
131
|
end
|
127
132
|
end
|
@@ -11,11 +11,11 @@ module Jxedt
|
|
11
11
|
require_relative '../helper/prebuild_sandbox'
|
12
12
|
|
13
13
|
# :post_install过程校验两次`pod install`的值
|
14
|
-
validate_pod_checksum unless @installer_context.sandbox.is_a?(Pod::
|
14
|
+
validate_pod_checksum unless @installer_context.sandbox.is_a?(Pod::JxedtPrebuildSandbox)
|
15
15
|
end
|
16
16
|
|
17
17
|
def validate_pod_checksum
|
18
|
-
original_installer = ObjectSpace.each_object(Pod::Installer).reject {|installer| installer.sandbox.is_a?(Pod::
|
18
|
+
original_installer = ObjectSpace.each_object(Pod::Installer).reject {|installer| installer.sandbox.is_a?(Pod::JxedtPrebuildSandbox) }.first
|
19
19
|
return if original_installer.nil?
|
20
20
|
|
21
21
|
check_result = original_installer.lockfile == @installer_context.sandbox.source_lockfile
|
@@ -21,14 +21,15 @@ module Jxedt
|
|
21
21
|
end
|
22
22
|
|
23
23
|
require_relative '../helper/prebuild_sandbox'
|
24
|
+
require_relative '../helper/prebuild_installer'
|
24
25
|
|
25
|
-
# 如果是Pod::
|
26
|
-
return if @installer_context.sandbox.is_a?(Pod::
|
26
|
+
# 如果是Pod::JxedtPrebuildSandbox类则直接返回
|
27
|
+
return if @installer_context.sandbox.is_a?(Pod::JxedtPrebuildSandbox)
|
27
28
|
|
28
29
|
# 获取原始的installer对象,必须先获取对象
|
29
30
|
original_installer = ObjectSpace.each_object(Pod::Installer).first
|
30
|
-
prebuild_sandbox = Pod::
|
31
|
-
source_installer = Pod::
|
31
|
+
prebuild_sandbox = Pod::JxedtPrebuildSandbox.from_standard_sandbox(@installer_context.sandbox)
|
32
|
+
source_installer = Pod::JxedtPrebuildInstaller.new(prebuild_sandbox, @installer_context.podfile, @installer_context.lockfile)
|
32
33
|
# 设置原始的installer携带的参数
|
33
34
|
source_installer.update = original_installer.update
|
34
35
|
source_installer.repo_update = original_installer.repo_update
|
@@ -51,12 +52,11 @@ module Jxedt
|
|
51
52
|
end
|
52
53
|
|
53
54
|
require 'cocoapods-jxedt/git_helper/cache_fetcher'
|
54
|
-
binary_dir = @installer_context.sandbox.
|
55
|
+
binary_dir = @installer_context.sandbox.standard_sandbox_root + Jxedt.config.binary_dir
|
55
56
|
Jxedt::CacheFetcher.sync(binary_hash, binary_dir)
|
56
57
|
end
|
57
58
|
|
58
59
|
# prebuild_job
|
59
|
-
prebuild_sandbox.link_source_project!
|
60
60
|
if Jxedt.config.prebuild_job?
|
61
61
|
log_section "🚀 Prebuild frameworks"
|
62
62
|
build_targets = Jxedt::Prebuild.new(source_installer).build
|
@@ -65,7 +65,7 @@ module Jxedt
|
|
65
65
|
if Jxedt.config.cache_repo_enabled? && Jxedt.config.auto_push? && build_targets && build_targets.size > 0
|
66
66
|
log_section "🚄 Push git cache"
|
67
67
|
require 'cocoapods-jxedt/git_helper/cache_pucher'
|
68
|
-
output_dir = prebuild_sandbox.
|
68
|
+
output_dir = prebuild_sandbox.standard_sandbox_root + Jxedt.config.binary_dir
|
69
69
|
Jxedt::CachePucher.push(output_dir, build_targets, false)
|
70
70
|
end
|
71
71
|
end
|
@@ -108,7 +108,7 @@ module Jxedt
|
|
108
108
|
`lipo -create -output #{lib_output} #{lib_file}` if lib_file.exist?
|
109
109
|
|
110
110
|
# copy public headers
|
111
|
-
headers_source = target.sandbox.headers_root + 'Public' + target.
|
111
|
+
headers_source = target.sandbox.headers_root + 'Public' + target.pod_name
|
112
112
|
Dir.glob("#{headers_source}/**/*.h").each { |h| `ditto #{h} #{fwk.headers_path}/#{File.basename(h)}` }
|
113
113
|
|
114
114
|
# target support module
|
@@ -129,14 +129,18 @@ module Jxedt
|
|
129
129
|
FileUtils.cp_r(swiftmodule_path, fwk.module_map_path) if swiftmodule_path.exist?
|
130
130
|
|
131
131
|
# umbrella header name
|
132
|
-
|
133
|
-
|
132
|
+
umbrella_header_name = "#{target.pod_name}-umbrella.h"
|
133
|
+
unless File.exist?("#{fwk.headers_path}/#{umbrella_header_name}")
|
134
|
+
# 从Target Support Files文件夹中获取unbrella header
|
135
|
+
target_support_files_root = target.sandbox.target_support_files_root + target.name
|
136
|
+
Dir.glob("#{target_support_files_root}/*-umbrella.h").each { |h| FileUtils.cp_r(h.to_s, fwk.headers_path + umbrella_header_name) }
|
137
|
+
end
|
134
138
|
|
135
139
|
# make modulemap
|
136
|
-
if File.exist?("#{fwk.headers_path}/#{
|
140
|
+
if File.exist?("#{fwk.headers_path}/#{umbrella_header_name}")
|
137
141
|
module_map = <<MODULE_MAP
|
138
142
|
framework module #{target.product_module_name} {
|
139
|
-
umbrella header "#{
|
143
|
+
umbrella header "#{umbrella_header_name}"
|
140
144
|
|
141
145
|
export *
|
142
146
|
module * { export * }
|
@@ -8,7 +8,7 @@ module Jxedt
|
|
8
8
|
|
9
9
|
def self.from_sandbox(sandbox)
|
10
10
|
search_path = Jxedt.config.binary_dir
|
11
|
-
binary_dir = search_path.empty? ? nil : sandbox.
|
11
|
+
binary_dir = search_path.empty? ? nil : sandbox.standard_sandbox_root + search_path
|
12
12
|
check_sandbox = Sandbox.new(binary_dir)
|
13
13
|
check_sandbox.sandbox = sandbox
|
14
14
|
check_sandbox
|
@@ -277,7 +277,7 @@ module Jxedt
|
|
277
277
|
|
278
278
|
def output_path
|
279
279
|
sandbox = @source_installer.sandbox
|
280
|
-
sandbox.
|
280
|
+
sandbox.standard_sandbox_root + Jxedt.config.binary_dir + "GeneratedFrameworks"
|
281
281
|
end
|
282
282
|
|
283
283
|
def clear_output_path
|
@@ -45,10 +45,11 @@ module Pod
|
|
45
45
|
require 'cocoapods-jxedt/binary/helper/target_definition'
|
46
46
|
require 'cocoapods-jxedt/binary/helper/prebuild_sandbox'
|
47
47
|
require 'cocoapods-jxedt/binary/helper/podfile_post_install_hook'
|
48
|
+
require 'cocoapods-jxedt/binary/helper/prebuild_installer'
|
48
49
|
|
49
50
|
# 获取原始的installer对象,必须先获取对象
|
50
|
-
prebuild_sandbox = Pod::
|
51
|
-
source_installer = Pod::
|
51
|
+
prebuild_sandbox = Pod::JxedtPrebuildSandbox.from_standard_sandbox(sandbox)
|
52
|
+
source_installer = Pod::JxedtPrebuildInstaller.new(prebuild_sandbox, podfile, lockfile)
|
52
53
|
# 执行install
|
53
54
|
source_installer.install!
|
54
55
|
|
@@ -59,7 +60,6 @@ module Pod
|
|
59
60
|
require 'cocoapods-jxedt/binary/prebuild'
|
60
61
|
|
61
62
|
# prebuild_job
|
62
|
-
prebuild_sandbox.link_source_project!
|
63
63
|
log_section "🚀 Prebuild frameworks"
|
64
64
|
# 默认放在Pods源码工程同级目录下
|
65
65
|
@output_path = prebuild_sandbox.project_path.parent + '.command_build' if @output_path.nil?
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
class JxedtCommand < Command
|
4
|
+
class Binary < JxedtCommand
|
5
|
+
class Code < Binary
|
6
|
+
self.summary = 'binary and source code linked.'
|
7
|
+
self.description = <<-DESC
|
8
|
+
binary and source code linked.
|
9
|
+
DESC
|
10
|
+
self.command = 'code'
|
11
|
+
self.arguments = [
|
12
|
+
]
|
13
|
+
def self.options
|
14
|
+
[
|
15
|
+
['--link', 'link source code.'],
|
16
|
+
['--unlink', 'Remove source code linked.'],
|
17
|
+
]
|
18
|
+
end
|
19
|
+
def initialize(argv)
|
20
|
+
@link = argv.flag?('link', false)
|
21
|
+
@unlink = argv.flag?('unlink', false)
|
22
|
+
super
|
23
|
+
end
|
24
|
+
|
25
|
+
def validate!
|
26
|
+
help! "Please enter the necessary options." unless @link || @unlink
|
27
|
+
super
|
28
|
+
end
|
29
|
+
|
30
|
+
def run
|
31
|
+
podfile = Pod::Config.instance.podfile
|
32
|
+
help! '请检查命令执行路径,需要在Podfile文件所在目录执行' if podfile.nil?
|
33
|
+
|
34
|
+
user_path = Pathname.new('/Users/cocoapods-jxedt')
|
35
|
+
help! "#{user_path} 路径不存在,源码和二进制链接只支持此路径下的文件。你可以执行`pod jxedt user --add`来添加目录" unless user_path.exist?
|
36
|
+
|
37
|
+
prebuild_sandbox_path = Jxedt.config.prebuild_sandbox_path
|
38
|
+
help! '请配置正确的prebuild sandbox路径' if prebuild_sandbox_path.nil?
|
39
|
+
|
40
|
+
sandbox_path = Pod::Config.instance.sandbox.root
|
41
|
+
prebuild_sandbox_path = Pathname.new(prebuild_sandbox_path)
|
42
|
+
if @link
|
43
|
+
prebuild_sandbox_path.rmtree if prebuild_sandbox_path.exist?
|
44
|
+
help! '不存在Pods文件夹,请检查你的目录' unless sandbox_path.exist?
|
45
|
+
|
46
|
+
make_source_link(sandbox_path, prebuild_sandbox_path)
|
47
|
+
Pod::UI.puts "🎉 源码二进制软链接已添加"
|
48
|
+
else
|
49
|
+
prebuild_sandbox_path.rmtree if prebuild_sandbox_path.exist?
|
50
|
+
Pod::UI.puts "🎉 源码二进制软链接已删除"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def make_source_link(source, target)
|
55
|
+
source = Pathname.new(source)
|
56
|
+
target = Pathname.new(target)
|
57
|
+
target.parent.mkpath unless target.parent.exist?
|
58
|
+
target.rmtree if target.exist?
|
59
|
+
relative_source = source.relative_path_from(target.parent)
|
60
|
+
FileUtils.ln_sf(relative_source, target)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
class JxedtCommand < Command
|
4
|
+
class Binary < JxedtCommand
|
5
|
+
class SourceProject < Binary
|
6
|
+
self.summary = '生成binary对应的源码工程'
|
7
|
+
self.description = <<-DESC
|
8
|
+
生成binary对应的源码工程
|
9
|
+
DESC
|
10
|
+
self.command = 'sourceProject'
|
11
|
+
self.arguments = [
|
12
|
+
]
|
13
|
+
def self.options
|
14
|
+
[]
|
15
|
+
end
|
16
|
+
def initialize(argv)
|
17
|
+
super
|
18
|
+
end
|
19
|
+
|
20
|
+
def validate!
|
21
|
+
super
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
podfile = Pod::Config.instance.podfile
|
26
|
+
lockfile = Pod::Config.instance.lockfile
|
27
|
+
sandbox = Pod::Config.instance.sandbox
|
28
|
+
help! '请检查命令执行路径,需要在Podfile文件所在目录执行' if podfile.nil?
|
29
|
+
|
30
|
+
# 修改config配置
|
31
|
+
options = {
|
32
|
+
:keep_source_project => true, # 保留源码工程
|
33
|
+
}
|
34
|
+
Jxedt.config.dsl_config.merge!(options)
|
35
|
+
|
36
|
+
require 'cocoapods-jxedt/binary/helper/target_definition'
|
37
|
+
require 'cocoapods-jxedt/binary/helper/prebuild_sandbox'
|
38
|
+
require 'cocoapods-jxedt/binary/helper/podfile_post_install_hook'
|
39
|
+
require 'cocoapods-jxedt/binary/helper/prebuild_installer'
|
40
|
+
|
41
|
+
# 获取原始的installer对象,必须先获取对象
|
42
|
+
prebuild_sandbox = Pod::JxedtPrebuildSandbox.from_standard_sandbox(sandbox)
|
43
|
+
source_installer = Pod::JxedtPrebuildInstaller.new(prebuild_sandbox, podfile, lockfile)
|
44
|
+
# 执行install
|
45
|
+
source_installer.install!
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
class JxedtCommand < Command
|
4
|
+
class User < JxedtCommand
|
5
|
+
self.summary = '用户操作,添加和删除用户目录,用来统一路径,方便做源码和二进制的link.'
|
6
|
+
self.description = <<-DESC
|
7
|
+
用户操作,添加和删除用户目录,用来统一路径,方便做源码和二进制的link.
|
8
|
+
DESC
|
9
|
+
self.command = 'user'
|
10
|
+
self.arguments = [
|
11
|
+
]
|
12
|
+
def self.options
|
13
|
+
[
|
14
|
+
['--add', '添加用户目录,/Users/cocoapods-jxedt'],
|
15
|
+
['--delete', '删除用户目录,/Users/cocoapods-jxedt']
|
16
|
+
]
|
17
|
+
end
|
18
|
+
def initialize(argv)
|
19
|
+
@add = argv.flag?('add', false)
|
20
|
+
@delete = argv.flag?('delete', false)
|
21
|
+
@name = 'cocoapods-jxedt'
|
22
|
+
super
|
23
|
+
end
|
24
|
+
|
25
|
+
def validate!
|
26
|
+
help! '请指定要操作的命令, add or delete' unless @add || @delete
|
27
|
+
help! '输入的目录不正确!' if @name.length == 0
|
28
|
+
super
|
29
|
+
end
|
30
|
+
|
31
|
+
def run
|
32
|
+
if @add
|
33
|
+
make_dir
|
34
|
+
else
|
35
|
+
delete_dir
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def make_dir
|
40
|
+
dirname = "/Users/#{@name}"
|
41
|
+
help! "目录已存在!" if File.exist?(dirname)
|
42
|
+
|
43
|
+
`sudo mkdir #{dirname} && sudo chmod -R 777 #{dirname}`
|
44
|
+
end
|
45
|
+
|
46
|
+
def delete_dir
|
47
|
+
help! '因删除操作存在风险,暂不支持删除,请自行删除!' if @name != 'cocoapods-jxedt'
|
48
|
+
|
49
|
+
dirname = "/Users/#{@name}"
|
50
|
+
help! "目录不存在!" unless File.exist?(dirname)
|
51
|
+
|
52
|
+
`sudo rm -rf #{dirname}`
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-jxedt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- guojiashuang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- lib/cocoapods-jxedt/binary/helper/names.rb
|
77
77
|
- lib/cocoapods-jxedt/binary/helper/podfile_options.rb
|
78
78
|
- lib/cocoapods-jxedt/binary/helper/podfile_post_install_hook.rb
|
79
|
+
- lib/cocoapods-jxedt/binary/helper/prebuild_installer.rb
|
79
80
|
- lib/cocoapods-jxedt/binary/helper/prebuild_sandbox.rb
|
80
81
|
- lib/cocoapods-jxedt/binary/helper/target_definition.rb
|
81
82
|
- lib/cocoapods-jxedt/binary/hooks/CocoapodsJxedtHook.rb
|
@@ -92,12 +93,15 @@ files:
|
|
92
93
|
- lib/cocoapods-jxedt/command/binary/binary.rb
|
93
94
|
- lib/cocoapods-jxedt/command/binary/command/build.rb
|
94
95
|
- lib/cocoapods-jxedt/command/binary/command/clean.rb
|
96
|
+
- lib/cocoapods-jxedt/command/binary/command/code.rb
|
95
97
|
- lib/cocoapods-jxedt/command/binary/command/fetch.rb
|
96
98
|
- lib/cocoapods-jxedt/command/binary/command/push.rb
|
99
|
+
- lib/cocoapods-jxedt/command/binary/command/source_project.rb
|
97
100
|
- lib/cocoapods-jxedt/command/binary/command/statistics.rb
|
98
101
|
- lib/cocoapods-jxedt/command/header/header.rb
|
99
102
|
- lib/cocoapods-jxedt/command/jxedt.rb
|
100
103
|
- lib/cocoapods-jxedt/command/options/options.rb
|
104
|
+
- lib/cocoapods-jxedt/command/user/user.rb
|
101
105
|
- lib/cocoapods-jxedt/gem_version.rb
|
102
106
|
- lib/cocoapods-jxedt/git_helper/cache_fetcher.rb
|
103
107
|
- lib/cocoapods-jxedt/git_helper/cache_pucher.rb
|