cocoapods-dykit 0.3.1 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e86e26bdf418b936f1436c4dbded1363ebee8a77
4
- data.tar.gz: 6052c4c46f3d94c7af19df146b61576168b86d45
3
+ metadata.gz: b051ed50ac8438ec738e883adfd25ef1f18f0289
4
+ data.tar.gz: da3ea5f10c18dae46cad5390e56351d12b39ba1d
5
5
  SHA512:
6
- metadata.gz: e68c4a783150cc1b509487cc19987d5bd254159a51d5b4df0c536b9589a2bd1b3c1871394afa8720bd33555096dc298ff20f4ff2537c6ac947810dbf77145039
7
- data.tar.gz: 2ee27311ae8d5a023bb465c40ec8e5dff00fcb781bec60aff2ac79fb3574f80836cb02e925aca83a77b72acd304d2a9897a50496c16b780fb10ef37f4bd83937
6
+ metadata.gz: 994f1feff06f59e7d46aecdb33148a6639c5bd81445d384d5372fd59cbd7019b27671ac3747f1f95558c81a8005c2c538ef976931c0a0e530ce2ae0f1ded60c0
7
+ data.tar.gz: c42e4ae8d9f3e3fdc014b9fe8a6e7ff98533753528fb95e3675cc1ee75c36e2a594fbc69aedac5213034a4bc19170385e6a4719ea4aec63fe21c71c07282c2ed
data/README.md CHANGED
@@ -15,11 +15,11 @@
15
15
  $ pod lib dylint --sources=douyu,douyu-beijing,master --use-libraries --allow-warnings
16
16
 
17
17
  # 验证动态库
18
- pod lib dylint --sources=douyu,douyu-beijing,master --allow-warnings
18
+ $ pod lib dylint --sources=douyu,douyu-beijing,master --allow-warnings
19
19
 
20
20
  # 推送静态库
21
- pod repo dypush douyu --use-libraries --allow-warnings --sources=douyu,douyu-beijing,master
21
+ $ pod repo dypush douyu --use-libraries --allow-warnings --sources=douyu,douyu-beijing,master
22
22
 
23
23
  # 推送动态库
24
- pod repo dypush douyu --allow-warnings --sources=douyu,douyu-beijing,master
24
+ $ pod repo dypush douyu --allow-warnings --sources=douyu,douyu-beijing,master
25
25
  ~~~
data/lib/pod/command.rb CHANGED
@@ -1,2 +1,4 @@
1
1
  require 'pod/command/lib/dylint'
2
2
  require 'pod/command/repo/dypush'
3
+ require 'pod/command/fmwk/create'
4
+ require 'pod/command/fmwk/build'
@@ -0,0 +1,159 @@
1
+ module Pod
2
+ class Command
3
+ # This is an example of a cocoapods plugin adding a top-level subcommand
4
+ # to the 'pod' command.
5
+ #
6
+ # You can also create subcommands of existing or new commands. Say you
7
+ # wanted to add a subcommand to `list` to show newly deprecated pods,
8
+ # (e.g. `pod list deprecated`), there are a few things that would need
9
+ # to change.
10
+ #
11
+ # - move this file to `lib/pod/command/list/deprecated.rb` and update
12
+ # the class to exist in the the Pod::Command::List namespace
13
+ # - change this class to extend from `List` instead of `Command`. This
14
+ # tells the plugin system that it is a subcommand of `list`.
15
+ # - edit `lib/cocoapods_plugins.rb` to require this file
16
+ #
17
+ # @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
18
+ # in the `plugins.json` file, once your plugin is released.
19
+ #
20
+ class Fmwk < Command
21
+ class Build < Fmwk
22
+ self.summary = 'Build framework!'
23
+
24
+ self.description = <<-DESC
25
+ Build framework...!
26
+ DESC
27
+
28
+ def self.options
29
+ [
30
+ ['--workspace', '构建 workspace,若不指定,默认为构建 project'],
31
+ # ['--allow-warnings', 'Lint validates even if warnings are present'],
32
+ # ['--subspec=NAME', 'Lint validates only the given subspec'],
33
+ # ['--no-subspecs', 'Lint skips validation of subspecs'],
34
+ # ['--no-clean', 'Lint leaves the build directory intact for inspection'],
35
+ # ['--fail-fast', 'Lint stops on the first failing platform or subspec'],
36
+ # ['--use-libraries', 'Lint uses static libraries to install the spec'],
37
+ # ['--sources=https://github.com/artsy/Specs,master', 'The sources from which to pull dependent pods ' \
38
+ # '(defaults to https://github.com/CocoaPods/Specs.git). ' \
39
+ # 'Multiple sources must be comma-delimited.'],
40
+ # ['--private', 'Lint skips checks that apply only to public specs'],
41
+ # ['--swift-version=VERSION', 'The SWIFT_VERSION that should be used to lint the spec. ' \
42
+ # 'This takes precedence over a .swift-version file.'],
43
+ # ['--skip-import-validation', 'Lint skips validating that the pod can be imported'],
44
+ # ['--skip-tests', 'Lint skips building and running tests during validation'],
45
+ ].concat(super)
46
+ end
47
+
48
+ def initialize(argv)
49
+ @workspace = argv.flag?('workspace')
50
+ # @allow_warnings = argv.flag?('allow-warnings')
51
+ # @clean = argv.flag?('clean', true)
52
+ # @fail_fast = argv.flag?('fail-fast', false)
53
+ # @subspecs = argv.flag?('subspecs', true)
54
+ # @only_subspec = argv.option('subspec')
55
+ # @use_frameworks = !argv.flag?('use-libraries')
56
+ # @source_urls = argv.option('sources', 'https://github.com/CocoaPods/Specs.git').split(',')
57
+ # @private = argv.flag?('private', false)
58
+ # @swift_version = argv.option('swift-version', nil)
59
+ # @skip_import_validation = argv.flag?('skip-import-validation', false)
60
+ # @skip_tests = argv.flag?('skip-tests', false)
61
+ @framework_names = argv.arguments!
62
+ super
63
+ end
64
+
65
+ def validate!
66
+ super
67
+ end
68
+
69
+ def run
70
+ framework_names.each do |podspec|
71
+ `rm -rf #{build_path}` unless !Dir.exist?(build_path)
72
+
73
+ puts "打真机包..."
74
+ puts
75
+
76
+ output = xcodebuild(podspec)
77
+ puts output
78
+ puts
79
+
80
+ puts "打模拟器包..."
81
+ puts
82
+ output = xcodebuild(podspec, :iphonesimulator)
83
+ puts output
84
+ puts
85
+ puts "生成合成包..."
86
+ puts
87
+ `lipo #{derived_data_path}/#{podspec}/Build/Products/Release-iphoneos/#{podspec}.framework/#{podspec} #{derived_data_path}/#{podspec}/Build/Products/Release-iphonesimulator/#{podspec}.framework/#{podspec} -create -output #{build_path}/#{podspec}`
88
+ `cp -r #{derived_data_path}/#{podspec}/Build/Products/Release-iphoneos/#{podspec}.framework #{build_path}/`
89
+ `cp -f #{build_path}/#{podspec} #{build_path}/#{podspec}.framework/`
90
+ `rm #{build_path}/#{podspec}`
91
+ puts "成功输出 framework 于 #{build_path}/#{podspec}.framework/"
92
+ puts
93
+ end
94
+ end
95
+
96
+ private
97
+
98
+ #----------------------------------------#
99
+
100
+ # !@group Private helpers
101
+
102
+ # @return [Pathname] The path of the podspec found in the current
103
+ # working directory.
104
+ #
105
+ # @raise If no podspec is found.
106
+ # @raise If multiple podspecs are found.
107
+ #
108
+ def framework_names
109
+ if !@framework_names.empty?
110
+ Array(@framework_names)
111
+ else
112
+ raise Informative, 'Please type in a framework name!'
113
+ end
114
+ end
115
+
116
+ def derived_data_path
117
+ path = Dir.home + '/Documents/Temp/DerivedData'
118
+ `mkdir -p #{path}` unless Dir.exist?(path)
119
+ path
120
+ end
121
+
122
+ def build_path
123
+ path = Dir.pwd + '/build'
124
+ `mkdir -p #{path}` unless Dir.exist?(path)
125
+ path
126
+ end
127
+
128
+ def xcodebuild(target, type = :iphoneos, clean = true)
129
+ if clean
130
+ command = %W(clean build)
131
+ else
132
+ command = []
133
+ end
134
+
135
+ if @workspace
136
+ command += %W(-workspace #{target}.xcworkspace)
137
+ else
138
+ command += %W(-project #{target}.xcodeproj)
139
+ end
140
+ command += %W(-scheme #{target} -configuration Release -derivedDataPath #{derived_data_path}/#{target})
141
+ case type
142
+ when :iphoneos then command += %W(-sdk iphoneos)
143
+ when :iphonesimulator then command += %W(-sdk iphonesimulator)
144
+ end
145
+ # command += %W(| xcpretty)
146
+ output, status = _xcodebuild(command)
147
+ output
148
+ end
149
+
150
+ def _xcodebuild(command)
151
+ UI.puts 'xcodebuild ' << command.join(' ') if config.verbose
152
+ # Executable.capture_command('xcodebuild', command, :capture => :merge)
153
+ require 'open3'
154
+ Open3.pipeline('xcodebuild ' << command.join(' '), 'xcpretty')
155
+ end
156
+ end
157
+ end
158
+ end
159
+ end
@@ -1,5 +1,3 @@
1
- # require File.expand_path('../validator.rb', __FILE__)
2
- require 'validator'
3
1
  module Pod
4
2
  class Command
5
3
  # This is an example of a cocoapods plugin adding a top-level subcommand
@@ -70,39 +68,17 @@ module Pod
70
68
 
71
69
  def run
72
70
  UI.puts
73
- podspecs_to_lint.each do |podspec|
74
- validator = Pod::DyValidator.new(podspec, @source_urls)
75
- validator.local = true
76
- validator.quick = @quick
77
- validator.no_clean = !@clean
78
- validator.fail_fast = @fail_fast
79
- validator.allow_warnings = @allow_warnings
80
- validator.no_subspecs = !@subspecs || @only_subspec
81
- validator.only_subspec = @only_subspec
82
- validator.use_frameworks = @use_frameworks
83
- validator.ignore_public_only_results = @private
84
- validator.swift_version = @swift_version
85
- validator.skip_import_validation = @skip_import_validation
86
- validator.skip_tests = @skip_tests
87
- validator.validate
88
-
89
- unless @clean
90
- UI.puts "Pods workspace available at `#{validator.validation_dir}/App.xcworkspace` for inspection."
91
- UI.puts
92
- end
93
- if validator.validated?
94
- UI.puts "#{validator.spec.name} passed validation.".green
95
- else
96
- spec_name = podspec
97
- spec_name = validator.spec.name if validator.spec
98
- message = "#{spec_name} did not pass validation, due to #{validator.failure_reason}."
99
-
100
- if @clean
101
- message << "\nYou can use the `--no-clean` option to inspect " \
102
- 'any issue.'
103
- end
104
- raise Informative, message
105
- end
71
+ framework_names.each do |podspec|
72
+ puts "开始创建 framework 工程 #{podspec}"
73
+ puts "创建目录..."
74
+ `mkdir -p \`pwd\`/#{podspec}/#{podspec}`
75
+ puts "下载模板..."
76
+ `curl http://gitlab.douyuios.com/huangluyang/my-shells/raw/master/framework_template.podspec -o #{podspec}/#{podspec}.podspec`
77
+ `curl http://gitlab.douyuios.com/huangluyang/my-shells/raw/master/LICENSE_template -o #{podspec}/#{podspec}/LICENSE`
78
+ puts "填充模板..."
79
+ `sed -i '' "s/<#lib name#>/#{podspec}/g" #{podspec}/#{podspec}.podspec`
80
+ puts "创建 framework 工程 #{podspec} 成功!"
81
+ puts ""
106
82
  end
107
83
  end
108
84
 
@@ -118,16 +94,11 @@ module Pod
118
94
  # @raise If no podspec is found.
119
95
  # @raise If multiple podspecs are found.
120
96
  #
121
- def podspecs_to_lint
122
- if !@podspecs_paths.empty?
123
- Array(@podspecs_paths)
97
+ def framework_names
98
+ if !@framework_names.empty?
99
+ Array(@framework_names)
124
100
  else
125
- podspecs = Pathname.glob(Pathname.pwd + '*.podspec{.json,}')
126
- if podspecs.count.zero?
127
- raise Informative, 'Unable to find a podspec in the working ' \
128
- 'directory'
129
- end
130
- podspecs
101
+ raise Informative, 'Please type in a framework name!'
131
102
  end
132
103
  end
133
104
  end
@@ -0,0 +1,159 @@
1
+ module Pod
2
+ class Command
3
+ # This is an example of a cocoapods plugin adding a top-level subcommand
4
+ # to the 'pod' command.
5
+ #
6
+ # You can also create subcommands of existing or new commands. Say you
7
+ # wanted to add a subcommand to `list` to show newly deprecated pods,
8
+ # (e.g. `pod list deprecated`), there are a few things that would need
9
+ # to change.
10
+ #
11
+ # - move this file to `lib/pod/command/list/deprecated.rb` and update
12
+ # the class to exist in the the Pod::Command::List namespace
13
+ # - change this class to extend from `List` instead of `Command`. This
14
+ # tells the plugin system that it is a subcommand of `list`.
15
+ # - edit `lib/cocoapods_plugins.rb` to require this file
16
+ #
17
+ # @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
18
+ # in the `plugins.json` file, once your plugin is released.
19
+ #
20
+ class Fmwk < Command
21
+ class Build < Fmwk
22
+ self.summary = 'Build framework!'
23
+
24
+ self.description = <<-DESC
25
+ Build framework...!
26
+ DESC
27
+
28
+ def self.options
29
+ [
30
+ ['--workspace', '构建 workspace,若不指定,默认为构建 project'],
31
+ # ['--allow-warnings', 'Lint validates even if warnings are present'],
32
+ # ['--subspec=NAME', 'Lint validates only the given subspec'],
33
+ # ['--no-subspecs', 'Lint skips validation of subspecs'],
34
+ # ['--no-clean', 'Lint leaves the build directory intact for inspection'],
35
+ # ['--fail-fast', 'Lint stops on the first failing platform or subspec'],
36
+ # ['--use-libraries', 'Lint uses static libraries to install the spec'],
37
+ # ['--sources=https://github.com/artsy/Specs,master', 'The sources from which to pull dependent pods ' \
38
+ # '(defaults to https://github.com/CocoaPods/Specs.git). ' \
39
+ # 'Multiple sources must be comma-delimited.'],
40
+ # ['--private', 'Lint skips checks that apply only to public specs'],
41
+ # ['--swift-version=VERSION', 'The SWIFT_VERSION that should be used to lint the spec. ' \
42
+ # 'This takes precedence over a .swift-version file.'],
43
+ # ['--skip-import-validation', 'Lint skips validating that the pod can be imported'],
44
+ # ['--skip-tests', 'Lint skips building and running tests during validation'],
45
+ ].concat(super)
46
+ end
47
+
48
+ def initialize(argv)
49
+ @workspace = argv.flag?('workspace')
50
+ # @allow_warnings = argv.flag?('allow-warnings')
51
+ # @clean = argv.flag?('clean', true)
52
+ # @fail_fast = argv.flag?('fail-fast', false)
53
+ # @subspecs = argv.flag?('subspecs', true)
54
+ # @only_subspec = argv.option('subspec')
55
+ # @use_frameworks = !argv.flag?('use-libraries')
56
+ # @source_urls = argv.option('sources', 'https://github.com/CocoaPods/Specs.git').split(',')
57
+ # @private = argv.flag?('private', false)
58
+ # @swift_version = argv.option('swift-version', nil)
59
+ # @skip_import_validation = argv.flag?('skip-import-validation', false)
60
+ # @skip_tests = argv.flag?('skip-tests', false)
61
+ @framework_names = argv.arguments!
62
+ super
63
+ end
64
+
65
+ def validate!
66
+ super
67
+ end
68
+
69
+ def run
70
+ framework_names.each do |podspec|
71
+ `rm -rf #{build_path}` unless !Dir.exist?(build_path)
72
+
73
+ puts "打真机包..."
74
+ puts
75
+
76
+ output = xcodebuild(podspec)
77
+ puts output
78
+ puts
79
+
80
+ puts "打模拟器包..."
81
+ puts
82
+ output = xcodebuild(podspec, :iphonesimulator)
83
+ puts output
84
+ puts
85
+ puts "生成合成包..."
86
+ puts
87
+ `lipo #{derived_data_path}/#{podspec}/Build/Products/Release-iphoneos/#{podspec}.framework/#{podspec} #{derived_data_path}/#{podspec}/Build/Products/Release-iphonesimulator/#{podspec}.framework/#{podspec} -create -output #{build_path}/#{podspec}`
88
+ `cp -r #{derived_data_path}/#{podspec}/Build/Products/Release-iphoneos/#{podspec}.framework #{build_path}/`
89
+ `cp -f #{build_path}/#{podspec} #{build_path}/#{podspec}.framework/`
90
+ `rm #{build_path}/#{podspec}`
91
+ puts "成功输出 framework 于 #{build_path}/#{podspec}.framework/"
92
+ puts
93
+ end
94
+ end
95
+
96
+ private
97
+
98
+ #----------------------------------------#
99
+
100
+ # !@group Private helpers
101
+
102
+ # @return [Pathname] The path of the podspec found in the current
103
+ # working directory.
104
+ #
105
+ # @raise If no podspec is found.
106
+ # @raise If multiple podspecs are found.
107
+ #
108
+ def framework_names
109
+ if !@framework_names.empty?
110
+ Array(@framework_names)
111
+ else
112
+ raise Informative, 'Please type in a framework name!'
113
+ end
114
+ end
115
+
116
+ def derived_data_path
117
+ path = Dir.home + '/Documents/Temp/DerivedData'
118
+ `mkdir -p #{path}` unless Dir.exist?(path)
119
+ path
120
+ end
121
+
122
+ def build_path
123
+ path = Dir.pwd + '/build'
124
+ `mkdir -p #{path}` unless Dir.exist?(path)
125
+ path
126
+ end
127
+
128
+ def xcodebuild(target, type = :iphoneos, clean = true)
129
+ if clean
130
+ command = %W(clean build)
131
+ else
132
+ command = []
133
+ end
134
+
135
+ if @workspace
136
+ command += %W(-workspace #{target}.xcworkspace)
137
+ else
138
+ command += %W(-project #{target}.xcodeproj)
139
+ end
140
+ command += %W(-scheme #{target} -configuration Release -derivedDataPath #{derived_data_path}/#{target})
141
+ case type
142
+ when :iphoneos then command += %W(-sdk iphoneos)
143
+ when :iphonesimulator then command += %W(-sdk iphonesimulator)
144
+ end
145
+ # command += %W(| xcpretty)
146
+ output, status = _xcodebuild(command)
147
+ output
148
+ end
149
+
150
+ def _xcodebuild(command)
151
+ UI.puts 'xcodebuild ' << command.join(' ') if config.verbose
152
+ # Executable.capture_command('xcodebuild', command, :capture => :merge)
153
+ require 'open3'
154
+ Open3.pipeline('xcodebuild ' << command.join(' '), 'xcpretty')
155
+ end
156
+ end
157
+ end
158
+ end
159
+ end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsDylint
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/validator.rb CHANGED
@@ -444,7 +444,6 @@ module Pod
444
444
  c.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = 'match Development *'
445
445
  c.build_settings['CODE_SIGN_IDENTITY'] = 'iPhone Developer'
446
446
  c.build_settings['DEVELOPMENT_TEAM'] = 'KW288R5J73'
447
- c.build_settings['ENABLE_BITCODE'] = false
448
447
  end
449
448
  app_project.save
450
449
  app_project.recreate_user_schemes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-dykit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 黄露洋
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-08 00:00:00.000000000 Z
11
+ date: 2018-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -75,7 +75,9 @@ files:
75
75
  - lib/cocoapods_plugin.rb
76
76
  - lib/pod/command.rb
77
77
  - lib/pod/command/fmwk.rb
78
+ - lib/pod/command/fmwk/build.rb
78
79
  - lib/pod/command/fmwk/create.rb
80
+ - lib/pod/command/fmwk/upload.rb
79
81
  - lib/pod/command/lib/dylint.rb
80
82
  - lib/pod/command/repo/dypush.rb
81
83
  - lib/pod/gem_version.rb
@@ -109,4 +111,3 @@ summary: Validates the Pod using the files in the working directory without simu
109
111
  test_files:
110
112
  - spec/command/dylint_spec.rb
111
113
  - spec/spec_helper.rb
112
- has_rdoc: