cocoapods-packager-ext 0.0.10 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/cocoapods-packager-ext.gemspec +2 -1
- data/lib/cocoapods-packager-ext/command/install_ext.rb +70 -46
- data/lib/cocoapods-packager-ext/command/package_ext.rb +64 -25
- data/lib/cocoapods-packager-ext/ext/builder.rb +41 -36
- data/lib/cocoapods-packager-ext/ext/downloader/lnpath.rb +19 -0
- data/lib/cocoapods-packager-ext/ext/downloader_ext.rb +38 -0
- data/lib/cocoapods-packager-ext/gem_version.rb +1 -1
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fe4f327fcf1e83c2c98b3e7536e32d0a7a282d35d2a01785e976ec5d42ea490
|
4
|
+
data.tar.gz: 8e511d747b8cd997dad144f8bdbc07fb291798524022db110c63a23eb0a0d2d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3d309b76e55409eb00290a3a8417f748f78ebc381d3ad4276d262d602b87391381765e60e469caf0f4922de3846f0de8181f3d130cde37fa2da899f72024ffd
|
7
|
+
data.tar.gz: '05863f3099b61ba477b227eca7734f52fcb2deac2cd549f55042cdcd6b51ec9d9712df4acee2d572981ef768b3b0bbc06959f0ae2185d8596931b8ff7f73ed37'
|
@@ -20,5 +20,6 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
22
|
spec.add_development_dependency 'rake'
|
23
|
-
spec.
|
23
|
+
spec.add_runtime_dependency(%q<cocoapods-packager>.freeze,["1.5.1"])
|
24
|
+
|
24
25
|
end
|
@@ -6,6 +6,7 @@ module Pod
|
|
6
6
|
if @dry_deps
|
7
7
|
prepare
|
8
8
|
resolve_dependencies
|
9
|
+
exit 0
|
9
10
|
else
|
10
11
|
install_t!
|
11
12
|
end
|
@@ -13,59 +14,82 @@ module Pod
|
|
13
14
|
|
14
15
|
end
|
15
16
|
|
16
|
-
|
17
|
+
class Command
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
class << self
|
37
|
-
alias options_t options
|
19
|
+
# This is an example of a cocoapods plugin adding a top-level subcommand
|
20
|
+
# to the 'pod' command.
|
21
|
+
#
|
22
|
+
# You can also create subcommands of existing or new commands. Say you
|
23
|
+
# wanted to add a subcommand to `list` to show newly deprecated pods,
|
24
|
+
# (e.g. `pod list deprecated`), there are a few things that would need
|
25
|
+
# to change.
|
26
|
+
#
|
27
|
+
# - move this file to `lib/pod/command/list/deprecated.rb` and update
|
28
|
+
# the class to exist in the the Pod::Command::List namespace
|
29
|
+
# - change this class to extend from `List` instead of `Command`. This
|
30
|
+
# tells the plugin system that it is a subcommand of `list`.
|
31
|
+
# - edit `lib/cocoapods_plugins.rb` to require this file
|
32
|
+
#
|
33
|
+
# @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
|
34
|
+
# in the `plugins.json` file, once your plugin is released.
|
35
|
+
#
|
36
|
+
module ClassMethods
|
38
37
|
def options
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
options = [
|
39
|
+
['--dry-deps','only test depend'],
|
40
|
+
]
|
41
|
+
options.concat(super)
|
42
42
|
end
|
43
|
-
|
44
43
|
end
|
44
|
+
class Install
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
def self.options
|
47
|
+
[
|
48
|
+
['--repo-update', 'Force running `pod repo update` before install'],
|
49
|
+
['--deployment', 'Disallow any changes to the Podfile or the Podfile.lock during installation'],
|
50
|
+
['--clean-install', 'Ignore the contents of the project cache and force a full pod installation. This only applies to projects that have enabled incremental installation.'],
|
51
|
+
['--dry-deps','only test depend'],
|
52
|
+
].concat(super).reject { |(name, _)| name == '--no-repo-update' }
|
53
|
+
end
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
55
|
+
# class << self
|
56
|
+
# options_t = instance_method(:options)
|
57
|
+
# # alias options_t options
|
58
|
+
# define_method(:options) do
|
59
|
+
# item = options_t.bind(self).call()
|
60
|
+
#
|
61
|
+
# [
|
62
|
+
# ['--dry-deps','only test depend'],
|
63
|
+
# ].concat(item)
|
64
|
+
# end
|
65
|
+
# end
|
66
|
+
# class << self
|
67
|
+
# alias options_t options
|
68
|
+
# def options
|
69
|
+
# o = options_t
|
70
|
+
# o.push(['--dry-deps','only test depend'])
|
71
|
+
# o.concat(super)
|
72
|
+
# end
|
73
|
+
#
|
74
|
+
# end
|
75
|
+
|
76
|
+
def initialize(argv)
|
77
|
+
super
|
78
|
+
@deployment = argv.flag?('deployment', false)
|
79
|
+
@clean_install = argv.flag?('clean-install', false)
|
80
|
+
@dry_deps = argv.flag?('dry-deps',false)
|
81
|
+
end
|
82
|
+
|
83
|
+
alias installer_for_config_t installer_for_config
|
84
|
+
def installer_for_config
|
85
|
+
item = installer_for_config_t
|
86
|
+
if @dry_deps
|
87
|
+
item.dry_deps = @dry_deps
|
88
|
+
end
|
89
|
+
item
|
66
90
|
end
|
67
|
-
end
|
68
91
|
|
92
|
+
|
93
|
+
end
|
69
94
|
end
|
70
|
-
end
|
71
95
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'cocoapods-packager-ext/ext/downloader/lnpath'
|
2
|
+
require 'cocoapods-packager-ext/ext/downloader_ext'
|
1
3
|
module Pod
|
2
4
|
class Command
|
3
5
|
# This is an example of a cocoapods plugin adding a top-level subcommand
|
@@ -19,14 +21,22 @@ module Pod
|
|
19
21
|
#
|
20
22
|
class Package
|
21
23
|
class << self
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
|
25
|
+
begin
|
26
|
+
alias options_t options
|
27
|
+
def options
|
28
|
+
o = options_t
|
29
|
+
o.push(['--all-deps','embedded all-depends'])
|
30
|
+
o.push(['--archs','select archs'])
|
31
|
+
o.push(['--black-deps','select exclude deps'])
|
32
|
+
o.push(['--podfile','select deps version from podfile'])
|
33
|
+
o.push(['--platform','select platform'])
|
34
|
+
o.concat(super)
|
35
|
+
end
|
36
|
+
rescue
|
37
|
+
return
|
29
38
|
end
|
39
|
+
|
30
40
|
|
31
41
|
end
|
32
42
|
|
@@ -35,13 +45,40 @@ module Pod
|
|
35
45
|
@all_deps = argv.flag?('all-deps',false)
|
36
46
|
@select_archs = argv.option('archs','').split(',')
|
37
47
|
@black_deps = argv.option('black-deps','').split(',')
|
48
|
+
@podfile = argv.option('podfile','')
|
49
|
+
@platform = argv.option('platform','')
|
38
50
|
initialize_t argv
|
39
51
|
end
|
40
52
|
|
53
|
+
alias build_package_t build_package
|
54
|
+
def build_package
|
55
|
+
if @platform == ''
|
56
|
+
build_package_t
|
57
|
+
else
|
58
|
+
builder = SpecBuilder.new(@spec, @source, @embedded, @dynamic)
|
59
|
+
newspec = builder.spec_metadata
|
60
|
+
|
61
|
+
@spec.available_platforms.each do |platform|
|
62
|
+
if @platform.include?(platform.name.to_s)
|
63
|
+
UI.puts 'build package platform:'+platform.name.to_s
|
64
|
+
build_in_sandbox(platform)
|
65
|
+
newspec += builder.spec_platform(platform)
|
66
|
+
else
|
67
|
+
UI.puts 'jump build platforms:'+platform.to_s
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
newspec += builder.spec_close
|
72
|
+
File.open(@spec.name + '.podspec', 'w') { |file| file.write(newspec) }
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
end
|
41
78
|
|
42
79
|
alias perform_build_t perform_build
|
43
|
-
def perform_build(platform, static_sandbox, dynamic_sandbox)
|
44
|
-
if @all_deps
|
80
|
+
def perform_build(platform, static_sandbox, dynamic_sandbox,static_installer)
|
81
|
+
if @all_deps || @select_archs.length > 0
|
45
82
|
static_sandbox_root = config.sandbox_root.to_s
|
46
83
|
|
47
84
|
if @dynamic
|
@@ -50,28 +87,30 @@ module Pod
|
|
50
87
|
end
|
51
88
|
|
52
89
|
builder = Pod::Builder.new(
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
90
|
+
platform,
|
91
|
+
static_installer,
|
92
|
+
@source_dir,
|
93
|
+
static_sandbox_root,
|
94
|
+
dynamic_sandbox_root,
|
95
|
+
static_sandbox.public_headers.root,
|
96
|
+
@spec,
|
97
|
+
@embedded,
|
98
|
+
@mangle,
|
99
|
+
@dynamic,
|
100
|
+
@config,
|
101
|
+
@bundle_identifier,
|
102
|
+
@exclude_deps,
|
103
|
+
@all_deps,
|
104
|
+
@black_deps,
|
105
|
+
@select_archs
|
67
106
|
)
|
68
107
|
|
69
|
-
builder.build(
|
108
|
+
builder.build(@package_type)
|
70
109
|
|
71
110
|
return unless @embedded
|
72
111
|
builder.link_embedded_resources
|
73
112
|
else
|
74
|
-
perform_build_t(platform,static_sandbox,dynamic_sandbox)
|
113
|
+
perform_build_t(platform,static_sandbox,dynamic_sandbox,static_installer)
|
75
114
|
end
|
76
115
|
end
|
77
116
|
|
@@ -2,7 +2,7 @@ require "fileutils"
|
|
2
2
|
|
3
3
|
module Pod
|
4
4
|
class Builder
|
5
|
-
|
5
|
+
#移动资源文件和静态库文件到build目录
|
6
6
|
def deal_target(path)
|
7
7
|
for item in @target_type_ext
|
8
8
|
if File.extname(path) == item
|
@@ -15,12 +15,16 @@ module Pod
|
|
15
15
|
if isBlack
|
16
16
|
return
|
17
17
|
end
|
18
|
+
begin
|
18
19
|
if File.directory? path
|
19
20
|
FileUtils.copy_entry(path,"#{@target_dir_ext_ext}/#{File.basename(path)}", false,false, true)
|
20
21
|
else
|
21
22
|
FileUtils.cp(path,"#{@target_dir_ext_ext}/#{File.basename(path)}")
|
22
|
-
end
|
23
|
-
|
23
|
+
end
|
24
|
+
rescue Exception => e
|
25
|
+
puts e
|
26
|
+
end
|
27
|
+
return
|
24
28
|
end
|
25
29
|
end
|
26
30
|
if File.directory? path
|
@@ -43,37 +47,12 @@ module Pod
|
|
43
47
|
end
|
44
48
|
end
|
45
49
|
|
46
|
-
alias build_library_t build_library
|
47
|
-
def build_library(platform, defines, output)
|
48
|
-
deal_target(@static_sandbox_root)
|
49
|
-
|
50
|
-
|
51
|
-
build_library_t platform,defines,output
|
52
|
-
end
|
53
|
-
|
54
|
-
alias ios_build_options_t ios_build_options
|
55
|
-
def ios_build_options
|
56
|
-
if @select_archs.size != 0
|
57
|
-
return "ARCHS=\'#{@select_archs.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
|
58
|
-
else
|
59
|
-
return "ARCHS=\'x86_64 i386 arm64 armv7\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
|
60
|
-
end
|
61
|
-
end
|
62
50
|
|
63
|
-
alias
|
64
|
-
def
|
65
|
-
|
66
|
-
return
|
67
|
-
else
|
68
|
-
UI.puts 'start build sim'
|
69
|
-
build_sim_libraries_t platform,defines
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
alias build_static_lib_for_ios_t build_static_lib_for_ios
|
74
|
-
def build_static_lib_for_ios(static_libs, _defines, output)
|
51
|
+
alias build_static_library_for_ios_t build_static_library_for_ios
|
52
|
+
def build_library(output)
|
53
|
+
deal_target(@static_sandbox_root)
|
75
54
|
if @all_deps
|
76
|
-
|
55
|
+
static_libs = static_libs_in_sandbox('build')
|
77
56
|
sim_libs = static_libs_in_sandbox('build-sim')
|
78
57
|
for item in @black_deps
|
79
58
|
static_libs.delete_if do |obj|
|
@@ -86,20 +65,46 @@ module Pod
|
|
86
65
|
UI.puts "links statics:#{static_libs.join(' ')}, sim_libs:#{sim_libs.join(' ')}"
|
87
66
|
`xcrun -r libtool -no_warning_for_no_symbols -static -o #{output} #{static_libs.join(' ')} #{sim_libs.join(' ')}`
|
88
67
|
else
|
89
|
-
|
68
|
+
build_static_library_for_ios output
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# alias ios_build_options_t ios_build_options
|
73
|
+
# def ios_build_options
|
74
|
+
# if @select_archs.size != 0
|
75
|
+
# return "ARCHS=\'#{@select_archs.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
|
76
|
+
# else
|
77
|
+
# return ios_build_options_t
|
78
|
+
# end
|
79
|
+
# end
|
80
|
+
alias ios_architectures_t ios_architectures
|
81
|
+
def ios_architectures
|
82
|
+
if @select_archs.size != 0
|
83
|
+
return @select_archs
|
84
|
+
else
|
85
|
+
return ios_architectures_t
|
90
86
|
end
|
91
|
-
|
87
|
+
end
|
88
|
+
|
89
|
+
alias build_sim_libraries_t build_sim_libraries
|
90
|
+
def build_sim_libraries(defines)
|
91
|
+
if @select_archs.size != 0 && !@select_archs.include?('i386') && !@select_archs.include?('x86_64')
|
92
|
+
return
|
93
|
+
else
|
94
|
+
UI.puts 'start build sim'
|
95
|
+
build_sim_libraries_t defines
|
96
|
+
end
|
92
97
|
end
|
93
98
|
|
94
99
|
alias initialize_t initialize
|
95
|
-
def initialize(source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps,
|
100
|
+
def initialize(platform, static_installer, source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps,all_deps= false ,black_deps=[],select_archs=[])
|
96
101
|
@all_deps = all_deps
|
97
102
|
@black_deps = black_deps
|
98
103
|
@select_archs = select_archs
|
99
104
|
@target_type_ext = ['.a','.bundle']
|
100
105
|
@target_dir_ext_ext = "#{static_sandbox_root}/build"
|
101
106
|
@black_list_ext = ["#{static_sandbox_root}/build","#{static_sandbox_root}/build-sim"]
|
102
|
-
initialize_t(source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps)
|
107
|
+
initialize_t(platform, static_installer,source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps)
|
103
108
|
end
|
104
109
|
end
|
105
110
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'cocoapods-downloader/remote_file'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
module Downloader
|
5
|
+
class LocalPath < RemoteFile
|
6
|
+
DEFAULT_PORT = 22
|
7
|
+
|
8
|
+
private
|
9
|
+
|
10
|
+
executable :ln
|
11
|
+
|
12
|
+
def download_file(full_filename)
|
13
|
+
|
14
|
+
ln! "-s",url, full_filename
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Pod
|
2
|
+
module Downloader
|
3
|
+
autoload :LocalPath,'cocoapods-packager-ext/ext/downloader/lnpath'
|
4
|
+
class << self
|
5
|
+
alias downloader_class_by_key_t downloader_class_by_key
|
6
|
+
def downloader_class_by_key
|
7
|
+
keys = downloader_class_by_key_t
|
8
|
+
keys[:lnpath] = LocalPath
|
9
|
+
return keys
|
10
|
+
end
|
11
|
+
end
|
12
|
+
class RemoteFile
|
13
|
+
executable :ln
|
14
|
+
|
15
|
+
alias filename_with_type_t filename_with_type
|
16
|
+
def filename_with_type(type = :zip)
|
17
|
+
if not type
|
18
|
+
"file"
|
19
|
+
else
|
20
|
+
filename_with_type_t type
|
21
|
+
end
|
22
|
+
end
|
23
|
+
alias extract_with_type_t extract_with_type
|
24
|
+
def extract_with_type(full_filename, type = :zip)
|
25
|
+
if not type
|
26
|
+
unpack_from = url
|
27
|
+
unpack_to = @target_path
|
28
|
+
FileUtils.rm_rf(unpack_to) if File.exist?(unpack_to)
|
29
|
+
FileUtils.rm_rf(unpack_to) if Dir.exist?(unpack_to)
|
30
|
+
ln! '-s',unpack_from,unpack_to
|
31
|
+
else
|
32
|
+
extract_with_type_t full_filename,type
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-packager-ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kyle.zhou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: cocoapods-packager
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
type: :
|
47
|
+
version: 1.5.1
|
48
|
+
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 1.5.1
|
55
55
|
description: A short description of cocoapods-packager-ext.
|
56
56
|
email:
|
57
57
|
- kyle.zhou@qq.com
|
@@ -70,6 +70,8 @@ files:
|
|
70
70
|
- lib/cocoapods-packager-ext/command/install_ext.rb
|
71
71
|
- lib/cocoapods-packager-ext/command/package_ext.rb
|
72
72
|
- lib/cocoapods-packager-ext/ext/builder.rb
|
73
|
+
- lib/cocoapods-packager-ext/ext/downloader/lnpath.rb
|
74
|
+
- lib/cocoapods-packager-ext/ext/downloader_ext.rb
|
73
75
|
- lib/cocoapods-packager-ext/gem_version.rb
|
74
76
|
- lib/cocoapods_plugin.rb
|
75
77
|
- spec/command/ext_spec.rb
|