pod-builder 0.1.6 ā†’ 0.1.8.beta

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
  SHA256:
3
- metadata.gz: 6cd72df247e9167eaab28018d45a0d472bacb2fb10ae30f3024056bf05d3b81f
4
- data.tar.gz: a5dcc842f4e72712adee80fe25884551da99cc98a0ba1225ea282d26ee454146
3
+ metadata.gz: 883d322c0c5ffd3cf34a85d76a055f3a1200400243ae03b109cb93fd3d3fd8be
4
+ data.tar.gz: b0237ad432feae58f2b222c4ece477c580425cdd4986ebf148106d3b272a0e3b
5
5
  SHA512:
6
- metadata.gz: ec05a3563dd83e63921bd133ee649c558314ba4ee386916dd31e420f3970fc8167d4dfa0b88d9f611a5d1efa320400494cd9b5b411db100f595e6e40584a594f
7
- data.tar.gz: 66f07fa9a0d837353e524ab56ef7a237036d9450ca9ba032eeaac7898db0233314594952ea2572696500c585cfc8e25dd3338a13f0b54eec0be8a85648219af0
6
+ metadata.gz: 7443c790eb55db4a7565cb846d53a9aea7cdb26e5077f9407c1eddcaa8e217beee1851888ad688b6d683ea65c6274a0abd9cca701b7e21575118fcf479a37013
7
+ data.tar.gz: 2b455b666c9a690ef3682b810810e7fdf952c6d67846d193a8bead5b41402aa4afebaf24f3407dbb935461a5a14c1a15322a8a341bb992f15074195dc78e6947
data/.vscode/launch.json CHANGED
@@ -55,7 +55,7 @@
55
55
  "args": [
56
56
  "build",
57
57
  "-d",
58
- "MessagingUIViews/Core",
58
+ "AppNexusSDK/GoogleAdapterThatDependsOnGooglePod",
59
59
  ]
60
60
  },
61
61
  {
data/README.md CHANGED
@@ -129,7 +129,7 @@ Xcode build settings to use. You can override the default values which are:
129
129
  "CLANG_ENABLE_MODULE_DEBUGGING": "NO",
130
130
  "GCC_OPTIMIZATION_LEVEL": "s",
131
131
  "SWIFT_OPTIMIZATION_LEVEL": "-Osize",
132
- "SWIFT_COMPILATION_MODE": "Incremental"
132
+ "SWIFT_COMPILATION_MODE": "singlefile"
133
133
  }
134
134
  ```
135
135
 
data/exe/pod_builder CHANGED
@@ -171,6 +171,18 @@ begin
171
171
 
172
172
  PodBuilder::Configuration.load
173
173
  command_executed = parse_commandline
174
+ rescue Exception => e
175
+ error = e.to_s
176
+
177
+ if error.length < 1000
178
+ puts "#{error.red}\n"
179
+ puts e.backtrace.join("\n\t").red
180
+ puts "\n\nCommand failed!".red
181
+ else
182
+ error_log = "/tmp/pod_builder.err"
183
+ puts "\n\nCommand failed, check #{error_log}!".red
184
+ File.write(error_log, error)
185
+ end
174
186
  ensure
175
187
  unless command_executed
176
188
  exit(0)
@@ -4,7 +4,9 @@ module Pod
4
4
  def pods_and_deps_in_target(target_name, podfile_items)
5
5
  target_name = "Pods-#{target_name}"
6
6
 
7
- specs = result.specs_by_target.select { |key, value| key.label == target_name }.values.first
7
+ unless specs = result.specs_by_target.select { |key, value| key.label == target_name }.values.first
8
+ return [], []
9
+ end
8
10
  specs.select! { |x| podfile_items.map(&:name).include?(x.name) }
9
11
 
10
12
  target_pods = []
@@ -49,7 +49,7 @@ module PodBuilder
49
49
  end
50
50
 
51
51
  puts "Deleting sources #{path}".blue
52
- FileUtils.rm_rf(path)
52
+ PodBuilder::safe_rm_rf(path)
53
53
  end
54
54
  end
55
55
 
@@ -64,7 +64,7 @@ module PodBuilder
64
64
  end
65
65
 
66
66
  puts "Deleting #{path}".blue
67
- FileUtils.rm_rf(path)
67
+ PodBuilder::safe_rm_rf(path)
68
68
  end
69
69
 
70
70
  current_dir = Dir.pwd
@@ -28,12 +28,6 @@ module PodBuilder
28
28
  add_pre_install_actions(project_podfile_path)
29
29
  add_post_install_checks(project_podfile_path)
30
30
 
31
- home_path = Pathname.new(PodBuilder::xcodepath)
32
- prebuilt_path = Pathname.new(options[:prebuild_path])
33
- relative_path = prebuilt_path.relative_path_from(home_path)
34
-
35
- Configuration.base_path = relative_path
36
-
37
31
  Configuration.write
38
32
 
39
33
  puts "\n\nšŸŽ‰ done!\n".green
@@ -21,12 +21,12 @@ module PodBuilder
21
21
  "CLANG_ENABLE_MODULE_DEBUGGING" => "NO",
22
22
  "GCC_OPTIMIZATION_LEVEL" => "s",
23
23
  "SWIFT_OPTIMIZATION_LEVEL" => "-Osize",
24
- "SWIFT_COMPILATION_MODE" => "Incremental",
24
+ "SWIFT_COMPILATION_MODE" => "singlefile",
25
25
  }
26
26
  @build_settings_overrides = {}
27
27
  @build_system = "Legacy" # either Latest (New build system) or Legacy (Standard build system)
28
28
  @config_file = "PodBuilder.json"
29
- @base_path = "Frameworks"
29
+ @base_path = "Frameworks" # Not nice. This value is used only for initial initization. Once config is loaded it will be an absolute path. FIXME
30
30
  @build_path = "/tmp/pod_builder"
31
31
  @spec_overrides = {}
32
32
  @skip_licenses = []
@@ -48,11 +48,11 @@ module PodBuilder
48
48
  end
49
49
 
50
50
  def self.find_xcodeproject
51
- return Dir.glob("#{home}/**/*.xcodeproj").detect { |x| !x.include?("Pods.xcodeproj") && !x.include?(basepath) }
51
+ return Dir.glob("#{home}/**/*.xcodeproj").detect { |x| !x.include?("/Pods/") && !x.include?(basepath) }
52
52
  end
53
53
 
54
54
  def self.find_xcodeworkspace
55
- return Dir.glob("#{home}/**/*.xcworkspace").detect { |x| !x.include?("Pods.xcworkspace") && !x.include?(basepath) }
55
+ return Dir.glob("#{home}/**/*.xcworkspace").detect { |x| !x.include?("/Pods/") && !x.include?(basepath) }
56
56
  end
57
57
 
58
58
  def self.prepare_basepath
@@ -21,6 +21,9 @@ module PodBuilder
21
21
 
22
22
  build_settings = Configuration.build_settings
23
23
  podfile_build_settings = ""
24
+
25
+ pod_dependencies = {}
26
+
24
27
  items.each do |item|
25
28
  item_build_settings = Configuration.build_settings_overrides[item.name] || {}
26
29
  build_settings['SWIFT_VERSION'] = item_build_settings["SWIFT_VERSION"] || project_swift_version(analyzer)
@@ -30,6 +33,19 @@ module PodBuilder
30
33
  end
31
34
 
32
35
  podfile_build_settings += "set_build_settings(\"#{item.root_name}\", #{build_settings.to_s}, installer)\n "
36
+
37
+ dependency_names = item.dependency_names.map { |x|
38
+ if x.split("/").first == item.root_name
39
+ next nil # remove dependency to parent spec
40
+ end
41
+ if overridded_module_name = Configuration.spec_overrides[x]["module_name"]
42
+ next overridded_module_name
43
+ end
44
+ }.compact
45
+
46
+ if dependency_names.count > 0
47
+ pod_dependencies[item.root_name] = dependency_names
48
+ end
33
49
  end
34
50
 
35
51
  podfile.sub!("%%%build_settings%%%", podfile_build_settings)
@@ -38,7 +54,7 @@ module PodBuilder
38
54
 
39
55
  podfile.sub!("%%%pods%%%", "\"#{items.map(&:name).join('", "')}\"")
40
56
 
41
- podfile.sub!("%%%dependencies%%%", "\"#{items.map(&:dependency_names).flatten.uniq.join("\",\"")}\"")
57
+ podfile.sub!("%%%pods_dependencies%%%", pod_dependencies.to_s)
42
58
 
43
59
  podfile.sub!("%%%targets%%%", items.map(&:entry).join("\n "))
44
60
 
@@ -148,7 +164,7 @@ module PodBuilder
148
164
 
149
165
  def self.pod_definition_in(line, include_commented)
150
166
  stripped_line = strip_line(line)
151
- matches = stripped_line.match(/(pod')(.*?)(')/)
167
+ matches = stripped_line.match(/(^pod')(.*?)(')/)
152
168
 
153
169
  if matches&.size == 4 && (include_commented || !stripped_line.start_with?("#"))
154
170
  return matches[2]
@@ -159,7 +175,7 @@ module PodBuilder
159
175
 
160
176
  def self.target_definition_in(line, include_commented)
161
177
  stripped_line = strip_line(line)
162
- matches = stripped_line.match(/(target')(.*?)(')/)
178
+ matches = stripped_line.match(/(^target')(.*?)(')/)
163
179
 
164
180
  if matches&.size == 4 && (include_commented || !stripped_line.start_with?("#"))
165
181
  return matches[2]
@@ -129,7 +129,7 @@ module PodBuilder
129
129
  end
130
130
 
131
131
  def self.find_xcodeproj_targets
132
- xcodeprojects = Dir.glob("#{PodBuilder::home}/**/*.xcodeproj").select { |x| !x.include?("Pods.xcodeproj") && !x.include?(PodBuilder::basepath) }
132
+ xcodeprojects = Dir.glob("#{PodBuilder::home}/**/*.xcodeproj").select { |x| !x.include?("/Pods/") && !x.include?(PodBuilder::basepath) }
133
133
  raise "xcdeoproj not found!".red if xcodeprojects.count == 0
134
134
  raise "Found multiple xcdeoprojs:\n#{xcodeprojects.join("\n")}".red if xcodeprojects.count > 1
135
135
 
@@ -19,28 +19,15 @@ plugin 'cocoapods-rome', { dsym: false, configuration: '%%%build_configuration%
19
19
  end
20
20
 
21
21
  %%%build_settings%%%
22
- pods = [%%%pods%%%]
23
- dependencies = [%%%dependencies%%%]
22
+ pods_dependencies = %%%pods_dependencies%%%
24
23
 
25
- removed_dependencies = []
26
- installer.pods_project.targets.each do |target|
27
- target.frameworks_build_phase.files.each do |f|
28
- dependencies.each do |dependency|
29
- if f.display_name().include?(dependency + ".a") then
30
- removed_dependencies.push(dependency)
31
- target.frameworks_build_phase.remove_build_file(f)
32
- end
33
- end
34
- end
35
- end
36
-
37
24
  # Add -l<dependency> to other linker flags
38
25
  installer.pods_project.targets.each do |target|
39
- if pods.any? { |w| target.display_name().include?(w) }
40
- removed_dependencies.each do |dependency|
41
- target.build_configurations.each do |config|
26
+ if dependencies = pods_dependencies[target.name]
27
+ target.build_configurations.each do |config|
28
+ dependencies.each do |dependency|
42
29
  if config.build_settings['OTHER_LDFLAGS'].nil?
43
- config.build_settings['OTHER_LDFLAGS'] = '-framework '
30
+ config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -framework '
44
31
  else
45
32
  config.build_settings['OTHER_LDFLAGS'] << '-framework '
46
33
  end
@@ -1,4 +1,4 @@
1
1
  module PodBuilder
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.8.beta"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pod-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Camin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-24 00:00:00.000000000 Z
11
+ date: 2018-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -262,9 +262,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
262
262
  version: '0'
263
263
  required_rubygems_version: !ruby/object:Gem::Requirement
264
264
  requirements:
265
- - - ">="
265
+ - - ">"
266
266
  - !ruby/object:Gem::Version
267
- version: '0'
267
+ version: 1.3.1
268
268
  requirements: []
269
269
  rubyforge_project:
270
270
  rubygems_version: 2.7.3