cocoapods-force-static-framework 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 27581af78956bed79bf052cc10277cde03bef8ef
4
- data.tar.gz: 8e22fab06f757bab83d78c891fa44ded494d6ca9
2
+ SHA256:
3
+ metadata.gz: f1f422c5fef3b63af4885a2e85d51d5569ae14a1bab869c392210c561601b3e4
4
+ data.tar.gz: c3f67ed62bd9a318954ff37aa506f04e3df41136203b7aa64135558d042909f1
5
5
  SHA512:
6
- metadata.gz: 03ba5ec7bcb7d3d6ef30da2e1c24b7153f3790cd8ab1aefea3576f4562290c925186bb9a39502bcc0682c36edc6d3e1577208103dc373084cc5289ca281dfcfa
7
- data.tar.gz: f795d1d9d00cba126bffb70afb6da0d7650eb85abe3eb56e17ab9697b23a3eb5ed89f1f42fa12364d68f9d207008b410ced6f59d48ac73e65f9f922075159f51
6
+ metadata.gz: 58ada5174baf94baa83629fee0e2be3b3b739bc23db1dd16d9c5ef9e6df2b37e3b93df5333965e29cda67457130f7db4977fe1b5c27d1870578183a166103bc5
7
+ data.tar.gz: d831bfe684101586bb85e05dae00b4d75f142831bdc89212260204cc03d9d0af08b75d68bf30971a756f3aa60b89d5b61983cc7f929b28bfcd4b3afae762cfec
@@ -1,76 +1,45 @@
1
1
  module Pod
2
2
 
3
- class Static
4
- def self.keyword
5
- :static
6
- end
7
- end
3
+ @@static_frameworks = []
8
4
 
9
- class Podfile
5
+ def self.store_static_framework_names(names)
6
+ @@static_frameworks = names
7
+ end
10
8
 
11
- class TargetDefinition
9
+ def self.static_framework_names
10
+ @@static_frameworks
11
+ end
12
12
 
13
- def parse_force_static_framework(name, requirements)
14
- options = requirements.last
15
- if options.is_a?(Hash) && options[Pod::Static.keyword] != nil
16
- should_force_static = options.delete(Pod::Static.keyword)
17
- requirements.pop if options.empty?
18
- pod_name = Specification.root_name(name)
19
- if should_force_static && Pod::Podfile::DSL.force_static_framework_enable
20
- @force_static_framework_names ||= []
21
- @force_static_framework_names.push pod_name
13
+ class Specification
14
+ def self.from_string(spec_contents, path, subspec_name = nil)
15
+ name = ''
16
+ path = Pathname.new(path).expand_path
17
+ spec = nil
18
+ case path.extname
19
+ when '.podspec'
20
+ name = File.basename(path, '.podspec')
21
+ Dir.chdir(path.parent.directory? ? path.parent : Dir.pwd) do
22
+ spec = ::Pod._eval_podspec(spec_contents, path)
23
+ unless spec.is_a?(Specification)
24
+ raise Informative, "Invalid podspec file at path `#{path}`."
22
25
  end
23
26
  end
27
+ when '.json'
28
+ name = File.basename(path, '.podspec.json')
29
+ spec = Specification.from_json(spec_contents)
30
+ else
31
+ raise Informative, "Unsupported specification format `#{path.extname}` for spec at `#{path}`."
24
32
  end
25
-
26
- def force_static_framework_names
27
- names = @force_static_framework_names || []
28
- if parent != nil and parent.kind_of? TargetDefinition
29
- names += parent.force_static_framework_names
30
- end
31
- names
33
+ if Pod.static_framework_names.include?(name)
34
+ spec.static_framework = true
32
35
  end
33
-
34
- old_method = instance_method(:parse_inhibit_warnings)
35
-
36
- define_method(:parse_inhibit_warnings) do |name, requirements|
37
- parse_force_static_framework(name, requirements)
38
- old_method.bind(self).(name, requirements)
39
- end
40
-
36
+ spec.defined_in_file = path
37
+ spec.subspec_by_name(subspec_name, true)
41
38
  end
42
39
  end
43
40
 
44
- class PodTarget
45
-
46
- old_method = instance_method(:initialize)
47
-
48
- define_method(:initialize) do |sandbox, host_requires_frameworks, user_build_configurations, archs, platform, specs, target_definitions, file_accessors, scope_suffix, build_type|
49
- reval = build_type[:build_type]
50
- if target_definitions.first.force_static_framework_names.include?(Specification.root_name(specs.first.name))
51
- reval = Target::BuildType.static_framework
52
- end
53
- old_method.bind(self).(sandbox, host_requires_frameworks, user_build_configurations, archs, platform, specs, target_definitions, file_accessors, scope_suffix, :build_type => reval)
54
- end
55
-
56
- end
57
-
58
41
  end
59
42
 
60
- module Pod
61
- class Podfile
62
- module DSL
63
-
64
- def force_static_framework_enable!
65
- @@option_force_static_framework_enable = true
66
- end
67
-
68
- def self.force_static_framework_enable
69
- @@option_force_static_framework_enable
70
- end
71
-
72
- @@option_force_static_framework_enable = false
73
-
74
- end
75
- end
43
+ Pod::HooksManager.register('cocoapods-force-static-framework', :pre_install) do |context, options|
44
+ Pod.store_static_framework_names(options[:static_frameworks])
76
45
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsForceStaticFramework
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-force-static-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - maqiang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-12 00:00:00.000000000 Z
11
+ date: 2019-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -69,8 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  requirements: []
72
- rubyforge_project:
73
- rubygems_version: 2.5.2.3
72
+ rubygems_version: 3.0.3
74
73
  signing_key:
75
74
  specification_version: 4
76
75
  summary: A longer description of cocoapods-force-static-framework.