cocoapods-podInstalLocalDepencencies 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-podInstalLocalDepencencies/command.rb +33 -1
- data/lib/cocoapods-podInstalLocalDepencencies/command/podInstalLocalDepencencies.rb +4 -1
- data/lib/cocoapods-podInstalLocalDepencencies/gem_version.rb +1 -1
- data/lib/cocoapods-podInstalLocalDepencencies/installer_local_dependencies.rb +19 -0
- data/lib/cocoapods-podInstalLocalDepencencies/podInstalLocalDepencencies-preconfigDependencies.rb +16 -7
- data/lib/cocoapods_plugin.rb +51 -13
- metadata +20 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '064739cac52b1e766d82d635de962904e822e9fb0d7f50ac116f49e531596aa6'
|
4
|
+
data.tar.gz: 7753906dc3cbb4762cf5bbf151753c7e3cd9a97138a8529f53b8e86e3c390e12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c56326384abe25306bb24bdc4babb33640afff37edcc37009f147dc5c7c3fee42fc443f256da569102e54fba62525239d4826e47aac486aa27e24d3bb936cee
|
7
|
+
data.tar.gz: d82ca85786fa02ebd1ac6d18c1507649549126ca514c8b5768741c3b55513f8bdb6dfed022b65a853ad5c7720a7d0d225ba263c653c81d02821b2ce6da21ebe1
|
@@ -1 +1,33 @@
|
|
1
|
-
require 'cocoapods
|
1
|
+
require 'cocoapods'
|
2
|
+
require 'cocoapods-podInstalLocalDepencencies/installer_local_dependencies'
|
3
|
+
|
4
|
+
module Pod
|
5
|
+
class Command
|
6
|
+
def local_dependencies?(default: false)
|
7
|
+
if @local_dependencies.nil?
|
8
|
+
default
|
9
|
+
else
|
10
|
+
@local_dependencies
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def installer_for_config
|
15
|
+
installerNew=Installer.new(config.sandbox, config.podfile, config.lockfile)
|
16
|
+
installerNew.local_dependencies = local_dependencies?(default: false)
|
17
|
+
return installerNew
|
18
|
+
end
|
19
|
+
|
20
|
+
class Install < Command
|
21
|
+
def initialize(argv)
|
22
|
+
super
|
23
|
+
@local_dependencies = argv.flag?('local-dependencies', false)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.options
|
27
|
+
[
|
28
|
+
['--local-dependencies', 'Force running `pod install` for local dependencies'],
|
29
|
+
].concat(super)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -14,6 +14,8 @@ module Pod
|
|
14
14
|
|
15
15
|
self.arguments = []
|
16
16
|
|
17
|
+
# self.arguments = 'NAME'
|
18
|
+
|
17
19
|
# def initialize(argv)
|
18
20
|
# @name = argv.shift_argument
|
19
21
|
# super
|
@@ -25,7 +27,8 @@ module Pod
|
|
25
27
|
# end
|
26
28
|
|
27
29
|
def run
|
28
|
-
|
30
|
+
Pod::UI.puts "Teste"
|
31
|
+
#CocoapodsPodinstallocaldepencencies::Podinstallocaldepencencies.new.configPreInstall()
|
29
32
|
end
|
30
33
|
end
|
31
34
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'cocoapods'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
class Installer
|
5
|
+
class PreInstallHooksContext
|
6
|
+
attr_accessor :local_dependencies
|
7
|
+
alias_method :local_dependencies?, :local_dependencies
|
8
|
+
end
|
9
|
+
|
10
|
+
attr_accessor :local_dependencies
|
11
|
+
alias_method :local_dependencies?, :local_dependencies
|
12
|
+
|
13
|
+
def run_plugins_pre_install_hooks
|
14
|
+
context = PreInstallHooksContext.generate(sandbox, podfile, lockfile)
|
15
|
+
context.local_dependencies = local_dependencies
|
16
|
+
HooksManager.run(:pre_install, context, plugins)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/cocoapods-podInstalLocalDepencencies/podInstalLocalDepencencies-preconfigDependencies.rb
CHANGED
@@ -1,25 +1,34 @@
|
|
1
1
|
require 'cocoapods'
|
2
2
|
|
3
3
|
module CocoapodsPodinstallocaldepencencies
|
4
|
+
|
4
5
|
class Podinstallocaldepencencies
|
5
|
-
def
|
6
|
-
|
7
|
-
|
6
|
+
def save_pods_on_local_json(podsname)
|
7
|
+
File.open("./Podfile_CommonPods.json","w") do |f|
|
8
|
+
f.write(podsname.to_json)
|
9
|
+
end
|
10
|
+
Pod::UI.puts 'Saved Podfile_CommonPods.json'.green
|
11
|
+
end
|
12
|
+
|
13
|
+
def install_local_dependencies(local_dependencies)
|
14
|
+
local_dependencies.each do |module_name, path|
|
15
|
+
Pod::UI.puts "Installing #{module_name} dependencies...".green
|
8
16
|
instalation = system("pod install --project-directory=#{path}")
|
9
17
|
if !instalation
|
10
|
-
abort("Error on #{
|
18
|
+
abort("Error on #{module_name} instalation".red)
|
11
19
|
end
|
12
20
|
end
|
13
21
|
end
|
14
22
|
|
15
23
|
def configPreUpdate(local_dependencies)
|
16
|
-
local_dependencies.each do |
|
17
|
-
Pod::UI.puts "Updating #{
|
24
|
+
local_dependencies.each do |module_name, path|
|
25
|
+
Pod::UI.puts "Updating #{module_name} dependencies...".green
|
18
26
|
upgrade = system("pod update --no-repo-update --project-directory=#{path}")
|
19
27
|
if !upgrade
|
20
|
-
abort("Error on #{
|
28
|
+
abort("Error on #{module_name} instalation".red)
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
24
32
|
end
|
33
|
+
|
25
34
|
end
|
data/lib/cocoapods_plugin.rb
CHANGED
@@ -1,24 +1,62 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'fileutils'
|
1
3
|
require 'cocoapods-podInstalLocalDepencencies/command'
|
2
4
|
require_relative 'cocoapods-podInstalLocalDepencencies/podInstalLocalDepencencies-preconfigDependencies'
|
3
5
|
|
4
6
|
module CocoapodsPodinstallocaldepencencies
|
5
7
|
Pod::Installer::InstallationOptions.option('PLD_local_dependencies', {})
|
8
|
+
Pod::Installer::InstallationOptions.option('PLD_parent_path', '')
|
6
9
|
|
7
10
|
Pod::HooksManager.register('cocoapods-podInstalLocalDepencencies', :pre_install) do |context|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
if context.local_dependencies == true
|
12
|
+
options = context.podfile.installation_method.detect{|i| i.class == Hash}
|
13
|
+
local_dependencies_option = options.detect{|i| i.first == :PLD_local_dependencies}
|
14
|
+
if local_dependencies_option != nil && local_dependencies_option[1] != nil
|
15
|
+
local_dependencies = local_dependencies_option[1]
|
16
|
+
Podinstallocaldepencencies.new.install_local_dependencies(local_dependencies)
|
17
|
+
end
|
13
18
|
end
|
14
19
|
end
|
20
|
+
|
21
|
+
# Pod::HooksManager.register('cocoapods-podInstalLocalDepencencies', :post_install) do |context|
|
22
|
+
|
23
|
+
# podfile_path = context.sandbox_root.gsub('/Pods','')
|
24
|
+
# podfile = Pod::Podfile.from_ruby("#{podfile_path}/Podfile")
|
25
|
+
# options = podfile.installation_method.detect{|i| i.class == Hash}
|
26
|
+
# local_dependencies_option = options.detect{|i| i.first == :PLD_local_dependencies}
|
27
|
+
|
28
|
+
# options.each do |option|
|
29
|
+
# case option.first
|
30
|
+
# when :PLD_local_dependencies
|
31
|
+
# if option[1] != nil
|
32
|
+
# pld_installer = Podinstallocaldepencencies.new()
|
33
|
+
# specs = context.umbrella_targets.first.specs
|
34
|
+
# podsname = specs.map { |i| i.name } || []
|
35
|
+
# pld_installer.save_pods_on_local_json(podsname)
|
36
|
+
# local_dependencies = option[1]
|
37
|
+
# pld_installer.install_local_dependencies(local_dependencies)
|
38
|
+
# end
|
39
|
+
# when :PLD_parent_path
|
40
|
+
# specs = context.umbrella_targets.first.specs
|
41
|
+
# podsname = specs.map { |i| i.name } || []
|
42
|
+
# common_pods = File.open("#{Dir.pwd}/Podfile_CommonPods.json","r").read
|
43
|
+
# common_pods = JSON.parse(common_pods)
|
44
|
+
|
45
|
+
# array_pods = []
|
46
|
+
# podsname.each do |i|
|
47
|
+
# array_pods << i if common_pods.include?(i)
|
48
|
+
# end
|
49
|
+
# Pod::UI.puts(array_pods)
|
50
|
+
# end
|
51
|
+
# end
|
52
|
+
# end
|
15
53
|
|
16
|
-
Pod::HooksManager.register('cocoapods-podInstalLocalDepencencies', :pre_update) do |context|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
54
|
+
# Pod::HooksManager.register('cocoapods-podInstalLocalDepencencies', :pre_update) do |context|
|
55
|
+
# options = context.podfile.installation_method.detect{|i| i.class == Hash}
|
56
|
+
# local_dependencies_option = options.detect{|i| i.first == :PLD_local_dependencies}
|
57
|
+
# if local_dependencies_option != nil && local_dependencies_option[1] != nil
|
58
|
+
# local_dependencies = local_dependencies_option[1]
|
59
|
+
# Podinstallocaldepencencies.new.configPreUpdate(local_dependencies)
|
60
|
+
# end
|
61
|
+
# end
|
24
62
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-podInstalLocalDepencencies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leo Valentim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-05 00:00:00.000000000 Z
|
12
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: 1.5.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.5.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,7 +52,7 @@ dependencies:
|
|
38
52
|
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0'
|
41
|
-
description:
|
55
|
+
description: The Cocoapods-plugin local dependencies manager.
|
42
56
|
email:
|
43
57
|
- leo.valent@hotmail.com
|
44
58
|
executables: []
|
@@ -49,6 +63,7 @@ files:
|
|
49
63
|
- lib/cocoapods-podInstalLocalDepencencies/command.rb
|
50
64
|
- lib/cocoapods-podInstalLocalDepencencies/command/podInstalLocalDepencencies.rb
|
51
65
|
- lib/cocoapods-podInstalLocalDepencencies/gem_version.rb
|
66
|
+
- lib/cocoapods-podInstalLocalDepencencies/installer_local_dependencies.rb
|
52
67
|
- lib/cocoapods-podInstalLocalDepencencies/podInstalLocalDepencencies-preconfigDependencies.rb
|
53
68
|
- lib/cocoapods_plugin.rb
|
54
69
|
homepage: https://github.com/LeoValentim/Pod-Install-Local-Dependencies
|
@@ -74,5 +89,6 @@ rubyforge_project:
|
|
74
89
|
rubygems_version: 2.7.8
|
75
90
|
signing_key:
|
76
91
|
specification_version: 4
|
77
|
-
summary:
|
92
|
+
summary: Cocoapods-podInstalLocalDepencencies manages your local dependencies that
|
93
|
+
are referenced in your Podfile with a :path(Local path) defined.
|
78
94
|
test_files: []
|