cocoapods-static-frameworks 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/.gitignore +3 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +22 -0
- data/README.md +17 -0
- data/Rakefile +13 -0
- data/cocoapods-static-frameworks.gemspec +25 -0
- data/lib/cocoapods-static-frameworks.rb +1 -0
- data/lib/cocoapods-static-frameworks/command.rb +1 -0
- data/lib/cocoapods-static-frameworks/command/frameworks.rb +9 -0
- data/lib/cocoapods-static-frameworks/command/patch/aggregate_target.rb +30 -0
- data/lib/cocoapods-static-frameworks/command/patch/pod_xcconfig.rb +48 -0
- data/lib/cocoapods-static-frameworks/command/patch/xcconfig_helper.rb +15 -0
- data/lib/cocoapods-static-frameworks/gem_version.rb +3 -0
- data/lib/cocoapods_plugin.rb +1 -0
- data/spec/command/frameworks_spec.rb +12 -0
- data/spec/spec_helper.rb +50 -0
- metadata +105 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3520c31ee0e31808e3bb68d89debad4aaa548cf3
|
4
|
+
data.tar.gz: 6d5eafb2ff6b73880a7ace2e1a4f6dd79c6bd369
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ecc89a534042bd4a8096cd4887d12db465a185601048f7a02d7319cd28b7c999d4b75a5ab719919726fc525db87b25b79996ea8b9f89a42c0d6e0655ce673ea8
|
7
|
+
data.tar.gz: 396012f84b22f70199c7cd34a0cd96ecb52f711f0c7c9be9f51a349b74b7ebc2b0447b93868dd6667e137623390542e8aaad2b4dbc40d6547fc1a2ce4cee053f
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2017 Stefan Pühringer <me@stefanpuehringer.com>
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# cocoapods-static-frameworks
|
2
|
+
|
3
|
+
Build static instead of dynamic frameworks.
|
4
|
+
Requires Xcode 9 and CocoaPods 1.3.1
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
$ gem install cocoapods-static-frameworks
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
In your podfile:
|
13
|
+
|
14
|
+
```
|
15
|
+
plugin 'cocoapods-static-frameworks'
|
16
|
+
static_frameworks
|
17
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'cocoapods-static-frameworks/gem_version.rb'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'cocoapods-static-frameworks'
|
8
|
+
spec.version = CocoapodsStaticFrameworks::VERSION
|
9
|
+
spec.authors = ['Stefan Pühringer']
|
10
|
+
spec.email = ['me@stefanpuehringer.com']
|
11
|
+
spec.description = %q{Build static instead of dynamic frameworks.}
|
12
|
+
spec.summary = %q{Build static instead of dynamic frameworks.}
|
13
|
+
spec.homepage = 'https://github.com/b-ray/cocoapods-static-frameworks'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_runtime_dependency 'cocoapods', '1.3.1'
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
24
|
+
spec.add_development_dependency 'rake'
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-static-frameworks/gem_version'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-static-frameworks/command/frameworks'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Pod
|
2
|
+
class Podfile
|
3
|
+
def static_frameworks
|
4
|
+
require 'cocoapods-static-frameworks/command/patch/aggregate_target.rb'
|
5
|
+
require 'cocoapods-static-frameworks/command/patch/pod_xcconfig.rb'
|
6
|
+
require 'cocoapods-static-frameworks/command/patch/xcconfig_helper.rb'
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Pod
|
2
|
+
class AggregateTarget < Target
|
3
|
+
|
4
|
+
def framework_paths_by_config
|
5
|
+
@framework_paths_by_config ||= begin
|
6
|
+
framework_paths_by_config = {}
|
7
|
+
user_build_configurations.keys.each do |config|
|
8
|
+
relevant_pod_targets = pod_targets.select do |pod_target|
|
9
|
+
!pod_target.should_build? && pod_target.include_in_build_config?(target_definition, config)
|
10
|
+
end
|
11
|
+
framework_paths_by_config[config] = relevant_pod_targets.flat_map(&:framework_paths)
|
12
|
+
end
|
13
|
+
framework_paths_by_config
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def resource_paths_by_config
|
18
|
+
@resource_paths_by_config ||= begin
|
19
|
+
relevant_pod_targets = pod_targets
|
20
|
+
user_build_configurations.keys.each_with_object({}) do |config, resources_by_config|
|
21
|
+
resources_by_config[config] = relevant_pod_targets.flat_map do |pod_target|
|
22
|
+
next [] unless pod_target.include_in_build_config?(target_definition, config)
|
23
|
+
(pod_target.resource_paths + [bridge_support_file].compact).uniq
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Pod
|
2
|
+
module Generator
|
3
|
+
module XCConfig
|
4
|
+
class PodXCConfig
|
5
|
+
|
6
|
+
def generate
|
7
|
+
target_search_paths = target.build_headers.search_paths(target.platform)
|
8
|
+
sandbox_search_paths = target.sandbox.public_headers.search_paths(target.platform)
|
9
|
+
search_paths = target_search_paths.concat(sandbox_search_paths).uniq
|
10
|
+
|
11
|
+
config = {
|
12
|
+
'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ',
|
13
|
+
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
|
14
|
+
'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(search_paths),
|
15
|
+
'LIBRARY_SEARCH_PATHS' => '$(inherited) ',
|
16
|
+
'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target, @test_xcconfig),
|
17
|
+
'PODS_ROOT' => '${SRCROOT}',
|
18
|
+
'PODS_TARGET_SRCROOT' => target.pod_target_srcroot,
|
19
|
+
'PRODUCT_BUNDLE_IDENTIFIER' => 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}',
|
20
|
+
'SKIP_INSTALL' => 'YES',
|
21
|
+
'SWIFT_ACTIVE_COMPILATION_CONDITIONS' => '$(inherited) ',
|
22
|
+
'MACH_O_TYPE' => 'staticlib',
|
23
|
+
# 'USE_HEADERMAP' => 'NO'
|
24
|
+
}
|
25
|
+
|
26
|
+
@xcconfig = Xcodeproj::Config.new(config)
|
27
|
+
|
28
|
+
XCConfigHelper.add_settings_for_file_accessors_of_target(nil, target, @xcconfig)
|
29
|
+
target.file_accessors.each do |file_accessor|
|
30
|
+
@xcconfig.merge!(file_accessor.spec_consumer.pod_target_xcconfig)
|
31
|
+
end
|
32
|
+
XCConfigHelper.add_target_specific_settings(target, @xcconfig)
|
33
|
+
recursive_dependent_targets = target.recursive_dependent_targets
|
34
|
+
@xcconfig.merge! XCConfigHelper.settings_for_dependent_targets(target, recursive_dependent_targets, @test_xcconfig)
|
35
|
+
if @test_xcconfig
|
36
|
+
test_dependent_targets = [target, *target.recursive_test_dependent_targets].uniq
|
37
|
+
@xcconfig.merge! XCConfigHelper.settings_for_dependent_targets(target, test_dependent_targets - recursive_dependent_targets, @test_xcconfig)
|
38
|
+
XCConfigHelper.generate_vendored_build_settings(nil, target.all_test_dependent_targets, @xcconfig)
|
39
|
+
XCConfigHelper.generate_other_ld_flags(nil, target.all_test_dependent_targets, @xcconfig)
|
40
|
+
XCConfigHelper.generate_ld_runpath_search_paths(target, false, true, @xcconfig)
|
41
|
+
end
|
42
|
+
@xcconfig
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Pod
|
2
|
+
module Generator
|
3
|
+
module XCConfig
|
4
|
+
module XCConfigHelper
|
5
|
+
|
6
|
+
def self.generate_vendored_build_settings(aggregate_target, pod_targets, xcconfig)
|
7
|
+
pod_targets.each do |pod_target|
|
8
|
+
XCConfigHelper.add_settings_for_file_accessors_of_target(aggregate_target, pod_target, xcconfig)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-static-frameworks/command'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
describe Command::Frameworks do
|
5
|
+
describe 'CLAide' do
|
6
|
+
it 'registers it self' do
|
7
|
+
Command.parse(%w{ frameworks }).should.be.instance_of Command::Frameworks
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
3
|
+
$:.unshift((ROOT + 'lib').to_s)
|
4
|
+
$:.unshift((ROOT + 'spec').to_s)
|
5
|
+
|
6
|
+
require 'bundler/setup'
|
7
|
+
require 'bacon'
|
8
|
+
require 'mocha-on-bacon'
|
9
|
+
require 'pretty_bacon'
|
10
|
+
require 'pathname'
|
11
|
+
require 'cocoapods'
|
12
|
+
|
13
|
+
Mocha::Configuration.prevent(:stubbing_non_existent_method)
|
14
|
+
|
15
|
+
require 'cocoapods_plugin'
|
16
|
+
|
17
|
+
#-----------------------------------------------------------------------------#
|
18
|
+
|
19
|
+
module Pod
|
20
|
+
|
21
|
+
# Disable the wrapping so the output is deterministic in the tests.
|
22
|
+
#
|
23
|
+
UI.disable_wrap = true
|
24
|
+
|
25
|
+
# Redirects the messages to an internal store.
|
26
|
+
#
|
27
|
+
module UI
|
28
|
+
@output = ''
|
29
|
+
@warnings = ''
|
30
|
+
|
31
|
+
class << self
|
32
|
+
attr_accessor :output
|
33
|
+
attr_accessor :warnings
|
34
|
+
|
35
|
+
def puts(message = '')
|
36
|
+
@output << "#{message}\n"
|
37
|
+
end
|
38
|
+
|
39
|
+
def warn(message = '', actions = [])
|
40
|
+
@warnings << "#{message}\n"
|
41
|
+
end
|
42
|
+
|
43
|
+
def print(message)
|
44
|
+
@output << message
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
#-----------------------------------------------------------------------------#
|
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-static-frameworks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Stefan Pühringer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-09-10 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: 1.3.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.3.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
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
|
+
description: Build static instead of dynamic frameworks.
|
56
|
+
email:
|
57
|
+
- me@stefanpuehringer.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- cocoapods-static-frameworks.gemspec
|
68
|
+
- lib/cocoapods-static-frameworks.rb
|
69
|
+
- lib/cocoapods-static-frameworks/command.rb
|
70
|
+
- lib/cocoapods-static-frameworks/command/frameworks.rb
|
71
|
+
- lib/cocoapods-static-frameworks/command/patch/aggregate_target.rb
|
72
|
+
- lib/cocoapods-static-frameworks/command/patch/pod_xcconfig.rb
|
73
|
+
- lib/cocoapods-static-frameworks/command/patch/xcconfig_helper.rb
|
74
|
+
- lib/cocoapods-static-frameworks/gem_version.rb
|
75
|
+
- lib/cocoapods_plugin.rb
|
76
|
+
- spec/command/frameworks_spec.rb
|
77
|
+
- spec/spec_helper.rb
|
78
|
+
homepage: https://github.com/b-ray/cocoapods-static-frameworks
|
79
|
+
licenses:
|
80
|
+
- MIT
|
81
|
+
metadata: {}
|
82
|
+
post_install_message:
|
83
|
+
rdoc_options: []
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
requirements: []
|
97
|
+
rubyforge_project:
|
98
|
+
rubygems_version: 2.6.12
|
99
|
+
signing_key:
|
100
|
+
specification_version: 4
|
101
|
+
summary: Build static instead of dynamic frameworks.
|
102
|
+
test_files:
|
103
|
+
- spec/command/frameworks_spec.rb
|
104
|
+
- spec/spec_helper.rb
|
105
|
+
has_rdoc:
|