vendor 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile.lock +2 -4
  3. data/LICENSE +20 -0
  4. data/Readme.markdown +91 -10
  5. data/bin/vendor +5 -53
  6. data/lib/vendor.rb +37 -26
  7. data/lib/vendor/api.rb +1 -1
  8. data/lib/vendor/cli.rb +3 -15
  9. data/lib/vendor/cli/app.rb +140 -0
  10. data/lib/vendor/cli/auth.rb +6 -4
  11. data/lib/vendor/cli/console.rb +25 -0
  12. data/lib/vendor/extensions/string.rb +1 -1
  13. data/lib/vendor/template.rb +55 -0
  14. data/lib/vendor/templates/Vendorfile +3 -0
  15. data/lib/vendor/templates/vendorspec +15 -0
  16. data/lib/vendor/ui.rb +62 -0
  17. data/lib/vendor/vendor_file.rb +12 -0
  18. data/lib/vendor/vendor_file/dsl.rb +54 -0
  19. data/lib/vendor/vendor_file/library.rb +16 -0
  20. data/lib/vendor/vendor_file/library/base.rb +95 -0
  21. data/lib/vendor/vendor_file/library/git.rb +71 -0
  22. data/lib/vendor/vendor_file/library/local.rb +22 -0
  23. data/lib/vendor/vendor_file/library/remote.rb +18 -0
  24. data/lib/vendor/vendor_file/loader.rb +36 -0
  25. data/lib/vendor/vendor_file/source.rb +21 -0
  26. data/lib/vendor/vendor_spec.rb +11 -0
  27. data/lib/vendor/vendor_spec/builder.rb +10 -3
  28. data/lib/vendor/version.rb +1 -1
  29. data/lib/vendor/xcode.rb +10 -0
  30. data/lib/vendor/xcode/project.rb +132 -19
  31. data/lib/vendor/xcode/proxy.rb +28 -0
  32. data/lib/vendor/xcode/{object.rb → proxy/base.rb} +52 -25
  33. data/lib/vendor/xcode/proxy/pbx_build_file.rb +9 -0
  34. data/lib/vendor/xcode/proxy/pbx_container_item_proxy.rb +8 -0
  35. data/lib/vendor/xcode/proxy/pbx_file_reference.rb +39 -0
  36. data/lib/vendor/xcode/proxy/pbx_frameworks_build_phase.rb +9 -0
  37. data/lib/vendor/xcode/proxy/pbx_group.rb +35 -0
  38. data/lib/vendor/xcode/{objects → proxy}/pbx_native_target.rb +2 -2
  39. data/lib/vendor/xcode/{objects → proxy}/pbx_project.rb +2 -2
  40. data/lib/vendor/xcode/proxy/pbx_resources_build_phase.rb +7 -0
  41. data/lib/vendor/xcode/proxy/pbx_shell_script_build_phase.rb +7 -0
  42. data/lib/vendor/xcode/proxy/pbx_sources_build_phase.rb +9 -0
  43. data/lib/vendor/xcode/proxy/pbx_target_dependency.rb +7 -0
  44. data/lib/vendor/xcode/proxy/pbx_variant_group.rb +7 -0
  45. data/lib/vendor/xcode/proxy/xc_build_configuration.rb +7 -0
  46. data/lib/vendor/xcode/proxy/xc_configuration_list.rb +9 -0
  47. data/lib/vendor/xcode/proxy/xc_version_group.rb +7 -0
  48. data/spec/{vendor → lib/vendor}/api_spec.rb +0 -0
  49. data/spec/{vendor → lib/vendor}/cli/auth_spec.rb +1 -1
  50. data/spec/{vendor → lib/vendor}/config_spec.rb +1 -1
  51. data/spec/lib/vendor/template_spec.rb +36 -0
  52. data/spec/lib/vendor/vendor_file/dsl_spec.rb +5 -0
  53. data/spec/lib/vendor/vendor_file/library/base_spec.rb +148 -0
  54. data/spec/lib/vendor/vendor_file/library/git_spec.rb +33 -0
  55. data/spec/lib/vendor/vendor_file/library/local_spec.rb +19 -0
  56. data/spec/lib/vendor/vendor_file/library/remote_spec.rb +13 -0
  57. data/spec/lib/vendor/vendor_file/loader_spec.rb +102 -0
  58. data/spec/lib/vendor/vendor_file/source_spec.rb +17 -0
  59. data/spec/{vendor → lib/vendor}/vendor_spec/builder_spec.rb +0 -0
  60. data/spec/{vendor → lib/vendor}/vendor_spec/dsl_spec.rb +0 -0
  61. data/spec/{vendor → lib/vendor}/vendor_spec/loader_spec.rb +1 -1
  62. data/spec/lib/vendor/xcode/project_spec.rb +400 -0
  63. data/spec/{vendor/xcode/object_spec.rb → lib/vendor/xcode/proxy/base_spec.rb} +15 -3
  64. data/spec/lib/vendor/xcode/proxy/pbx_file_reference_spec.rb +25 -0
  65. data/spec/lib/vendor/xcode/proxy/pbx_group_spec.rb +27 -0
  66. data/spec/{vendor/xcode/objects → lib/vendor/xcode/proxy}/pbx_project_spec.rb +1 -1
  67. data/spec/spec_helper.rb +5 -3
  68. data/spec/support/api_stubs.rb +4 -3
  69. data/spec/support/resources/Vendorfile +22 -0
  70. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/BICoreDataCache.mom +0 -0
  71. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/BMMapCalloutView.nib +0 -0
  72. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/Info.plist +0 -0
  73. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/bingmaps_logo.png +0 -0
  74. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/bingmaps_logo@2x.png +0 -0
  75. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_selected_comp.png +0 -0
  76. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_selected_comp@2x.png +0 -0
  77. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected.png +0 -0
  78. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected@2x.png +0 -0
  79. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected_comp.png +0 -0
  80. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/blue_unselected_comp@2x.png +0 -0
  81. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/callout_white.png +0 -0
  82. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/callout_white@2x.png +0 -0
  83. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_selected_comp.png +0 -0
  84. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_selected_comp@2x.png +0 -0
  85. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected.png +0 -0
  86. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected@2x.png +0 -0
  87. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected_comp.png +0 -0
  88. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/green_unselected_comp@2x.png +0 -0
  89. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/mapConfiguration.plist +0 -0
  90. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/me_dot_128.png +0 -0
  91. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/networkDefaults.plist +0 -0
  92. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_selected_comp.png +0 -0
  93. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_selected_comp@2x.png +0 -0
  94. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected.png +0 -0
  95. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected@2x.png +0 -0
  96. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected_comp.png +0 -0
  97. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/orange_unselected_comp@2x.png +0 -0
  98. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_selected_comp.png +0 -0
  99. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_selected_comp@2x.png +0 -0
  100. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected.png +0 -0
  101. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected@2x.png +0 -0
  102. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected_comp.png +0 -0
  103. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/purple_unselected_comp@2x.png +0 -0
  104. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_selected_comp.png +0 -0
  105. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_selected_comp@2x.png +0 -0
  106. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected.png +0 -0
  107. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected@2x.png +0 -0
  108. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected_comp.png +0 -0
  109. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/red_unselected_comp@2x.png +0 -0
  110. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/shadow.png +0 -0
  111. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/shadow@2x.png +0 -0
  112. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_selected_comp.png +0 -0
  113. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_selected_comp@2x.png +0 -0
  114. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected.png +0 -0
  115. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected@2x.png +0 -0
  116. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected_comp.png +0 -0
  117. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps.Resources.bundle/yellow_unselected_comp@2x.png +0 -0
  118. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMEntity.h +34 -0
  119. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMGeometry.h +67 -0
  120. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMMapView.h +159 -0
  121. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMMarker.h +41 -0
  122. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMMarkerView.h +47 -0
  123. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMPushpinView.h +31 -0
  124. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMReverseGeocoder.h +63 -0
  125. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMTypes.h +25 -0
  126. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BMUserLocation.h +26 -0
  127. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/BingMaps/BingMaps.h +210 -0
  128. data/spec/support/resources/cache/base/BingMapsIOS/MapControl/libBingMaps.a +0 -0
  129. data/spec/support/resources/cache/base/BingMapsIOS/README.html +8 -0
  130. data/spec/support/resources/cache/base/DKBenchmark-Manifest/data/DKBenchmark.h +18 -0
  131. data/spec/support/resources/cache/base/DKBenchmark-Manifest/data/DKBenchmark.m +73 -0
  132. data/spec/support/resources/cache/base/DKBenchmark-Manifest/vendor.json +1 -0
  133. data/spec/support/resources/cache/base/DKBenchmark-Vendorspec/DKBenchmark.h +18 -0
  134. data/spec/support/resources/cache/base/DKBenchmark-Vendorspec/DKBenchmark.m +73 -0
  135. data/spec/support/resources/cache/base/DKBenchmark-Vendorspec/DKBenchmark.vendorspec +11 -0
  136. data/spec/support/resources/projects/TabBarWithUnitTests/TabBarWithUnitTests.xcodeproj/project.pbxproj +10 -0
  137. data/spec/support/resources/projects/UtilityApplication/UtilityApplication.xcodeproj/project.pbxproj +288 -0
  138. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAAppDelegate.h +15 -0
  139. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAAppDelegate.m +60 -0
  140. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAFlipsideViewController.h +23 -0
  141. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAFlipsideViewController.m +69 -0
  142. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAMainViewController.h +13 -0
  143. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UAMainViewController.m +75 -0
  144. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UtilityApplication-Info.plist +42 -0
  145. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/UtilityApplication-Prefix.pch +14 -0
  146. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/en.lproj/InfoPlist.strings +2 -0
  147. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/en.lproj/MainStoryboard.storyboard +90 -0
  148. data/spec/support/resources/projects/UtilityApplication/UtilityApplication/main.m +18 -0
  149. data/spec/support/resources/{files → source}/SecondViewController.h +0 -0
  150. data/spec/support/resources/{files → source}/SecondViewController.m +0 -0
  151. data/vendor.gemspec +0 -1
  152. metadata +254 -74
  153. data/LICENCE +0 -19
  154. data/lib/vendor/xcode/objects/pbx_build_file.rb +0 -9
  155. data/lib/vendor/xcode/objects/pbx_container_item_proxy.rb +0 -8
  156. data/lib/vendor/xcode/objects/pbx_file_reference.rb +0 -21
  157. data/lib/vendor/xcode/objects/pbx_frameworks_build_phase.rb +0 -9
  158. data/lib/vendor/xcode/objects/pbx_group.rb +0 -13
  159. data/lib/vendor/xcode/objects/pbx_resources_build_phase.rb +0 -7
  160. data/lib/vendor/xcode/objects/pbx_shell_script_build_phase.rb +0 -7
  161. data/lib/vendor/xcode/objects/pbx_sources_build_phase.rb +0 -9
  162. data/lib/vendor/xcode/objects/pbx_target_dependency.rb +0 -7
  163. data/lib/vendor/xcode/objects/pbx_variant_group.rb +0 -7
  164. data/lib/vendor/xcode/objects/xc_build_configuration.rb +0 -7
  165. data/lib/vendor/xcode/objects/xc_configuration_list.rb +0 -9
  166. data/spec/vendor/xcode/project_spec.rb +0 -211
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Vendor::XCode::Object do
3
+ describe Vendor::XCode::Proxy::Base do
4
4
 
5
5
  before :all do
6
6
  @project = Vendor::XCode::Project.new(File.join(PROJECT_RESOURCE_PATH, "ProjectWithSpecs/ProjectWithSpecs.xcodeproj"))
@@ -10,7 +10,7 @@ describe Vendor::XCode::Object do
10
10
  context "#inspect" do
11
11
 
12
12
  it "should give you the attributes in the object" do
13
- @pbx_project.build_configuration_list.inspect.should include("Vendor::XCode::Objects::XCConfigurationList")
13
+ @pbx_project.build_configuration_list.inspect.should include("Vendor::XCode::Proxy::XCConfigurationList")
14
14
  @pbx_project.build_configuration_list.inspect.should include("id: \"53787482140109AE00D9B746\"")
15
15
  @pbx_project.build_configuration_list.inspect.should include("build_configurations: [\"53787484140109AE00D9B746\", \"53787485140109AE00D9B746\"]")
16
16
  @pbx_project.build_configuration_list.inspect.should include("default_configuration_is_visible: \"0\"")
@@ -22,7 +22,19 @@ describe Vendor::XCode::Object do
22
22
  context "#attribute_name"do
23
23
 
24
24
  it "should convert the attribute to the correct format used in the project file (camel case)" do
25
- Vendor::XCode::Object.attribute_name('build_config_list').should == "buildConfigList"
25
+ Vendor::XCode::Proxy::Base.attribute_name('build_config_list').should == "buildConfigList"
26
+ end
27
+
28
+ end
29
+
30
+ context "#respond_to?" do
31
+
32
+ it "should return true if it has the attribute" do
33
+ @pbx_project.respond_to?(:compatibility_version).should be_true
34
+ end
35
+
36
+ it "should return false if the method isn't really there" do
37
+ @pbx_project.respond_to?(:blah).should be_false
26
38
  end
27
39
 
28
40
  end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe Vendor::XCode::Proxy::PBXFileReference do
4
+
5
+ describe "#file_type_from_extension" do
6
+
7
+ { ".h" => "sourcecode.c.h",
8
+ ".m" => "sourcecode.c.objc",
9
+ ".bundle" => "wrapper.plug-in",
10
+ ".framework" => "wrapper.framework",
11
+ ".a" => "archive.ar",
12
+ ".strings" => "text.plist.strings",
13
+ ".plist" => "text.plist.xml",
14
+ ".png" => "image.png",
15
+ ".jpg" => "image.jpg" }.each do |key, value|
16
+
17
+ it "when passing #{key} should return #{value}" do
18
+ Vendor::XCode::Proxy::PBXFileReference.file_type_from_extension(key).should == value
19
+ end
20
+
21
+ end
22
+
23
+ end
24
+
25
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe Vendor::XCode::Proxy::PBXGroup do
4
+
5
+ before :all do
6
+ @project = Vendor::XCode::Project.new(File.join(PROJECT_RESOURCE_PATH, "UtilityApplication/UtilityApplication.xcodeproj"))
7
+
8
+ @pbx_group = @project.find_group("UtilityApplication/Supporting Files")
9
+ end
10
+
11
+ describe "#parent" do
12
+
13
+ it "should return the parent of the group" do
14
+ @pbx_group.parent.should == @project.find_group("UtilityApplication")
15
+ end
16
+
17
+ end
18
+
19
+ describe "#full_path" do
20
+
21
+ it "should return the path of the group" do
22
+ @pbx_group.full_path.should == "UtilityApplication/Supporting Files"
23
+ end
24
+
25
+ end
26
+
27
+ end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Vendor::XCode::Project do
3
+ describe Vendor::XCode::Proxy::PBXProject do
4
4
 
5
5
  before :all do
6
6
  @project = Vendor::XCode::Project.new(File.join(PROJECT_RESOURCE_PATH, "ProjectWithSpecs/ProjectWithSpecs.xcodeproj"))
@@ -6,9 +6,11 @@ require './lib/vendor/cli'
6
6
 
7
7
  Dir["spec/support/**/*.rb"].each { |f| require "./#{f}" }
8
8
 
9
- PROJECT_RESOURCE_PATH = File.join(File.dirname(__FILE__), "support", "resources", "projects")
10
- FILE_RESOURCE_PATH = File.join(File.dirname(__FILE__), "support", "resources", "files")
11
- VENDOR_RESOURCE_PATH = File.join(File.dirname(__FILE__), "support", "resources", "vendors")
9
+ RESOURCE_PATH = File.join(File.dirname(__FILE__), "support", "resources")
10
+ PROJECT_RESOURCE_PATH = File.join(RESOURCE_PATH, "projects")
11
+ SOURCE_RESOURCE_PATH = File.join(RESOURCE_PATH, "source")
12
+ VENDOR_RESOURCE_PATH = File.join(RESOURCE_PATH, "vendors")
13
+ CACHED_VENDOR_RESOURCE_PATH = File.join(RESOURCE_PATH, "cache")
12
14
 
13
15
  TEMP_PROJECT_PATH = File.join(File.dirname(__FILE__), "..", "tmp")
14
16
 
@@ -1,12 +1,13 @@
1
1
  require 'fakeweb'
2
+ require 'json'
2
3
 
3
- FakeWeb.register_uri :get, "http://keithpitt:password@vendorage.com/users/keithpitt/api_key.json",
4
+ FakeWeb.register_uri :get, "http://keithpitt:password@vendorforge.org/users/keithpitt/api_key.json",
4
5
  :body => { :api_key => "secret" }.to_json
5
6
 
6
- FakeWeb.register_uri :get, "http://keithpitt:wrong@vendorage.com/users/keithpitt/api_key.json",
7
+ FakeWeb.register_uri :get, "http://keithpitt:wrong@vendorforge.org/users/keithpitt/api_key.json",
7
8
  :status => 401
8
9
 
9
- FakeWeb.register_uri :get, "http://keithpitt:error@vendorage.com/users/keithpitt/api_key.json",
10
+ FakeWeb.register_uri :get, "http://keithpitt:error@vendorforge.org/users/keithpitt/api_key.json",
10
11
  :status => 500
11
12
 
12
13
  FakeWeb.allow_net_connect = false
@@ -0,0 +1,22 @@
1
+ source :vendorforge
2
+ source "http://vendorage.com"
3
+
4
+ lib "Lib"
5
+ lib "LibWithVersion", "4.1"
6
+ lib "LibWithGreaterThanVersion", ">=1.0"
7
+ lib "LibWithApproxVersionAndTarget", "~>1.0", :target => "something"
8
+
9
+ lib "LibWithGit", :git => "https://github.com/keithpitt/vendor.git", :require => "Some/Folder"
10
+ lib "LibWithGitAndBranch", :git => "https://github.com/keithpitt/vendor.git", :branch => "1.4"
11
+ lib "LibWithGitAndTag", :git => "https://github.com/keithpitt/vendor.git", :tag => "v0.13.4"
12
+ lib "LibWithGitAndRef", :git => "https://github.com/keithpitt/vendor.git", :ref => "some-ref"
13
+
14
+ lib "LibWithPath", :path => "~/Development/Library/Path"
15
+
16
+ lib "LibWithSpecificTarget", :target => "UISpecs"
17
+ lib "LibWithMultipleTarget", :target => [ "Specs", "UISpecs" ]
18
+
19
+ target "Specs", "UISpecs" do
20
+ lib "SpecLib1"
21
+ lib "SpecLib2"
22
+ end
@@ -0,0 +1,34 @@
1
+ //
2
+ // BMEntity.h
3
+ // BingMaps
4
+ //
5
+ // Copyright (c) 2011 Microsoft Corporation. All rights reserved.
6
+ //
7
+
8
+ #import <UIKit/UIKit.h>
9
+ #import <CoreLocation/CoreLocation.h>
10
+ #import <BingMaps/BMGeometry.h>
11
+ #import <BingMaps/BMTypes.h>
12
+ #import <BingMaps/BMMarker.h>
13
+
14
+ @class BMEntityInternal;
15
+
16
+ @interface BMEntity : NSObject <BMMarker> {
17
+ @private
18
+ BMEntityInternal* _internal;
19
+ }
20
+
21
+ - (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate
22
+ bingAddressDictionary:(NSDictionary *)addressDictionary;
23
+
24
+ @property (nonatomic, readonly) NSDictionary *addressDictionary;
25
+ @property (nonatomic, readonly) NSString *addressLine;
26
+ @property (nonatomic, readonly) NSString *adminDistrict;
27
+ @property (nonatomic, readonly) NSString *adminDistrict2;
28
+ @property (nonatomic, readonly) NSString *locality;
29
+ @property (nonatomic, readonly) NSString *postalCode;
30
+ @property (nonatomic, readonly) NSString *countryRegion;
31
+ @property (nonatomic, readonly) NSString *formattedAddress;
32
+
33
+ @end
34
+
@@ -0,0 +1,67 @@
1
+ //
2
+ // BMGeometry.h
3
+ // BingMaps
4
+ //
5
+ // Copyright (c) 2011 Microsoft Corporation. All rights reserved.
6
+ //
7
+
8
+ #import <UIKit/UIKit.h>
9
+ #import <CoreLocation/CoreLocation.h>
10
+
11
+ /** @brief BMCoordinateSpan defines the area spanned by a BMCoordinateRegion.
12
+ *
13
+ * @param latitudeDelta The delta between the north-most and south-most points of the span
14
+ * @param longitudeDelta The delta between the east-most and west-most points of the span
15
+ *
16
+ * @sa BMCoordinateRegion
17
+ */
18
+ typedef struct {
19
+ CLLocationDegrees latitudeDelta;
20
+ CLLocationDegrees longitudeDelta;
21
+ } BMCoordinateSpan;
22
+
23
+ /** @brief BMCoordinateRegion defines which portion of the map to display.
24
+ *
25
+ * @param center The center coordinate for the new BMCoordinateRegion
26
+ * @param span The horizontal and vertical spans for the new BMCoordinateRegion
27
+ *
28
+ * @sa BMCoordinateSpan
29
+ */
30
+ typedef struct {
31
+ CLLocationCoordinate2D center;
32
+ BMCoordinateSpan span;
33
+ } BMCoordinateRegion;
34
+
35
+ /** @brief Creates a new BMCoordinateSpan
36
+ *
37
+ * @param latitudeDelta The delta between the north-most and south-most points of the span
38
+ * @param longitudeDelta The delta between the east-most and west-most points of the span
39
+ *
40
+ * @return A new BMCoordinateSpan
41
+ *
42
+ * @sa BMCoordinateRegionMake
43
+ */
44
+ UIKIT_STATIC_INLINE BMCoordinateSpan BMCoordinateSpanMake( CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta ) {
45
+ BMCoordinateSpan span;
46
+ span.latitudeDelta = latitudeDelta;
47
+ span.longitudeDelta = longitudeDelta;
48
+ return span;
49
+ }
50
+
51
+ /** @brief Creates a new BMCoordinateRegion
52
+ *
53
+ * @param centerCoordinate The center coordinate for the new BMCoordinateRegion
54
+ * @param span The horizontal and vertical spans for the new BMCoordinateRegion
55
+ *
56
+ * @return A new BMCoordinateRegion
57
+ *
58
+ * @sa BMCoordinateSpanMake
59
+ */
60
+ UIKIT_STATIC_INLINE BMCoordinateRegion BMCoordinateRegionMake( CLLocationCoordinate2D centerCoordinate, BMCoordinateSpan span ) {
61
+ BMCoordinateRegion region;
62
+ region.center = centerCoordinate;
63
+ region.span = span;
64
+ return region;
65
+ }
66
+
67
+ UIKIT_EXTERN BMCoordinateRegion BMCoordinateRegionMakeWithDistance( CLLocationCoordinate2D centerCoordinate, CLLocationDistance latitudinalMeters, CLLocationDistance longitudinalMeters );
@@ -0,0 +1,159 @@
1
+ //
2
+ // BMMapView.h
3
+ // BingMaps
4
+ //
5
+ // Copyright (c) 2011 Microsoft Corporation. All rights reserved.
6
+ //
7
+
8
+ #import <UIKit/UIKit.h>
9
+
10
+ #import "BingMaps/BMGeometry.h"
11
+ #import "BingMaps/BMTypes.h"
12
+ #import "BingMaps/BMMarker.h"
13
+ #import "BingMaps/BMMarkerView.h"
14
+
15
+ @protocol BMMapViewDelegate;
16
+ @class BMUserLocation;
17
+ @class BMMapViewInternal;
18
+
19
+ @interface BMMapView : UIView {
20
+ @private
21
+ BMMapViewInternal *_internal;
22
+ }
23
+
24
+ #pragma mark -
25
+ #pragma mark Manipulation
26
+
27
+ @property(nonatomic, assign) id <BMMapViewDelegate> delegate;
28
+ @property(nonatomic) BMMapMode mapMode;
29
+ @property(nonatomic) BMCoordinateRegion region;
30
+ @property(nonatomic) BOOL zoomEnabled;
31
+ @property(nonatomic) BOOL scrollEnabled;
32
+ - (void)setRegion:(BMCoordinateRegion)region animated:(BOOL)animated;
33
+
34
+ // centerCoordinate allows the coordinate of the region to be changed without changing the zoom level.
35
+ @property(nonatomic) CLLocationCoordinate2D centerCoordinate;
36
+ - (void)setCenterCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated;
37
+
38
+ #pragma mark -
39
+ #pragma mark Math
40
+
41
+ // Returns a region of the aspect ratio of the map view that contains the given region, with the same center point.
42
+ - (BMCoordinateRegion)regionThatFits:(BMCoordinateRegion)region;
43
+ - (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(UIView *)view;
44
+ - (CLLocationCoordinate2D)convertPoint:(CGPoint)point toCoordinateFromView:(UIView *)view;
45
+ - (CGRect)convertRegion:(BMCoordinateRegion)region toRectToView:(UIView *)view;
46
+ - (BMCoordinateRegion)convertRect:(CGRect)rect toRegionFromView:(UIView *)view;
47
+
48
+ #pragma mark -
49
+ #pragma mark User Location
50
+
51
+ @property(nonatomic) BOOL showsUserLocation;
52
+
53
+ // The marker representing the user's location
54
+ @property(nonatomic, readonly) BMUserLocation *userLocation;
55
+ /** @brief A Boolean value indicating whether the device's current location is visible in the map view. (read-only)
56
+ *
57
+ * This property uses the horizontal accuracy of the current location to determine whether the user's location is visible. Thus, this property is YES if the specific coordinate is offscreen but the rectangle surrounding that coordinate (and defined by the horizontal accuracy value) is partially on the screen.
58
+ * If the user's location cannot be determined, this property contains the value NO.
59
+ */
60
+ @property(nonatomic, readonly, getter=isUserLocationVisible) BOOL userLocationVisible;
61
+
62
+ #pragma mark -
63
+ #pragma mark markers
64
+
65
+ // markers are models used to add markers on the map.
66
+ // Implement mapView:viewFormarker: on BMMapViewDelegate to return the marker view for each marker.
67
+ - (void)addMarker:(id <BMMarker>)marker;
68
+ - (void)addMarkers:(NSArray *)markers;
69
+
70
+ - (void)removeMarker:(id <BMMarker>)marker;
71
+ - (void)removeMarkers:(NSArray *)markers;
72
+
73
+ @property(nonatomic, readonly) NSArray *markers;
74
+
75
+ // Currently displayed view for an marker; returns nil if the view for the marker hasn't been created yet.
76
+ - (BMMarkerView *)viewForMarker:(id <BMMarker>)marker;
77
+
78
+ // Used by the delegate to acquire an already allocated marker view, in lieu of allocating a new one.
79
+ - (BMMarkerView *)dequeueReusableMarkerViewWithIdentifier:(NSString *)identifier;
80
+
81
+ // Select or deselect a given marker. Asks the delegate for the corresponding marker view if necessary.
82
+ - (void)selectMarker:(id <BMMarker>)marker animated:(BOOL)animated;
83
+ - (void)deselectMarker:(id <BMMarker>)marker animated:(BOOL)animated;
84
+
85
+
86
+ @property(nonatomic, copy) NSArray *selectedMarkers;
87
+
88
+ @property (nonatomic, readonly) CGRect markerVisibleRect;
89
+
90
+ @end
91
+
92
+ /** BMMapViewDelegate
93
+ * @brief The BMMapViewDelegate protocol methods can notify you of changes related to the map.
94
+ *
95
+ * The BMMapViewDelegate methods are called when map tiles are being loaded, if the map view changes, and also after certain marker events.
96
+ *
97
+ */
98
+ @protocol BMMapViewDelegate <NSObject>
99
+ @optional
100
+
101
+ /** @brief Called just before the map view region is about to change.
102
+ *
103
+ * @param mapView The map view.
104
+ * @param animated Inidicates whether the map view change is animated.
105
+ *
106
+ */
107
+ - (void)mapView:(BMMapView *)mapView regionWillChangeAnimated:(BOOL)animated;
108
+ /** @brief Called just after the map view region changed.
109
+ *
110
+ * @param mapView The map view.
111
+ * @param animated Indicates whether the change was animated.
112
+ *
113
+ */
114
+ - (void)mapView:(BMMapView *)mapView regionDidChangeAnimated:(BOOL)animated;
115
+ /** @brief Called just before the map view makes requests to get map data.
116
+ *
117
+ * @param mapView The map view.
118
+ *
119
+ */
120
+ - (void)mapViewWillStartLoadingMap:(BMMapView *)mapView;
121
+ /** @brief Called just after the map view finishes getting map data.
122
+ *
123
+ * @param mapView The map view.
124
+ *
125
+ * This method is called after map tiles are downloaded from the server. For example, when panning and zooming, new map data is retrieved from the server to display the new region.
126
+ */
127
+ - (void)mapViewDidFinishLoadingMap:(BMMapView *)mapView;
128
+ /** @brief Called when the map view encountered an error while trying to get map data.
129
+ *
130
+ * @param mapView The map view.
131
+ * @param error The error.
132
+ *
133
+ * Use this method if you want to notify users that map data is unavailable. This method is called when there is no network connection or if other errors occurred while trying to retrieve map data.
134
+ */
135
+ - (void)mapViewDidFailLoadingMap:(BMMapView *)mapView withError:(NSError *)error;
136
+ /** @brief Returns the view of the given marker object.
137
+ *
138
+ * @param mapView The map view.
139
+ * @param marker The marker.
140
+ * @return The view of the given marker object.
141
+ */
142
+ - (BMMarkerView *)mapView:(BMMapView *)mapView viewForMarker:(id <BMMarker>)marker;
143
+ /** @brief Called after the marker views have been added and positioned on the map.
144
+ *
145
+ * @param mapView The map view.
146
+ * @param views An array containing marker views that were added.
147
+ * The delegate can implement this method to animate the adding of the markers' views.
148
+ * Use the current positions of the marker views as the destinations of the animation.
149
+ */
150
+ - (void)mapView:(BMMapView *)mapView didAddMarkerViews:(NSArray *)views;
151
+ /** @brief Called when the user taps on left and right callout accessory UIControls.
152
+ *
153
+ * @param mapView The map view.
154
+ * @param view Marker view that was tapped.
155
+ * @param control The control that was tapped.
156
+ */
157
+ - (void)mapView:(BMMapView *)mapView markerView:(BMMarkerView *)view calloutAccessoryControlTapped:(UIControl *)control;
158
+
159
+ @end