├── .gitignore ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── Rakefile ├── cocoapods-foundation-headers.gemspec ├── lib ├── cocoapods-foundation-headers.rb ├── cocoapods-foundation-headers │ ├── foundation_headers.rb │ └── gem_version.rb └── cocoapods_plugin.rb └── spec ├── command └── headers_spec.rb └── spec_helper.rb /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | pkg 3 | .idea/ 4 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gemspec 4 | 5 | group :development do 6 | gem "cocoapods" 7 | 8 | gem "mocha" 9 | gem "bacon" 10 | gem "mocha-on-bacon" 11 | gem "prettybacon" 12 | end 13 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | cocoapods-foundation-headers (1.0.0) 5 | 6 | GEM 7 | remote: https://rubygems.org/ 8 | specs: 9 | CFPropertyList (2.3.5) 10 | activesupport (4.2.9) 11 | i18n (~> 0.7) 12 | minitest (~> 5.1) 13 | thread_safe (~> 0.3, >= 0.3.4) 14 | tzinfo (~> 1.1) 15 | bacon (1.2.0) 16 | claide (1.0.2) 17 | cocoapods (1.3.1) 18 | activesupport (>= 4.0.2, < 5) 19 | claide (>= 1.0.2, < 2.0) 20 | cocoapods-core (= 1.3.1) 21 | cocoapods-deintegrate (>= 1.0.1, < 2.0) 22 | cocoapods-downloader (>= 1.1.3, < 2.0) 23 | cocoapods-plugins (>= 1.0.0, < 2.0) 24 | cocoapods-search (>= 1.0.0, < 2.0) 25 | cocoapods-stats (>= 1.0.0, < 2.0) 26 | cocoapods-trunk (>= 1.2.0, < 2.0) 27 | cocoapods-try (>= 1.1.0, < 2.0) 28 | colored2 (~> 3.1) 29 | escape (~> 0.0.4) 30 | fourflusher (~> 2.0.1) 31 | gh_inspector (~> 1.0) 32 | molinillo (~> 0.5.7) 33 | nap (~> 1.0) 34 | ruby-macho (~> 1.1) 35 | xcodeproj (>= 1.5.1, < 2.0) 36 | cocoapods-core (1.3.1) 37 | activesupport (>= 4.0.2, < 6) 38 | fuzzy_match (~> 2.0.4) 39 | nap (~> 1.0) 40 | cocoapods-deintegrate (1.0.1) 41 | cocoapods-downloader (1.6.3) 42 | cocoapods-plugins (1.0.0) 43 | nap 44 | cocoapods-search (1.0.0) 45 | cocoapods-stats (1.0.0) 46 | cocoapods-trunk (1.2.0) 47 | nap (>= 0.8, < 2.0) 48 | netrc (= 0.7.8) 49 | cocoapods-try (1.1.0) 50 | colored2 (3.1.2) 51 | escape (0.0.4) 52 | fourflusher (2.0.1) 53 | fuzzy_match (2.0.4) 54 | gh_inspector (1.0.3) 55 | i18n (0.8.6) 56 | metaclass (0.0.4) 57 | minitest (5.10.3) 58 | mocha (1.1.0) 59 | metaclass (~> 0.0.1) 60 | mocha-on-bacon (0.2.2) 61 | mocha (>= 0.13.0) 62 | molinillo (0.5.7) 63 | nanaimo (0.2.3) 64 | nap (1.1.0) 65 | netrc (0.7.8) 66 | prettybacon (0.0.2) 67 | bacon (~> 1.2) 68 | rake (13.0.1) 69 | ruby-macho (1.1.0) 70 | thread_safe (0.3.6) 71 | tzinfo (1.2.10) 72 | thread_safe (~> 0.1) 73 | xcodeproj (1.5.1) 74 | CFPropertyList (~> 2.3.3) 75 | claide (>= 1.0.2, < 2.0) 76 | colored2 (~> 3.1) 77 | nanaimo (~> 0.2.3) 78 | 79 | PLATFORMS 80 | ruby 81 | 82 | DEPENDENCIES 83 | bacon 84 | bundler (~> 1.3) 85 | cocoapods 86 | cocoapods-foundation-headers! 87 | mocha 88 | mocha-on-bacon 89 | prettybacon 90 | rake 91 | 92 | BUNDLED WITH 93 | 1.14.6 94 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Keith Smiley (http://keith.so) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the 'Software'), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cocoapods-foundation-headers 2 | 3 | A [CocoaPods](https://cocoapods.org/) plugin for importing `Foundation` 4 | instead of `UIKit`/`Cocoa` in the generated headers and pch files. See 5 | [this issue](https://github.com/CocoaPods/CocoaPods/issues/6815) for 6 | more details. 7 | 8 | ## Installation 9 | 10 | ``` 11 | $ gem install cocoapods-foundation-headers 12 | ``` 13 | 14 | ## Usage 15 | 16 | In your `Podfile` add: 17 | 18 | ```ruby 19 | plugin "cocoapods-foundation-headers" 20 | ``` 21 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | 3 | def specs(dir) 4 | FileList["spec/#{ dir }/*_spec.rb"].shuffle.join(" ") 5 | end 6 | 7 | desc "Runs all the specs" 8 | task :specs do 9 | sh "bundle exec bacon #{ specs("**") }" 10 | end 11 | 12 | task :default => :specs 13 | -------------------------------------------------------------------------------- /cocoapods-foundation-headers.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path("../lib", __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require "cocoapods-foundation-headers/gem_version.rb" 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = "cocoapods-foundation-headers" 8 | spec.version = CocoapodsFoundationHeaders::VERSION 9 | spec.authors = ["Keith Smiley"] 10 | spec.email = ["keithbsmiley@gmail.com"] 11 | spec.summary = "A CocoaPods plugin for using Foundation instead of UIKit/Cocoa in generated headers" 12 | spec.homepage = "https://github.com/keith/cocoapods-foundation-headers" 13 | spec.license = "MIT" 14 | 15 | spec.files = `git ls-files`.split($/) 16 | spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } 17 | spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 18 | spec.require_paths = ["lib"] 19 | 20 | spec.add_development_dependency "bundler", "~> 1.3" 21 | spec.add_development_dependency "rake" 22 | end 23 | -------------------------------------------------------------------------------- /lib/cocoapods-foundation-headers.rb: -------------------------------------------------------------------------------- 1 | require 'cocoapods-foundation-headers/gem_version' 2 | -------------------------------------------------------------------------------- /lib/cocoapods-foundation-headers/foundation_headers.rb: -------------------------------------------------------------------------------- 1 | module Pod 2 | module Generator 3 | class Header 4 | def generate_platform_import_header 5 | "#import \n" 6 | end 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/cocoapods-foundation-headers/gem_version.rb: -------------------------------------------------------------------------------- 1 | module CocoapodsFoundationHeaders 2 | VERSION = "1.0.1" 3 | end 4 | -------------------------------------------------------------------------------- /lib/cocoapods_plugin.rb: -------------------------------------------------------------------------------- 1 | Pod::HooksManager.register('cocoapods-foundation-headers', :pre_install) do |context, options| 2 | require 'cocoapods-foundation-headers/foundation_headers' 3 | end 4 | -------------------------------------------------------------------------------- /spec/command/headers_spec.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path("../../spec_helper", __FILE__) 2 | 3 | module Pod 4 | describe Generator::Header do 5 | describe "platform header imports" do 6 | it "always returns foundation" do 7 | Platform.all.each do |platform| 8 | header = Generator::Header.new platform 9 | header.generate.should.include? "Foundation" 10 | end 11 | end 12 | 13 | it "never includes UIKit or AppKit" do 14 | Platform.all.each do |platform| 15 | header = Generator::Header.new platform 16 | header.generate.should.not.include? "UIKit" 17 | header.generate.should.not.include? "Cocoa" 18 | end 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 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 | --------------------------------------------------------------------------------