cocoapods-rome 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: aaa8f5b3f8af1c82733b97a69844ecb1a1d366c8
4
- data.tar.gz: 61ac05ee1dcc0777cec53ee4268db22c4db00e69
3
+ metadata.gz: 00ed0541f08ae74263685fb455e7ea0decc3a05c
4
+ data.tar.gz: b3f2b72e72285336132b36f7032a477861328d75
5
5
  SHA512:
6
- metadata.gz: ba0662b7c8f64de6f6e3a8fb8cb92c1033488a1886073ca91d2f175c370853783e61eb5cb29fe1c5845ca0fc73756cbe15b85438c695eabe59fd676ac9a98096
7
- data.tar.gz: df8367ba677e41515d2a2ec6f065de2afe35f98f4d4222117602a71a4222b4870f4f9a4cfa11e38e3abcfbe515cb8e9127a8a532e29f92e26f12aecc28fd9be2
6
+ metadata.gz: 39724679681bf30753538cccad4c578ab04ef94a7f9fcd496836e7ce44c63da4349a5d14a4df20306ff096ed90c4057417c2dbb54145d8d0ccfbbd86932f3236
7
+ data.tar.gz: 5bfc1359d902d24f6da7108b215518214b2afafe55a321b3db697b740957a461e084f99b08c7d745546e67f1c024d7c8e99c5e1f992c873867d2b2c698d2ca82
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-rome (0.3.0)
4
+ cocoapods-rome (0.4.0)
5
5
  cocoapods (>= 0.38.0)
6
6
  fourflusher (~> 0.1.0)
7
7
 
@@ -1,3 +1,3 @@
1
1
  module CocoapodsRome
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -1,12 +1,39 @@
1
1
  require 'fourflusher'
2
2
 
3
3
  CONFIGURATION = "Release"
4
- DEVICE = "iphoneos"
5
- SIMULATOR = "iphonesimulator"
4
+ SIMULATORS = { 'iphonesimulator' => 'iPhone 5s',
5
+ 'appletvsimulator' => 'Apple TV 1080p',
6
+ 'watchsimulator' => 'Apple Watch - 38mm' }
7
+
8
+ def build_for_iosish_platform(sandbox, build_dir, target, device, simulator)
9
+ target_label = target.cocoapods_target_label
10
+
11
+ xcodebuild(sandbox, target_label, device)
12
+ xcodebuild(sandbox, target_label, simulator)
13
+
14
+ spec_names = target.specs.map { |spec| spec.root.module_name }.uniq
15
+ spec_names.each do |root_name|
16
+ executable_path = "#{build_dir}/#{root_name}"
17
+ device_lib = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_label}/#{root_name}.framework/#{root_name}"
18
+ device_framework_lib = File.dirname(device_lib)
19
+ simulator_lib = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_label}/#{root_name}.framework/#{root_name}"
20
+
21
+ next unless File.file?(device_lib) && File.file?(simulator_lib)
22
+
23
+ lipo_log = `lipo -create -output #{executable_path} #{device_lib} #{simulator_lib}`
24
+ puts lipo_log unless File.exist?(executable_path)
25
+
26
+ FileUtils.mv executable_path, device_lib
27
+ FileUtils.mv device_framework_lib, build_dir
28
+ FileUtils.rm simulator_lib if File.file?(simulator_lib)
29
+ FileUtils.rm device_lib if File.file?(device_lib)
30
+ end
31
+ end
6
32
 
7
33
  def xcodebuild(sandbox, target, sdk='macosx')
8
34
  args = %W(-project #{sandbox.project_path.basename} -scheme #{target} -configuration #{CONFIGURATION} -sdk #{sdk})
9
- args += Fourflusher::SimControl.new.destination('iPhone 5s') if sdk.include?('simulator')
35
+ simulator = SIMULATORS[sdk]
36
+ args += Fourflusher::SimControl.new.destination(simulator) unless simulator.nil?
10
37
  Pod::Executable.execute_command 'xcodebuild', args, true
11
38
  end
12
39
 
@@ -23,31 +50,12 @@ Pod::HooksManager.register('cocoapods-rome', :post_install) do |installer_contex
23
50
  Dir.chdir(sandbox.project_path.dirname) do
24
51
  targets = installer_context.umbrella_targets.select { |t| t.specs.any? }
25
52
  targets.each do |target|
26
- target_label = target.cocoapods_target_label
27
- if target.platform_name == :ios
28
- xcodebuild(sandbox, target_label, DEVICE)
29
- xcodebuild(sandbox, target_label, SIMULATOR)
30
-
31
- spec_names = target.specs.map { |spec| spec.root.module_name }.uniq
32
- spec_names.each do |root_name|
33
- executable_path = "#{build_dir}/#{root_name}"
34
- device_lib = "#{build_dir}/#{CONFIGURATION}-#{DEVICE}/#{target_label}/#{root_name}.framework/#{root_name}"
35
- device_framework_lib = File.dirname(device_lib)
36
- simulator_lib = "#{build_dir}/#{CONFIGURATION}-#{SIMULATOR}/#{target_label}/#{root_name}.framework/#{root_name}"
37
-
38
- next unless File.file?(device_lib) && File.file?(simulator_lib)
39
-
40
- lipo_log = `lipo -create -output #{executable_path} #{device_lib} #{simulator_lib}`
41
- puts lipo_log unless File.exist?(executable_path)
42
-
43
- FileUtils.mv executable_path, device_lib
44
- FileUtils.mv device_framework_lib, build_dir
45
- FileUtils.rm simulator_lib if File.file?(simulator_lib)
46
- FileUtils.rm device_lib if File.file?(device_lib)
47
- end
48
- else
49
- xcodebuild(sandbox, target_label)
50
- end
53
+ case target.platform_name
54
+ when :ios then build_for_iosish_platform(sandbox, build_dir, target, 'iphoneos', 'iphonesimulator')
55
+ when :osx then xcodebuild(sandbox, target.cocoapods_target_label)
56
+ when :tvos then build_for_iosish_platform(sandbox, build_dir, target, 'appletvos', 'appletvsimulator')
57
+ when :watchos then build_for_iosish_platform(sandbox, build_dir, target, 'watchos', 'watchsimulator')
58
+ else raise "Unknown platform '#{target.platform_name}'" end
51
59
  end
52
60
  end
53
61
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-rome
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
  - Boris Bügling
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-18 00:00:00.000000000 Z
11
+ date: 2015-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods