bootsetting 0.1.5 → 0.1.6

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
- SHA1:
3
- metadata.gz: 5fa77742934b7e7cbeba9a20761a574995c8a019
4
- data.tar.gz: ea05fc20c020953168fa8af69a5da54b9a97df06
2
+ SHA256:
3
+ metadata.gz: 2ed580627cbba9b5684dfed8af19370056517b9e8e532f4949d91dbfad1752a8
4
+ data.tar.gz: 343fedbf1a0115ed8be3fdccdd668fbe599d832a3cbe84b13c72f94e0e7caf0f
5
5
  SHA512:
6
- metadata.gz: ba61bfd1e8dfe91d3f2ad215c1554460d2c12902727eedb841e280b71181200d770836eb11970677c1286439dc0554227a836cad5cd8583a01b6f76d1734c15e
7
- data.tar.gz: ed9bb6aa628c0bbad9cd9f152464c16bb9aa2dce9dc30bb4e5a7f382450b721069e67ad9f1fb654a69c04bd88d15e3112c642d50e9f9e85ce4c47cb7f3e0438d
6
+ metadata.gz: d1c3d42910a84cec3107139b700f7c81c2c6ed78fd20432e4a90996441b84183144f7cd446972a21ed3c8459f8fa13bfc0ddb2b39c603251c04fd74ad00fd33a
7
+ data.tar.gz: 6dc4bdeed2aea02e43fbdab2b82da8341a0015130a327eb77913427c3efdab37e3c3c58da8454ad335855c15fad0391e8fd6c749b6076ca45fb6d951132ab1d8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bootsetting (0.1.4)
4
+ bootsetting (0.1.6)
5
5
  colored2
6
6
  rainbow
7
7
  thor
@@ -21,7 +21,7 @@ DEPENDENCIES
21
21
  bootsetting!
22
22
  bundler (~> 2.0.1)
23
23
  rainbow
24
- rake (~> 10.0)
24
+ rake (~> 10.5.0)
25
25
  thor
26
26
 
27
27
  BUNDLED WITH
@@ -0,0 +1,28 @@
1
+ require 'xcodeproj'
2
+ require 'FileUtils'
3
+ # See: https://www.rubydoc.info/gems/xcodeproj/Xcodeproj
4
+ # Get project object
5
+ project_path = 'your_project_dir/Pods/Pods.xcodeproj'
6
+
7
+ project = Xcodeproj::Project.open(project_path)
8
+
9
+ lib_dir = "your_libs_dir/lib/Release";
10
+
11
+ # puts libRef
12
+ project.targets.each do |target|
13
+ if target.name == "QYACG"
14
+ # puts target.name
15
+ # Get the build phase
16
+ framework_buildphase = target.frameworks_build_phases
17
+ # puts framework_buildphase
18
+ # Add it to the build phase
19
+ Dir[lib_dir + "/**/*.{a}"].each do |lib_path|
20
+ # Add the lib file as a reference
21
+ libRef = project['Frameworks'].new_file(lib_path)
22
+ file_ref = framework_buildphase.add_file_reference(libRef)
23
+ # puts file_ref.pretty_print
24
+ end
25
+ end
26
+ end
27
+ # Save the project
28
+ project.save();
@@ -1,3 +1,3 @@
1
1
  module Bootsetting
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
data/lib/bootsetting.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "bootsetting/version"
2
2
  require "resourcesCopy"
3
+ require "duplicate_file_check"
3
4
  require 'rainbow/refinement'
4
5
  require "thor"
5
6
  using Rainbow
@@ -13,6 +14,13 @@ class CLI < Thor
13
14
  puts "from: #{from}" if from
14
15
  puts "Hello method #{name}".bright.red
15
16
  end
17
+ # duplicate file check
18
+ desc "type", "suffix of each file"
19
+ def dfc(type, suffix)
20
+ puts "start to check ...".bright.red
21
+ helper = FileCheckHelper.new()
22
+ helper.check(type, suffix)
23
+ end
16
24
 
17
25
  desc "UserKeyMapping", "say hello to new keyMapping"
18
26
  def kswitch()
@@ -0,0 +1,33 @@
1
+ require 'xcodeproj'
2
+ require 'FileUtils'
3
+ # See: https://www.rubydoc.info/gems/xcodeproj/Xcodeproj
4
+ # Get project object
5
+
6
+ super_dir = File.expand_path('../../', __FILE__)
7
+ project_path = "#{super_dir}/qiyivideo2/QiYiVideo.xcodeproj"
8
+ puts project_path
9
+ project = Xcodeproj::Project.open(project_path)
10
+ # 删除多余的 output_path
11
+ project.targets.each do |target|
12
+ if target.name == "QiYiVideo"
13
+ puts target.name
14
+ # Get the build phase
15
+ shell_script_build_phases = target.shell_script_build_phases
16
+ shell_script_build_phases.each do |shellScriptBuildPhase|
17
+ if shellScriptBuildPhase.name == "[CP] Copy Pods Resources"
18
+ puts shellScriptBuildPhase.name
19
+ output_paths = shellScriptBuildPhase.output_paths
20
+ puts output_paths
21
+ output_paths.each do |output_path|
22
+ puts output_path
23
+ if output_path.include? "Assets.car"
24
+ output_paths.delete(output_path)
25
+ end
26
+ end
27
+ shellScriptBuildPhase.output_paths = output_paths
28
+ end
29
+ end
30
+ end
31
+ end
32
+ # Save the project
33
+ project.save();
@@ -0,0 +1,41 @@
1
+ require 'FileUtils'
2
+ require 'digest/md5'
3
+
4
+ class FileCheckHelper
5
+ # desc "Copying files from acgn_ios_plugin to acgn_ios_plugin_pod folder"
6
+
7
+ # desc "Instance"
8
+ def initialize()
9
+ end
10
+
11
+ # duplicate file check
12
+ def check(type, suffix)
13
+ # specify files which should not be copied
14
+ super_dir = File.expand_path('../', __FILE__)
15
+ fileNames = []
16
+ files = Dir[super_dir + "/**/*.{#{suffix}}"]
17
+ files.each do |old_dest|
18
+ fileNames.push(File.basename(old_dest))
19
+ end
20
+ fileMaps = Hash.new([])
21
+ files.each { |filePath|
22
+ key = ""
23
+ if type == "md5"
24
+ key = md5 = Digest::MD5.hexdigest(File.read(filePath))
25
+ elsif type == "name"
26
+ key = File.basename(filePath)
27
+ end
28
+ fileArr = [] + fileMaps[key]
29
+ fileMaps[key] = fileArr.push(filePath)
30
+ }
31
+ fileMaps.each {|key, value|
32
+ if value.count > 1
33
+ puts "#{key} repeat count: #{value.count}"
34
+ fileArr = [] + value
35
+ fileArr.each { |filePath|
36
+ puts "#{filePath}"
37
+ }
38
+ end
39
+ }
40
+ end
41
+ end
data/lib/resourcesCopy.rb CHANGED
@@ -30,5 +30,5 @@ class CopyHelper
30
30
  end
31
31
  end
32
32
  end
33
- end
33
+ end
34
34
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootsetting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - CNKCQ
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-11 00:00:00.000000000 Z
11
+ date: 2019-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored2
@@ -127,8 +127,11 @@ files:
127
127
  - bin/bs
128
128
  - bin/setup
129
129
  - bootsetting.gemspec
130
+ - lib/add_lib_with_xcodeproj.rb
130
131
  - lib/bootsetting.rb
131
132
  - lib/bootsetting/version.rb
133
+ - lib/delete_output_path.rb
134
+ - lib/duplicate_file_check.rb
132
135
  - lib/resourcesCopy.rb
133
136
  homepage: https://github.com/CNKCQ/bootsetting.git
134
137
  licenses:
@@ -150,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
153
  - !ruby/object:Gem::Version
151
154
  version: '0'
152
155
  requirements: []
153
- rubyforge_project:
154
- rubygems_version: 2.5.2.3
156
+ rubygems_version: 3.0.3
155
157
  signing_key:
156
158
  specification_version: 4
157
159
  summary: happy setting