Skip to content

Instantly share code, notes, and snippets.

@tonyarnold
Created May 17, 2014 03:24
Show Gist options
  • Save tonyarnold/bb87477beec5726e5681 to your computer and use it in GitHub Desktop.
Save tonyarnold/bb87477beec5726e5681 to your computer and use it in GitHub Desktop.
Pod::Spec.new do |s|
s.name = 'MagicalRecord'
s.version = '2.3.0.rc.1'
s.license = 'MIT'
s.summary = 'Super Awesome Easy Fetching for Core Data 1!!!11!!!!1!.'
s.homepage = 'http://github.com/magicalpanda/MagicalRecord'
s.author = { 'Saul Mora' => '[email protected]' }
s.source = { :git => 'https://github.com/magicalpanda/MagicalRecord.git', :tag => "#{s.version}" }
s.description = 'Handy fetching, threading and data import helpers to make Core Data a little easier to use.'
s.framework = 'CoreData'
s.requires_arc = true
s.default_subspec = 'Core'
s.subspec "Core" do |sp|
sp.source_files = 'MagicalRecord/**/*.{h,m}'
sp.prefix_header_contents = '#import <CoreData/CoreData.h>', '#import "CoreData+MagicalRecord.h"'
end
s.subspec "Shorthand" do |sp|
sp.source_files = 'MagicalRecord/**/*.{h,m}'
sp.prefix_header_contents = '#define MR_SHORTHAND 0', '#import <CoreData/CoreData.h>', '#import "CoreData+MagicalRecord.h"'
end
s.subspec "CoreWithCocoaLumberjack" do |sp|
sp.dependency 'CocoaLumberjack'
sp.source_files = 'MagicalRecord/**/*.{h,m}'
sp.prefix_header_contents = '#import <CoreData/CoreData.h>', '#import <CocoaLumberjack/DDLog.h>', '#import "CoreData+MagicalRecord.h"'
end
s.subspec "ShorthandWithCocoaLumberjack" do |sp|
sp.dependency 'CocoaLumberjack'
sp.source_files = 'MagicalRecord/**/*.{h,m}'
sp.prefix_header_contents = '#define MR_SHORTHAND 0', '#import <CoreData/CoreData.h>', '#import <CocoaLumberjack/DDLog.h>', '#import "CoreData+MagicalRecord.h"'
end
end
@AliSoftware
Copy link

Tip: if you want to simplify, don't forget that podspecs are also Ruby. So even if you have to specify sp.source_files for each subspec, you can at least write all_files = 'MagicalRecord/**/*.{h,m}' then use sp.source_files = all_filesin each subspec to avoid repetition and avoid having to change it everywhere in case you need to change the list of files everywhere one day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment