CarthagePods 0.2.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 +7 -0
- data/LICENSE +21 -0
- data/README.md +39 -0
- data/exe/carthagePods +3 -0
- data/lib/CPod/CPodManage.rb +44 -0
- data/lib/CPod/EvalFilterFramework.rb +15 -0
- data/lib/CarthagePods/version.rb +3 -0
- data/lib/CarthagePods.rb +15 -0
- data/lib/Command/BuildCommand.rb +61 -0
- data/lib/Command/InstallCommand.rb +34 -0
- data/lib/Command/MainCommand.rb +34 -0
- data/lib/Command/UpdateCommand.rb +27 -0
- data/lib/DependencyManagerTools/Carthage/CarthageManage.rb +75 -0
- data/lib/DependencyManagerTools/CocoaPods/CocoaPodsManage.rb +202 -0
- data/lib/DependencyManagerTools/ToolsManger.rb +19 -0
- data/lib/ENV/DependencyCheck.rb +46 -0
- metadata +145 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 40d3bb0d07738960a675e8dc1ba1968fea68fe22
|
|
4
|
+
data.tar.gz: e567045efa7db2a60008e9966006282a5c881dad
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c03d8ed18e8429312ee84646a84a62b8b63db4fd510149a437b8251feda2436338fc09ca9b104865d99593c36af8c9aad9445a1dd6df2ff21b8485a9ae1cbc99
|
|
7
|
+
data.tar.gz: b8f487b20036c89003614c77a865445fda065c92e3602ad1c334058a81acf20d5ad0b9d882dbeadbf551f424f4d7459c2cc15c5aca1b4baa9980ebe7aed02bd0
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Sim
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# CarthagePods
|
|
2
|
+
|
|
3
|
+
The Cocoa dependency manager. use CocoaPods and
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'CarthagePods'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
|
|
15
|
+
$ bundle
|
|
16
|
+
|
|
17
|
+
Or install it yourself as:
|
|
18
|
+
|
|
19
|
+
$ gem install CarthagePods
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
TODO: Write usage instructions here
|
|
24
|
+
|
|
25
|
+
## Development
|
|
26
|
+
|
|
27
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
28
|
+
|
|
29
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
30
|
+
|
|
31
|
+
## Contributing
|
|
32
|
+
|
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/CarthagePods. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
39
|
+
|
data/exe/carthagePods
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
module CarthagePods
|
|
3
|
+
|
|
4
|
+
class CPodManage
|
|
5
|
+
|
|
6
|
+
def CPodfile_template()
|
|
7
|
+
<<-SPEC
|
|
8
|
+
# filterFramework ['RxTest.framework', 'RxBlocking.framework']
|
|
9
|
+
SPEC
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def createCPodfile()
|
|
13
|
+
|
|
14
|
+
cpodfile = File.new 'CPodfile', 'w'
|
|
15
|
+
|
|
16
|
+
cpodfile.write(CPodfile_template())
|
|
17
|
+
|
|
18
|
+
cpodfile.close
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def deleteCPodfile()
|
|
23
|
+
File.delete'CPodfile'
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def deleteFilterFramework(platformPath)
|
|
27
|
+
|
|
28
|
+
require 'CPod/EvalFilterFramework'
|
|
29
|
+
|
|
30
|
+
$filterHash_value.each_value do |value|
|
|
31
|
+
|
|
32
|
+
path = "Carthage/Build/#{platformPath}/#{value}"
|
|
33
|
+
|
|
34
|
+
`rm -rf #{path}`
|
|
35
|
+
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
|
data/lib/CarthagePods.rb
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require "CarthagePods/version"
|
|
2
|
+
require "ENV/DependencyCheck"
|
|
3
|
+
require 'clamp'
|
|
4
|
+
require 'Command/InstallCommand'
|
|
5
|
+
require 'Command/MainCommand'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module CarthagePods
|
|
9
|
+
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
if ENV['SPEC'] != '1'
|
|
13
|
+
CarthagePods::MainCommand.run
|
|
14
|
+
end
|
|
15
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
|
|
2
|
+
module CarthagePods
|
|
3
|
+
|
|
4
|
+
class BuildCommand < Clamp::Command
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@@carthageArg = {}
|
|
8
|
+
@@cocoapodsArg = {}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
option "--no-checkout", :flag, "skip the checking out of dependencies after updating" do
|
|
12
|
+
@@carthageArg['no-checkout'] = 'no-checkout'
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
option "--no-build", :flag, "skip the building of dependencies after updating
|
|
16
|
+
(ignored if --no-checkout option is present)" do
|
|
17
|
+
@@carthageArg['no-build'] = 'no-build'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
option "--verbose", :flag, "print xcodebuild output inline (ignored if --no-build option is present)" do
|
|
21
|
+
@@carthageArg['verbose'] = 'verbose'
|
|
22
|
+
@@cocoapodsArg['verbose'] = 'verbose'
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
option "--configuration", "String", "the Xcode configuration to build')
|
|
26
|
+
(ignored if --no-build option is present)", :multivalued => true, :attribute_name => :configuration do |value|
|
|
27
|
+
@@carthageArg['configuration'] = "configuration #{value}"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
option "--toolchain", "String", "the toolchain to build with", :multivalued => true, :attribute_name => :toolchain do |value|
|
|
31
|
+
@@carthageArg['toolchain'] = "toolchain #{value}"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
option "--derived-data", "String", "path to the custom derived data folder", :multivalued => true, :attribute_name => :derived_data do |value|
|
|
35
|
+
@@carthageArg['derived-data'] = "derived-data #{value}"
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
option "--use-ssh", :flag, "use SSH for downloading GitHub repositories" do
|
|
39
|
+
@@carthageArg['use-ssh'] = "usr-ssh"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
option "--no-use-binaries", :flag, "check out dependency repositories even when prebuilt frameworks exist, disabled if --use-submodules option is present
|
|
43
|
+
(ignored if --no-build option is present)" do
|
|
44
|
+
@@carthageArg['no-use-binaries'] = 'no-use-binaries'
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
option "--repo-update", :flag, "Force running `pod repo update` before install" do
|
|
48
|
+
@@cocoapodsArg['repo-update"'] = 'repo-update"'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
option "--silent", :flag, "Show nothing" do
|
|
52
|
+
@@cocoapodsArg['silent'] = 'silent'
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
option "--no-ansi", :flag, "Show output without ANSI codes" do
|
|
56
|
+
@@cocoapodsArg['no-ansi'] = 'no-ansi'
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require 'clamp'
|
|
2
|
+
require 'DependencyManagerTools/Carthage/CarthageManage'
|
|
3
|
+
require 'DependencyManagerTools/CocoaPods/CocoaPodsManage'
|
|
4
|
+
require 'Command/BuildCommand'
|
|
5
|
+
|
|
6
|
+
module CarthagePods
|
|
7
|
+
|
|
8
|
+
class InstallCommand < BuildCommand
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def execute
|
|
13
|
+
|
|
14
|
+
platformType = {"osx" => "macOS", "ios" => "iOS", "watchos" => "watchOS", "tvos" => "tvOS"}
|
|
15
|
+
|
|
16
|
+
carthageManage = CarthageManage.new
|
|
17
|
+
cocoaPodsManage = CocoaPodsManage.new
|
|
18
|
+
cpodManage = CPodManage.new
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@@carthageArg['platform'] = "platform #{platformType[cocoaPodsManage.getPlatformType]}"
|
|
22
|
+
|
|
23
|
+
carthageManage.install @@carthageArg
|
|
24
|
+
|
|
25
|
+
cpodManage.deleteFilterFramework cocoaPodsManage.platformToCarthagePath(cocoaPodsManage.getPlatformType)
|
|
26
|
+
|
|
27
|
+
cocoaPodsManage.generatePodspec
|
|
28
|
+
cocoaPodsManage.install @@cocoapodsArg
|
|
29
|
+
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require 'Clamp'
|
|
2
|
+
require 'ENV/DependencyCheck'
|
|
3
|
+
require 'CPod/CPodManage'
|
|
4
|
+
require 'Command/UpdateCommand'
|
|
5
|
+
require 'Command/BuildCommand'
|
|
6
|
+
|
|
7
|
+
module CarthagePods
|
|
8
|
+
|
|
9
|
+
class MainCommand < Clamp::Command
|
|
10
|
+
|
|
11
|
+
DependencyCheck.checkEnv
|
|
12
|
+
|
|
13
|
+
subcommand "init", "Generate a Podfile and Cartfile for the current directory " do
|
|
14
|
+
def execute
|
|
15
|
+
|
|
16
|
+
carthageManage = CarthageManage.new
|
|
17
|
+
cpodManage = CPodManage.new
|
|
18
|
+
|
|
19
|
+
cpodManage.createCPodfile
|
|
20
|
+
carthageManage.createCartfile
|
|
21
|
+
`pod init`
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
subcommand 'install', 'Install project dependencies', InstallCommand
|
|
27
|
+
|
|
28
|
+
subcommand 'update', 'Update outdated project dependencies', UpdateCommand
|
|
29
|
+
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'clamp'
|
|
2
|
+
require 'Command/BuildCommand'
|
|
3
|
+
require 'DependencyManagerTools/CocoaPods/CocoaPodsManage'
|
|
4
|
+
require 'DependencyManagerTools/Carthage/CarthageManage'
|
|
5
|
+
|
|
6
|
+
module CarthagePods
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UpdateCommand < BuildCommand
|
|
10
|
+
|
|
11
|
+
def execute
|
|
12
|
+
|
|
13
|
+
platformType = {"osx" => "macOS", "ios" => "iOS", "watchos" => "watchOS", "tvos" => "tvOS"}
|
|
14
|
+
|
|
15
|
+
cocoaPodsManage = CocoaPodsManage.new
|
|
16
|
+
carthageManage = CarthageManage.new
|
|
17
|
+
|
|
18
|
+
@@carthageArg['platform'] = "platform #{platformType[cocoaPodsManage.getPlatformType]}"
|
|
19
|
+
|
|
20
|
+
carthageManage.update @@carthageArg
|
|
21
|
+
cocoaPodsManage.update @@cocoapodsArg
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
require 'tty-command'
|
|
2
|
+
require 'DependencyManagerTools/ToolsManger'
|
|
3
|
+
|
|
4
|
+
module CarthagePods
|
|
5
|
+
|
|
6
|
+
class CarthageManage < ToolsManger
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def createCartfile
|
|
11
|
+
|
|
12
|
+
cartfile = '# Require version 2.3.1 or later
|
|
13
|
+
# github "ReactiveCocoa/ReactiveCocoa" >= 2.3.1
|
|
14
|
+
|
|
15
|
+
# Require version 1.x
|
|
16
|
+
# github "Mantle/Mantle" ~> 1.0 # (1.0 or later, but less than 2.0)
|
|
17
|
+
|
|
18
|
+
# Require exactly version 0.4.1
|
|
19
|
+
# github "jspahrsummers/libextobjc" == 0.4.1
|
|
20
|
+
|
|
21
|
+
# Use the latest version
|
|
22
|
+
# github "jspahrsummers/xcconfigs"
|
|
23
|
+
|
|
24
|
+
# Use the branch
|
|
25
|
+
# github "jspahrsummers/xcconfigs" "branch"
|
|
26
|
+
|
|
27
|
+
# Use a project from GitHub Enterprise
|
|
28
|
+
# github "https://enterprise.local/ghe/desktop/git-error-translations"
|
|
29
|
+
|
|
30
|
+
# Use a project from any arbitrary server, on the "development" branch
|
|
31
|
+
# git "https://enterprise.local/desktop/git-error-translations2.git" "development"
|
|
32
|
+
|
|
33
|
+
# Use a local project
|
|
34
|
+
# git "file:///directory/to/project" "branch"
|
|
35
|
+
|
|
36
|
+
# A binary only framework
|
|
37
|
+
# binary "https://my.domain.com/release/MyFramework.json" ~> 2.3'
|
|
38
|
+
|
|
39
|
+
if File.exist?('Cartfile')
|
|
40
|
+
return
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
cartAFile = File.new('Cartfile', 'w')
|
|
44
|
+
|
|
45
|
+
cartAFile.write cartfile
|
|
46
|
+
|
|
47
|
+
cartAFile.close
|
|
48
|
+
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def install(arg={})
|
|
52
|
+
|
|
53
|
+
cmdObj = TTY::Command.new
|
|
54
|
+
|
|
55
|
+
cmd = argMarge('carthage bootstrap', arg)
|
|
56
|
+
|
|
57
|
+
cmdObj.run cmd
|
|
58
|
+
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def update(arg={})
|
|
62
|
+
|
|
63
|
+
cmdObj = TTY::Command.new
|
|
64
|
+
|
|
65
|
+
cmd = argMarge('carthage update', arg)
|
|
66
|
+
|
|
67
|
+
cmdObj.run cmd
|
|
68
|
+
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
end
|
|
75
|
+
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
require 'tty-command'
|
|
2
|
+
require 'DependencyManagerTools/ToolsManger'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
module CarthagePods
|
|
6
|
+
|
|
7
|
+
class CocoaPodsManage < ToolsManger
|
|
8
|
+
|
|
9
|
+
def platformToCarthagePath(type)
|
|
10
|
+
|
|
11
|
+
case type
|
|
12
|
+
when 'osx'
|
|
13
|
+
return 'Mac'
|
|
14
|
+
when 'ios'
|
|
15
|
+
return 'iOS'
|
|
16
|
+
when 'tvos'
|
|
17
|
+
return 'tvOS'
|
|
18
|
+
when 'watchos'
|
|
19
|
+
return 'watchOS'
|
|
20
|
+
else
|
|
21
|
+
return 'iOS'
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def spec_template(data)
|
|
28
|
+
<<-SPEC
|
|
29
|
+
Pod::Spec.new do |s|
|
|
30
|
+
s.name = 'CarthagePods'
|
|
31
|
+
s.version = '1.0'
|
|
32
|
+
s.summary = 'A short description of CarthagePods.'
|
|
33
|
+
s.description = <<-DESC
|
|
34
|
+
LICENSE
|
|
35
|
+
DESC
|
|
36
|
+
s.homepage = 'http://EXAMPLE/CarthagePods'
|
|
37
|
+
s.license = 'MIT'
|
|
38
|
+
s.author = { 'CarthagePods' => 'CarthagePods@CarthagePods.com' }
|
|
39
|
+
s.platform = :#{data[:platformType]}, #{data[:version]}
|
|
40
|
+
s.source = { :git => 'https://github.com/bay2/CarthagePods.git', :tag => '1.0' }
|
|
41
|
+
s.vendored_frameworks = 'Carthage/Build/#{platformToCarthagePath(data[:platformType])}/*.framework'
|
|
42
|
+
end
|
|
43
|
+
SPEC
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def generatePodspec
|
|
48
|
+
|
|
49
|
+
version = getPlatformVersion
|
|
50
|
+
platformType = getPlatformType
|
|
51
|
+
data = {}
|
|
52
|
+
data[:version] = version
|
|
53
|
+
data[:platformType] = platformType
|
|
54
|
+
|
|
55
|
+
podspec = spec_template data
|
|
56
|
+
|
|
57
|
+
podspecFile = File.new('CarthagePods.podspec', 'w+')
|
|
58
|
+
|
|
59
|
+
podspecFile.write podspec
|
|
60
|
+
|
|
61
|
+
podspecFile.close
|
|
62
|
+
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def readPodfile
|
|
66
|
+
|
|
67
|
+
podfile = File.new('Podfile', 'r')
|
|
68
|
+
|
|
69
|
+
lines = podfile.readlines
|
|
70
|
+
|
|
71
|
+
podfile.close
|
|
72
|
+
|
|
73
|
+
for line in lines
|
|
74
|
+
|
|
75
|
+
if line =~ /0?(#)/
|
|
76
|
+
next
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
yield line
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def getPlatformType
|
|
85
|
+
|
|
86
|
+
readPodfile do |line|
|
|
87
|
+
|
|
88
|
+
if line =~ /^\s*platform\s*:(\w*)\s*,\s*['"]\d*.\d*'\s*$/
|
|
89
|
+
reslut = /^\s*platform\s*:(\w*)\s*,\s*['"]\d*.\d*'\s*$/.match(line)
|
|
90
|
+
return reslut[1]
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
return 'ios'
|
|
96
|
+
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def getPlatformVersion
|
|
100
|
+
|
|
101
|
+
readPodfile do |line|
|
|
102
|
+
|
|
103
|
+
if line =~ /^\s*platform\s*:\w*\s*,\s*(['"]\d*.\d*['"])\s*$/
|
|
104
|
+
reslut = /^\s*platform\s*:\w*\s*,\s*(['"]\d*.\d*['"])\s*$/.match(line)
|
|
105
|
+
return reslut[1]
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
return '\'9.0\''
|
|
111
|
+
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
def insertCarthagePods
|
|
115
|
+
|
|
116
|
+
podfile = File.new('Podfile', 'r')
|
|
117
|
+
|
|
118
|
+
curPodfile = podfile.readlines
|
|
119
|
+
|
|
120
|
+
podfile.close
|
|
121
|
+
|
|
122
|
+
targetNum = 0
|
|
123
|
+
|
|
124
|
+
newPodFile = ''
|
|
125
|
+
|
|
126
|
+
@podfileText = ""
|
|
127
|
+
|
|
128
|
+
for line in curPodfile
|
|
129
|
+
|
|
130
|
+
@podfileText += line
|
|
131
|
+
|
|
132
|
+
if (line =~ /^\s*target\s*['"]\w*['"]\s*do\s*$/)
|
|
133
|
+
targetNum += 1
|
|
134
|
+
newPodFile += line
|
|
135
|
+
next
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if (line =~ /^\s*end\s*$/) && targetNum > 0
|
|
139
|
+
|
|
140
|
+
targetNum -= 1
|
|
141
|
+
|
|
142
|
+
if targetNum == 0
|
|
143
|
+
newPodFile += ("pod 'CarthagePods', :path => './'\n")
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
newPodFile += line
|
|
147
|
+
|
|
148
|
+
next
|
|
149
|
+
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
newPodFile += line
|
|
153
|
+
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
podfile = File.new('Podfile', 'w+')
|
|
157
|
+
|
|
158
|
+
podfile.write newPodFile
|
|
159
|
+
|
|
160
|
+
podfile.close
|
|
161
|
+
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def reductionPodfile
|
|
165
|
+
|
|
166
|
+
podfile = File.new('Podfile', 'w+')
|
|
167
|
+
|
|
168
|
+
podfile.write @podfileText
|
|
169
|
+
|
|
170
|
+
podfile.close
|
|
171
|
+
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def install(arg={})
|
|
175
|
+
|
|
176
|
+
insertCarthagePods
|
|
177
|
+
|
|
178
|
+
cmdObj = TTY::Command.new
|
|
179
|
+
|
|
180
|
+
cmd = argMarge('pod install', arg)
|
|
181
|
+
|
|
182
|
+
cmdObj.run cmd
|
|
183
|
+
|
|
184
|
+
reductionPodfile
|
|
185
|
+
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
def update(arg={})
|
|
189
|
+
|
|
190
|
+
cmdObj = TTY::Command.new
|
|
191
|
+
|
|
192
|
+
cmd = argMarge('pod update', arg)
|
|
193
|
+
|
|
194
|
+
cmdObj.run cmd
|
|
195
|
+
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
class DependencyCheck
|
|
3
|
+
|
|
4
|
+
def self.carthage?
|
|
5
|
+
checkComponent 'carthage'
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def self.cocoapods?
|
|
9
|
+
checkComponent 'pod'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.checkComponent(name)
|
|
13
|
+
|
|
14
|
+
exts = ENV['PATH'] ? ENV['PATH'].split(':') : ['']
|
|
15
|
+
|
|
16
|
+
exts.each do |path|
|
|
17
|
+
|
|
18
|
+
ext = "#{path}/#{name}"
|
|
19
|
+
if File.executable?(ext) && !File.directory?(ext)
|
|
20
|
+
return true
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
return false
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.checkEnv
|
|
30
|
+
|
|
31
|
+
if !DependencyCheck.carthage?
|
|
32
|
+
|
|
33
|
+
puts "Please install the Carhage. Uset commend \'sudo brew install carthage\'"
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
if !DependencyCheck.cocoapods?
|
|
38
|
+
|
|
39
|
+
puts "Please install the Carhage. Uset commend \'sudo brew install carthage\'"
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: CarthagePods
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.2.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- sim
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-04-12 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.14'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.14'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rspec
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '3.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '3.0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: clamp
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '1.1'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '1.1'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: tty-command
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0.4'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0.4'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: cocoapods
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '1.2'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '1.2'
|
|
97
|
+
description: A simple, decentralized dependency manager for Cocoa
|
|
98
|
+
email:
|
|
99
|
+
- sim_cai@icloud.com
|
|
100
|
+
executables:
|
|
101
|
+
- carthagePods
|
|
102
|
+
extensions: []
|
|
103
|
+
extra_rdoc_files: []
|
|
104
|
+
files:
|
|
105
|
+
- LICENSE
|
|
106
|
+
- README.md
|
|
107
|
+
- exe/carthagePods
|
|
108
|
+
- lib/CPod/CPodManage.rb
|
|
109
|
+
- lib/CPod/EvalFilterFramework.rb
|
|
110
|
+
- lib/CarthagePods.rb
|
|
111
|
+
- lib/CarthagePods/version.rb
|
|
112
|
+
- lib/Command/BuildCommand.rb
|
|
113
|
+
- lib/Command/InstallCommand.rb
|
|
114
|
+
- lib/Command/MainCommand.rb
|
|
115
|
+
- lib/Command/UpdateCommand.rb
|
|
116
|
+
- lib/DependencyManagerTools/Carthage/CarthageManage.rb
|
|
117
|
+
- lib/DependencyManagerTools/CocoaPods/CocoaPodsManage.rb
|
|
118
|
+
- lib/DependencyManagerTools/ToolsManger.rb
|
|
119
|
+
- lib/ENV/DependencyCheck.rb
|
|
120
|
+
homepage: https://github.com/bay2/CarthagePods
|
|
121
|
+
licenses:
|
|
122
|
+
- MIT
|
|
123
|
+
metadata: {}
|
|
124
|
+
post_install_message:
|
|
125
|
+
rdoc_options: []
|
|
126
|
+
require_paths:
|
|
127
|
+
- lib
|
|
128
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
|
+
requirements:
|
|
130
|
+
- - ">="
|
|
131
|
+
- !ruby/object:Gem::Version
|
|
132
|
+
version: '0'
|
|
133
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
|
+
requirements:
|
|
135
|
+
- - ">="
|
|
136
|
+
- !ruby/object:Gem::Version
|
|
137
|
+
version: '0'
|
|
138
|
+
requirements: []
|
|
139
|
+
rubyforge_project:
|
|
140
|
+
rubygems_version: 2.6.11
|
|
141
|
+
signing_key:
|
|
142
|
+
specification_version: 4
|
|
143
|
+
summary: A simple, decentralized dependency manager for Cocoa
|
|
144
|
+
test_files: []
|
|
145
|
+
has_rdoc:
|