subpod 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/subpod +17 -0
- data/lib/subpod.rb +27 -0
- data/lib/subpod/installer.rb +11 -0
- data/lib/subpod/overloads.rb +7 -0
- data/lib/subpod/target_integrator.rb +17 -0
- data/lib/subpod/user_project_integrator.rb +45 -0
- data/lib/subpod/version.rb +3 -0
- metadata +65 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3f84f22fa84b98acd0b14d75aa779c1965ffc775
|
4
|
+
data.tar.gz: 412cef82b3f109ff14b4f7aa7ee07d1a3f3f2876
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fdaba5d504b0b0f8edcec088843900458614ba75db481860a5c17a9894cc7be295d01320747810d638d249a33da89c79bb0048c826f767ea55b2442158331c10
|
7
|
+
data.tar.gz: d124774279ae96e0b6654a3c20be6153290d5190c50d8e50c945960574f81eb33834e54ef5929b6d07abf00603a469c151e49bcdcfd5b4bb6936631bcb7d3f48
|
data/bin/subpod
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'clactive'
|
5
|
+
require 'subpod'
|
6
|
+
|
7
|
+
CLActive.option :version, '-v', '--version', 'Version of SubPod'
|
8
|
+
|
9
|
+
CLActive.action do |opt|
|
10
|
+
puts SubPod::VERSION if opt[:version]
|
11
|
+
end
|
12
|
+
|
13
|
+
CLActive.subcmd :install do |install|
|
14
|
+
install.action do |opt|
|
15
|
+
SubPod.run(:install)
|
16
|
+
end
|
17
|
+
end
|
data/lib/subpod.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'colored'
|
2
|
+
require 'cocoapods'
|
3
|
+
require 'subpod/version'
|
4
|
+
require 'subpod/overloads'
|
5
|
+
|
6
|
+
module SubPod
|
7
|
+
module Delegate
|
8
|
+
module_function
|
9
|
+
|
10
|
+
def install
|
11
|
+
cfg = Pod::Config.instance
|
12
|
+
cfg.podfile or fail Pod::Informative, "No `Podfile` found in the current working directory."
|
13
|
+
installer = Installer.new(cfg.sandbox, cfg.podfile, cfg.lockfile)
|
14
|
+
installer.update_mode = false
|
15
|
+
installer.install!
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
module_function
|
20
|
+
|
21
|
+
def run cmd
|
22
|
+
Delegate.send cmd
|
23
|
+
rescue StandardError => e
|
24
|
+
puts e.message
|
25
|
+
rescue Exception => e
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module SubPod
|
2
|
+
class Installer < Pod::Installer
|
3
|
+
def integrate_user_project
|
4
|
+
UI.section 'Integrating client project' do
|
5
|
+
root = config.installation_root
|
6
|
+
integrator = UserProjectIntegrator.new(podfile, sandbox, root, libraries)
|
7
|
+
integrator.integrate!
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module SubPod
|
2
|
+
class TargetIntegrator < Pod::Installer::UserProjectIntegrator::TargetIntegrator
|
3
|
+
def add_xcconfig_base_configuration
|
4
|
+
xcconfig = pods_group.new_file(library.xcconfig_relative_path)
|
5
|
+
targets.each do |target|
|
6
|
+
check_overridden_build_settings(library.xcconfig, target)
|
7
|
+
target.build_configurations.each do |config|
|
8
|
+
config.base_configuration_reference = xcconfig
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def pods_group
|
14
|
+
user_project['Pods'] || user_project.new_group('Pods')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module SubPod
|
2
|
+
class UserProjectIntegrator < Pod::Installer::UserProjectIntegrator
|
3
|
+
def integrate!
|
4
|
+
add_pods_project
|
5
|
+
integrate_user_targets
|
6
|
+
warn_about_empty_podfile
|
7
|
+
end
|
8
|
+
|
9
|
+
def integrate_user_targets
|
10
|
+
libraries_to_integrate.sort_by(&:name).each do |lib|
|
11
|
+
TargetIntegrator.new(lib).integrate!
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def add_pods_project
|
16
|
+
user_project_paths.each do |path|
|
17
|
+
proj = Xcodeproj::Project.new(path)
|
18
|
+
unless pods_added?(proj, path)
|
19
|
+
group = proj['Pods'] || proj.new_group('Pods')
|
20
|
+
relative_path = pods_rel_path(path)
|
21
|
+
group.new_file(relative_path)
|
22
|
+
proj.save_as(path)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def pods_added?(user_project, path)
|
28
|
+
abs_path = pods_abs_path
|
29
|
+
rel_path = pods_rel_path(path)
|
30
|
+
user_project.files.each do |file|
|
31
|
+
path = file.pathname
|
32
|
+
return true if path == abs_path || path == rel_path
|
33
|
+
end
|
34
|
+
false
|
35
|
+
end
|
36
|
+
|
37
|
+
def pods_rel_path(path)
|
38
|
+
pods_abs_path.relative_path_from(path.parent)
|
39
|
+
end
|
40
|
+
|
41
|
+
def pods_abs_path
|
42
|
+
sandbox.project_path
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: subpod
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tang Tianyong
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-04-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cocoapods
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.18.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.18.0
|
27
|
+
description: Make Pods as a sub project
|
28
|
+
email: tang3w@gmail.com
|
29
|
+
executables:
|
30
|
+
- subpod
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- lib/subpod/installer.rb
|
35
|
+
- lib/subpod/overloads.rb
|
36
|
+
- lib/subpod/target_integrator.rb
|
37
|
+
- lib/subpod/user_project_integrator.rb
|
38
|
+
- lib/subpod/version.rb
|
39
|
+
- lib/subpod.rb
|
40
|
+
- bin/subpod
|
41
|
+
homepage: http://tang3w.com
|
42
|
+
licenses:
|
43
|
+
- MIT
|
44
|
+
metadata: {}
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
requirements: []
|
60
|
+
rubyforge_project:
|
61
|
+
rubygems_version: 2.0.3
|
62
|
+
signing_key:
|
63
|
+
specification_version: 4
|
64
|
+
summary: CocoaPods helper
|
65
|
+
test_files: []
|