cocoapods-acknowledgements-addons 0.1.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/.gitignore +50 -0
- data/.gitmodules +3 -0
- data/CHANGELOG.md +10 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +100 -0
- data/LICENSE +21 -0
- data/README.md +49 -0
- data/Rakefile +14 -0
- data/cocoapods_acknowledgements_addons.gemspec +26 -0
- data/example/.gitignore +36 -0
- data/example/Acknowledgements/Crypto/Crypto.podspec +8 -0
- data/example/Acknowledgements/Crypto/LICENSE +1 -0
- data/example/App.xcodeproj/project.pbxproj +402 -0
- data/example/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/example/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- data/example/App.xcworkspace/contents.xcworkspacedata +13 -0
- data/example/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- data/example/App/AppDelegate.swift +25 -0
- data/example/App/Assets.xcassets/AppIcon.appiconset/Contents.json +98 -0
- data/example/App/Assets.xcassets/Contents.json +6 -0
- data/example/App/Base.lproj/LaunchScreen.storyboard +25 -0
- data/example/App/Info.plist +41 -0
- data/example/Cartfile +3 -0
- data/example/Cartfile.resolved +3 -0
- data/example/Gemfile +5 -0
- data/example/Gemfile.lock +94 -0
- data/example/Makefile +8 -0
- data/example/Podfile +15 -0
- data/example/Podfile.lock +16 -0
- data/example/README.md +32 -0
- data/lib/cocoapods_acknowledgements/addons.rb +29 -0
- data/lib/cocoapods_acknowledgements/addons/plist_modifier.rb +36 -0
- data/lib/cocoapods_acknowledgements/addons/podspec_accumulator.rb +34 -0
- data/lib/cocoapods_plugin.rb +1 -0
- data/lib/version.rb +5 -0
- metadata +135 -0
@@ -0,0 +1,36 @@
|
|
1
|
+
require "cocoapods"
|
2
|
+
require "cfpropertylist"
|
3
|
+
|
4
|
+
module CocoaPodsAcknowledgements
|
5
|
+
module AddOns
|
6
|
+
class PlistModifier
|
7
|
+
|
8
|
+
# Adds podspecs to the given plist except the excluded ones.
|
9
|
+
# @param podspecs [Array<Hash>] the array of podspec info of acknowledgements.
|
10
|
+
# @param plist_path [Pathname] the path to the plist.
|
11
|
+
# @param excluded_names [Array<String>] the array of podspec names to ignore.
|
12
|
+
def add_podspecs_to_plist(podspecs, plist_path, excluded_names)
|
13
|
+
podspecs = [*podspecs]
|
14
|
+
excluded_names = [*excluded_names]
|
15
|
+
|
16
|
+
return if podspecs.empty? or not plist_path&.writable?
|
17
|
+
|
18
|
+
plist = CFPropertyList::List.new(file: plist_path)
|
19
|
+
acknowledgements = plist.value.value["specs"].value.map { |spec| spec.value["name"].value }
|
20
|
+
|
21
|
+
podspecs.each do |metadata|
|
22
|
+
next if excluded_names.include? metadata[:name]
|
23
|
+
Pod::UI.info "Adding #{metadata[:name]} to #{plist_path.basename}"
|
24
|
+
|
25
|
+
node = CFPropertyList.guess(metadata)
|
26
|
+
next if node.nil? or acknowledgements.include? node.value["name"].value
|
27
|
+
plist.value.value["specs"].value.append(node)
|
28
|
+
end
|
29
|
+
|
30
|
+
plist.value.value["specs"].value.sort! { |a, b| a.value["name"].value <=> b.value["name"].value }
|
31
|
+
plist.save(plist_path, CFPropertyList::List::FORMAT_XML)
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require "cocoapods-core"
|
2
|
+
|
3
|
+
module CocoaPodsAcknowledgements
|
4
|
+
module AddOns
|
5
|
+
class PodspecAccumulator
|
6
|
+
|
7
|
+
# Initializes a PodspecAccumulator with a search path.
|
8
|
+
# @param search_path [Pathname] the directory to look for podspecs.
|
9
|
+
def initialize(search_path = Pathname("").expand_path)
|
10
|
+
@files = Dir[search_path + "**/*.podspec"]
|
11
|
+
end
|
12
|
+
|
13
|
+
# @return [Array<Hash>] the array of podspec info required in the plist.
|
14
|
+
def podspecs
|
15
|
+
@files.map do |path|
|
16
|
+
spec = Pod::Specification.from_file(path)
|
17
|
+
license_file = spec.license[:file] || "LICENSE"
|
18
|
+
license_path = File.join(File.dirname(path), license_file)
|
19
|
+
{
|
20
|
+
name: spec.name,
|
21
|
+
version: spec.version.to_s,
|
22
|
+
authors: Hash[spec.authors.map { |k, v| [k, v || ""] }],
|
23
|
+
socialMediaURL: spec.social_media_url || "",
|
24
|
+
summary: spec.summary,
|
25
|
+
licenseType: spec.license[:type],
|
26
|
+
licenseText: File.read(license_path),
|
27
|
+
homepage: spec.homepage
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require "cocoapods_acknowledgements/addons"
|
data/lib/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-acknowledgements-addons
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- bcylin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-05-13 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.36'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.36'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: cocoapods-acknowledgements
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description:
|
70
|
+
email:
|
71
|
+
executables: []
|
72
|
+
extensions: []
|
73
|
+
extra_rdoc_files: []
|
74
|
+
files:
|
75
|
+
- ".gitignore"
|
76
|
+
- ".gitmodules"
|
77
|
+
- CHANGELOG.md
|
78
|
+
- Gemfile
|
79
|
+
- Gemfile.lock
|
80
|
+
- LICENSE
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- cocoapods_acknowledgements_addons.gemspec
|
84
|
+
- example/.gitignore
|
85
|
+
- example/Acknowledgements/Crypto/Crypto.podspec
|
86
|
+
- example/Acknowledgements/Crypto/LICENSE
|
87
|
+
- example/App.xcodeproj/project.pbxproj
|
88
|
+
- example/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata
|
89
|
+
- example/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
|
90
|
+
- example/App.xcworkspace/contents.xcworkspacedata
|
91
|
+
- example/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
|
92
|
+
- example/App/AppDelegate.swift
|
93
|
+
- example/App/Assets.xcassets/AppIcon.appiconset/Contents.json
|
94
|
+
- example/App/Assets.xcassets/Contents.json
|
95
|
+
- example/App/Base.lproj/LaunchScreen.storyboard
|
96
|
+
- example/App/Info.plist
|
97
|
+
- example/Cartfile
|
98
|
+
- example/Cartfile.resolved
|
99
|
+
- example/Gemfile
|
100
|
+
- example/Gemfile.lock
|
101
|
+
- example/Makefile
|
102
|
+
- example/Podfile
|
103
|
+
- example/Podfile.lock
|
104
|
+
- example/README.md
|
105
|
+
- lib/cocoapods_acknowledgements/addons.rb
|
106
|
+
- lib/cocoapods_acknowledgements/addons/plist_modifier.rb
|
107
|
+
- lib/cocoapods_acknowledgements/addons/podspec_accumulator.rb
|
108
|
+
- lib/cocoapods_plugin.rb
|
109
|
+
- lib/version.rb
|
110
|
+
homepage: https://github.com/bcylin/cocoapods-acknowledgements-addons
|
111
|
+
licenses:
|
112
|
+
- MIT
|
113
|
+
metadata: {}
|
114
|
+
post_install_message:
|
115
|
+
rdoc_options: []
|
116
|
+
require_paths:
|
117
|
+
- lib
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
123
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
requirements: []
|
129
|
+
rubyforge_project:
|
130
|
+
rubygems_version: 2.6.14.1
|
131
|
+
signing_key:
|
132
|
+
specification_version: 4
|
133
|
+
summary: A CocoaPods plugin that adds additional acknowledgements to the plist generated
|
134
|
+
by cocoapods-acknowledgements.
|
135
|
+
test_files: []
|