Authored by Justin R. Miller

fixes #153: added podspec for direct CocoaPods use

  1 +Pod::Spec.new do |m|
  2 +
  3 + m.name = 'MapBox'
  4 + m.version = '0.5.0'
  5 +
  6 + m.summary = 'Open source alternative to MapKit.'
  7 + m.description = 'Open source alternative to MapKit supporting custom tile sources, offline use, and complete cache control.'
  8 + m.homepage = 'http://mapbox.com/mobile'
  9 + m.license = 'BSD'
  10 + m.author = { 'Justin R. Miller' => 'justin@mapbox.com' }
  11 +
  12 + m.source = { :git => 'https://github.com/mapbox/mapbox-ios-sdk.git' }
  13 +
  14 + m.platform = :ios, '5.0'
  15 +
  16 + m.source_files = 'Proj4/*.h', 'MapView/Map/*.{h,c,m}'
  17 +
  18 + m.prefix_header_file = 'MapView/MapView_Prefix.pch'
  19 +
  20 + def m.post_install(target_installer)
  21 + puts "\nGenerating MapBox resources bundle\n".yellow if config.verbose?
  22 + Dir.chdir File.join(config.project_pods_root, 'MapBox') do
  23 + command = "xcodebuild -project MapView/MapView.xcodeproj -target Resources CONFIGURATION_BUILD_DIR=../../Resources"
  24 + command << " 2>&1 > /dev/null" unless config.verbose?
  25 + unless system(command)
  26 + raise ::Pod::Informative, "Failed to generate MapBox resources bundle"
  27 + end
  28 + end
  29 + File.open(File.join(config.project_pods_root, target_installer.target_definition.copy_resources_script_name), 'a') do |file|
  30 + file.puts "install_resource 'Resources/MapBox.bundle'"
  31 + end
  32 + end
  33 +
  34 + m.documentation = {
  35 + :html => 'http://mapbox.com/mapbox-ios-sdk/api/',
  36 + :appledoc => [
  37 + '--project-company', 'MapBox',
  38 + '--docset-copyright', 'MapBox',
  39 + '--no-keep-undocumented-objects',
  40 + '--no-keep-undocumented-members',
  41 + '--ignore', '.c',
  42 + '--ignore', '.m',
  43 + '--ignore', 'Proj4',
  44 + '--ignore', 'RMAttributionViewController.h',
  45 + '--ignore', 'RMBingSource.h',
  46 + '--ignore', 'RMConfiguration.h',
  47 + '--ignore', 'RMCoordinateGridSource.h',
  48 + '--ignore', 'RMDBMapSource.h',
  49 + '--ignore', 'RMFoundation.h',
  50 + '--ignore', 'RMFractalTileProjection.h',
  51 + '--ignore', 'RMGenericMapSource.h',
  52 + '--ignore', 'RMGlobalConstants.h',
  53 + '--ignore', 'RMLoadingTileView.h',
  54 + '--ignore', 'RMMapOverlayView.h',
  55 + '--ignore', 'RMMapQuestOpenAerialSource.h',
  56 + '--ignore', 'RMMapQuestOSMSource.h',
  57 + '--ignore', 'RMMapScrollView.h',
  58 + '--ignore', 'RMMapTiledLayerView.h',
  59 + '--ignore', 'RMNotifications.h',
  60 + '--ignore', 'RMOpenCycleMapSource.h',
  61 + '--ignore', 'RMOpenSeaMapLayer.h',
  62 + '--ignore', 'RMOpenSeaMapSource.h',
  63 + '--ignore', 'RMPixel.h',
  64 + '--ignore', 'RMProjection.h',
  65 + '--ignore', 'RMTile.h',
  66 + '--ignore', 'RMTileImage.h',
  67 + '--ignore', 'RMTileSourcesContainer.h',
  68 + ]
  69 + }
  70 +
  71 + m.framework = 'CoreGraphics'
  72 + m.framework = 'CoreLocation'
  73 + m.framework = 'Foundation'
  74 + m.framework = 'QuartzCore'
  75 + m.framework = 'UIKit'
  76 +
  77 + m.library = 'Proj4'
  78 + m.library = 'sqlite3'
  79 + m.library = 'z'
  80 +
  81 + m.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC', 'LIBRARY_SEARCH_PATHS' => '"${PODS_ROOT}/MapBox/Proj4"' }
  82 +
  83 + m.preserve_paths = 'Proj4/libProj4.a', 'MapView/MapView.xcodeproj', 'MapView/Map/Resources'
  84 +
  85 + m.dependency 'FMDB', '2.0'
  86 + m.dependency 'GRMustache', '5.4.3'
  87 + m.dependency 'SMCalloutView', '1.0.1'
  88 +
  89 +end