lounge_lizard 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (348) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.gitmodules +3 -0
  4. data/.rspec +2 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +4 -0
  7. data/Guardfile +33 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +50 -0
  10. data/Rakefile +43 -0
  11. data/bin/console +14 -0
  12. data/bin/setup +8 -0
  13. data/circle.yml +14 -0
  14. data/ext/drafter/CHANGELOG.md +278 -0
  15. data/ext/drafter/Dockerfile +17 -0
  16. data/ext/drafter/Makefile +62 -0
  17. data/ext/drafter/appveyor.yml +17 -0
  18. data/ext/drafter/bin/drafter +0 -0
  19. data/ext/drafter/build/Makefile +387 -0
  20. data/ext/drafter/build/drafter.Makefile +6 -0
  21. data/ext/drafter/build/drafter.target.mk +159 -0
  22. data/ext/drafter/build/ext/snowcrash/libmarkdownparser.target.mk +141 -0
  23. data/ext/drafter/build/ext/snowcrash/libsnowcrash.target.mk +154 -0
  24. data/ext/drafter/build/ext/snowcrash/libsundown.target.mk +149 -0
  25. data/ext/drafter/build/ext/snowcrash/perf-libsnowcrash.target.mk +147 -0
  26. data/ext/drafter/build/ext/snowcrash/snowcrash.Makefile +6 -0
  27. data/ext/drafter/build/gyp-mac-tool +606 -0
  28. data/ext/drafter/build/libdrafter.target.mk +186 -0
  29. data/ext/drafter/build/libsos.target.mk +137 -0
  30. data/ext/drafter/build/out/Release/drafter +0 -0
  31. data/ext/drafter/build/out/Release/libdrafter.dylib +0 -0
  32. data/ext/drafter/build/out/Release/libmarkdownparser.a +0 -0
  33. data/ext/drafter/build/out/Release/libsnowcrash.a +0 -0
  34. data/ext/drafter/build/out/Release/libsos.a +0 -0
  35. data/ext/drafter/build/out/Release/libsundown.a +0 -0
  36. data/ext/drafter/build/out/Release/obj.target/drafter/src/config.o +0 -0
  37. data/ext/drafter/build/out/Release/obj.target/drafter/src/main.o +0 -0
  38. data/ext/drafter/build/out/Release/obj.target/drafter/src/reporting.o +0 -0
  39. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/ConversionContext.o +0 -0
  40. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/NamedTypesRegistry.o +0 -0
  41. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/RefractAPI.o +0 -0
  42. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/RefractDataStructure.o +0 -0
  43. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/RefractElementFactory.o +0 -0
  44. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/RefractSourceMap.o +0 -0
  45. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/Render.o +0 -0
  46. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/Serialize.o +0 -0
  47. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeAST.o +0 -0
  48. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeResult.o +0 -0
  49. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/SerializeSourcemap.o +0 -0
  50. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/drafter.o +0 -0
  51. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/drafter_private.o +0 -0
  52. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/ComparableVisitor.o +0 -0
  53. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/Element.o +0 -0
  54. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/ExpandVisitor.o +0 -0
  55. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/IsExpandableVisitor.o +0 -0
  56. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/JSONSchemaVisitor.o +0 -0
  57. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/PrintVisitor.o +0 -0
  58. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/Query.o +0 -0
  59. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/Registry.o +0 -0
  60. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/RenderJSONVisitor.o +0 -0
  61. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/SerializeCompactVisitor.o +0 -0
  62. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/SerializeVisitor.o +0 -0
  63. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/TypeQueryVisitor.o +0 -0
  64. data/ext/drafter/build/out/Release/obj.target/libdrafter/src/refract/VisitorUtils.o +0 -0
  65. data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/ByteBuffer.o +0 -0
  66. data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/MarkdownNode.o +0 -0
  67. data/ext/drafter/build/out/Release/obj.target/libmarkdownparser/ext/snowcrash/ext/markdown-parser/src/MarkdownParser.o +0 -0
  68. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Blueprint.o +0 -0
  69. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/BlueprintSourcemap.o +0 -0
  70. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/HTTP.o +0 -0
  71. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/HeadersParser.o +0 -0
  72. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSON.o +0 -0
  73. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONOneOfParser.o +0 -0
  74. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONSourcemap.o +0 -0
  75. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONTypeSectionParser.o +0 -0
  76. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/MSONValueMemberParser.o +0 -0
  77. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Section.o +0 -0
  78. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/Signature.o +0 -0
  79. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/UriTemplateParser.o +0 -0
  80. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/posix/RegexMatch.o +0 -0
  81. data/ext/drafter/build/out/Release/obj.target/libsnowcrash/ext/snowcrash/src/snowcrash.o +0 -0
  82. data/ext/drafter/build/out/Release/obj.target/libsos/ext/sos/src/sos.o +0 -0
  83. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_href_e.o +0 -0
  84. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_html_e.o +0 -0
  85. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/html/html.o +0 -0
  86. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/html/html_smartypants.o +0 -0
  87. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/src/autolink.o +0 -0
  88. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/src/buffer.o +0 -0
  89. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.o +0 -0
  90. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.o +0 -0
  91. data/ext/drafter/build/out/Release/obj.target/libsundown/ext/snowcrash/ext/markdown-parser/ext/sundown/src/stack.o +0 -0
  92. data/ext/drafter/circle.yml +32 -0
  93. data/ext/drafter/config.gypi +10 -0
  94. data/ext/drafter/config.mk +5 -0
  95. data/ext/drafter/configure +224 -0
  96. data/ext/drafter/drafter.gyp +189 -0
  97. data/ext/drafter/drafter.xcworkspace/contents.xcworkspacedata +13 -0
  98. data/ext/drafter/ext/snowcrash/Makefile +58 -0
  99. data/ext/drafter/ext/snowcrash/appveyor.yml +7 -0
  100. data/ext/drafter/ext/snowcrash/common.gypi +165 -0
  101. data/ext/drafter/ext/snowcrash/configure +197 -0
  102. data/ext/drafter/ext/snowcrash/ext/markdown-parser/Makefile +90 -0
  103. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/CONTRIBUTING.md +10 -0
  104. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/Makefile +84 -0
  105. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/Makefile.win +33 -0
  106. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/examples/smartypants.c +72 -0
  107. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/examples/sundown.c +80 -0
  108. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini.h +37 -0
  109. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_href_e.c +108 -0
  110. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/html/houdini_html_e.c +84 -0
  111. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/html/html.c +647 -0
  112. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/html/html.h +77 -0
  113. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/html/html_smartypants.c +389 -0
  114. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/html_block_names.txt +25 -0
  115. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/autolink.c +297 -0
  116. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/autolink.h +51 -0
  117. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/buffer.c +225 -0
  118. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/buffer.h +96 -0
  119. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/html_blocks.h +206 -0
  120. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.c +2726 -0
  121. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/markdown.h +147 -0
  122. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.c +204 -0
  123. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/src_map.h +58 -0
  124. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/stack.c +81 -0
  125. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/src/stack.h +29 -0
  126. data/ext/drafter/ext/snowcrash/ext/markdown-parser/ext/sundown/sundown.def +20 -0
  127. data/ext/drafter/ext/snowcrash/ext/markdown-parser/msvc/markdown/markdown.vcproj +188 -0
  128. data/ext/drafter/ext/snowcrash/ext/markdown-parser/msvc/msvc.sln +38 -0
  129. data/ext/drafter/ext/snowcrash/ext/markdown-parser/msvc/sundown/sundown.vcproj +206 -0
  130. data/ext/drafter/ext/snowcrash/ext/markdown-parser/src/ByteBuffer.cc +160 -0
  131. data/ext/drafter/ext/snowcrash/ext/markdown-parser/src/ByteBuffer.h +90 -0
  132. data/ext/drafter/ext/snowcrash/ext/markdown-parser/src/MarkdownNode.cc +152 -0
  133. data/ext/drafter/ext/snowcrash/ext/markdown-parser/src/MarkdownNode.h +103 -0
  134. data/ext/drafter/ext/snowcrash/ext/markdown-parser/src/MarkdownParser.cc +388 -0
  135. data/ext/drafter/ext/snowcrash/ext/markdown-parser/src/MarkdownParser.h +106 -0
  136. data/ext/drafter/ext/snowcrash/snowcrash.gyp +196 -0
  137. data/ext/drafter/ext/snowcrash/src/ActionParser.h +560 -0
  138. data/ext/drafter/ext/snowcrash/src/AssetParser.h +123 -0
  139. data/ext/drafter/ext/snowcrash/src/AttributesParser.h +123 -0
  140. data/ext/drafter/ext/snowcrash/src/Blueprint.cc +90 -0
  141. data/ext/drafter/ext/snowcrash/src/Blueprint.h +489 -0
  142. data/ext/drafter/ext/snowcrash/src/BlueprintParser.h +845 -0
  143. data/ext/drafter/ext/snowcrash/src/BlueprintSourcemap.cc +81 -0
  144. data/ext/drafter/ext/snowcrash/src/BlueprintSourcemap.h +345 -0
  145. data/ext/drafter/ext/snowcrash/src/BlueprintUtility.h +111 -0
  146. data/ext/drafter/ext/snowcrash/src/CodeBlockUtility.h +276 -0
  147. data/ext/drafter/ext/snowcrash/src/DataStructureGroupParser.h +157 -0
  148. data/ext/drafter/ext/snowcrash/src/HTTP.cc +49 -0
  149. data/ext/drafter/ext/snowcrash/src/HTTP.h +108 -0
  150. data/ext/drafter/ext/snowcrash/src/HeadersParser.cc +117 -0
  151. data/ext/drafter/ext/snowcrash/src/HeadersParser.h +377 -0
  152. data/ext/drafter/ext/snowcrash/src/MSON.cc +272 -0
  153. data/ext/drafter/ext/snowcrash/src/MSON.h +405 -0
  154. data/ext/drafter/ext/snowcrash/src/MSONMixinParser.h +103 -0
  155. data/ext/drafter/ext/snowcrash/src/MSONNamedTypeParser.h +135 -0
  156. data/ext/drafter/ext/snowcrash/src/MSONOneOfParser.cc +132 -0
  157. data/ext/drafter/ext/snowcrash/src/MSONOneOfParser.h +80 -0
  158. data/ext/drafter/ext/snowcrash/src/MSONParameterParser.h +166 -0
  159. data/ext/drafter/ext/snowcrash/src/MSONPropertyMemberParser.h +106 -0
  160. data/ext/drafter/ext/snowcrash/src/MSONSourcemap.cc +141 -0
  161. data/ext/drafter/ext/snowcrash/src/MSONSourcemap.h +181 -0
  162. data/ext/drafter/ext/snowcrash/src/MSONTypeSectionParser.cc +209 -0
  163. data/ext/drafter/ext/snowcrash/src/MSONTypeSectionParser.h +213 -0
  164. data/ext/drafter/ext/snowcrash/src/MSONUtility.h +506 -0
  165. data/ext/drafter/ext/snowcrash/src/MSONValueMemberParser.cc +214 -0
  166. data/ext/drafter/ext/snowcrash/src/MSONValueMemberParser.h +390 -0
  167. data/ext/drafter/ext/snowcrash/src/ModelTable.h +87 -0
  168. data/ext/drafter/ext/snowcrash/src/ParameterParser.h +516 -0
  169. data/ext/drafter/ext/snowcrash/src/ParametersParser.h +222 -0
  170. data/ext/drafter/ext/snowcrash/src/PayloadParser.h +733 -0
  171. data/ext/drafter/ext/snowcrash/src/Platform.h +33 -0
  172. data/ext/drafter/ext/snowcrash/src/RegexMatch.h +32 -0
  173. data/ext/drafter/ext/snowcrash/src/RelationParser.h +87 -0
  174. data/ext/drafter/ext/snowcrash/src/ResourceGroupParser.h +297 -0
  175. data/ext/drafter/ext/snowcrash/src/ResourceParser.h +536 -0
  176. data/ext/drafter/ext/snowcrash/src/Section.cc +48 -0
  177. data/ext/drafter/ext/snowcrash/src/Section.h +60 -0
  178. data/ext/drafter/ext/snowcrash/src/SectionParser.h +246 -0
  179. data/ext/drafter/ext/snowcrash/src/SectionParserData.h +109 -0
  180. data/ext/drafter/ext/snowcrash/src/SectionProcessor.h +299 -0
  181. data/ext/drafter/ext/snowcrash/src/Signature.cc +75 -0
  182. data/ext/drafter/ext/snowcrash/src/Signature.h +103 -0
  183. data/ext/drafter/ext/snowcrash/src/SignatureSectionProcessor.h +442 -0
  184. data/ext/drafter/ext/snowcrash/src/SourceAnnotation.h +166 -0
  185. data/ext/drafter/ext/snowcrash/src/StringUtility.h +323 -0
  186. data/ext/drafter/ext/snowcrash/src/UriTemplateParser.cc +195 -0
  187. data/ext/drafter/ext/snowcrash/src/UriTemplateParser.h +240 -0
  188. data/ext/drafter/ext/snowcrash/src/ValuesParser.h +111 -0
  189. data/ext/drafter/ext/snowcrash/src/posix/RegexMatch.cc +99 -0
  190. data/ext/drafter/ext/snowcrash/src/snowcrash.cc +90 -0
  191. data/ext/drafter/ext/snowcrash/src/snowcrash.h +44 -0
  192. data/ext/drafter/ext/snowcrash/src/win/RegexMatch.cc +78 -0
  193. data/ext/drafter/ext/snowcrash/tools/gyp/AUTHORS +12 -0
  194. data/ext/drafter/ext/snowcrash/tools/gyp/DEPS +23 -0
  195. data/ext/drafter/ext/snowcrash/tools/gyp/OWNERS +1 -0
  196. data/ext/drafter/ext/snowcrash/tools/gyp/PRESUBMIT.py +137 -0
  197. data/ext/drafter/ext/snowcrash/tools/gyp/buildbot/buildbot_run.py +136 -0
  198. data/ext/drafter/ext/snowcrash/tools/gyp/buildbot/commit_queue/OWNERS +6 -0
  199. data/ext/drafter/ext/snowcrash/tools/gyp/buildbot/commit_queue/cq_config.json +15 -0
  200. data/ext/drafter/ext/snowcrash/tools/gyp/codereview.settings +10 -0
  201. data/ext/drafter/ext/snowcrash/tools/gyp/data/win/large-pdb-shim.cc +12 -0
  202. data/ext/drafter/ext/snowcrash/tools/gyp/gyp +8 -0
  203. data/ext/drafter/ext/snowcrash/tools/gyp/gyp.bat +5 -0
  204. data/ext/drafter/ext/snowcrash/tools/gyp/gyp_main.py +16 -0
  205. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/MSVSNew.py +340 -0
  206. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/MSVSProject.py +208 -0
  207. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/MSVSSettings.py +1096 -0
  208. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/MSVSToolFile.py +58 -0
  209. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/MSVSUserFile.py +147 -0
  210. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/MSVSUtil.py +270 -0
  211. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/MSVSUtil.pyc +0 -0
  212. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/MSVSVersion.py +445 -0
  213. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/MSVSVersion.pyc +0 -0
  214. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/__init__.py +548 -0
  215. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/__init__.pyc +0 -0
  216. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/common.py +608 -0
  217. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/common.pyc +0 -0
  218. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/easy_xml.py +157 -0
  219. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/flock_tool.py +54 -0
  220. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.py +0 -0
  221. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.pyc +0 -0
  222. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/analyzer.py +741 -0
  223. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/android.py +1069 -0
  224. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/cmake.py +1248 -0
  225. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/dump_dependency_json.py +99 -0
  226. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/eclipse.py +425 -0
  227. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/gypd.py +94 -0
  228. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/gypsh.py +56 -0
  229. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/make.py +2218 -0
  230. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyc +0 -0
  231. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/msvs.py +3467 -0
  232. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/ninja.py +2427 -0
  233. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/ninja.pyc +0 -0
  234. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.py +1300 -0
  235. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pyc +0 -0
  236. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/input.py +2899 -0
  237. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/input.pyc +0 -0
  238. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/mac_tool.py +605 -0
  239. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/msvs_emulation.py +1093 -0
  240. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/msvs_emulation.pyc +0 -0
  241. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/ninja_syntax.py +160 -0
  242. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/ninja_syntax.pyc +0 -0
  243. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/ordered_dict.py +289 -0
  244. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/simple_copy.py +46 -0
  245. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/simple_copy.pyc +0 -0
  246. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/win_tool.py +314 -0
  247. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/xcode_emulation.py +1664 -0
  248. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/xcode_emulation.pyc +0 -0
  249. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/xcode_ninja.py +276 -0
  250. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/xcode_ninja.pyc +0 -0
  251. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/xcodeproj_file.py +2927 -0
  252. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/xcodeproj_file.pyc +0 -0
  253. data/ext/drafter/ext/snowcrash/tools/gyp/pylib/gyp/xml_fix.py +69 -0
  254. data/ext/drafter/ext/snowcrash/tools/gyp/pylintrc +307 -0
  255. data/ext/drafter/ext/snowcrash/tools/gyp/samples/samples +81 -0
  256. data/ext/drafter/ext/snowcrash/tools/gyp/samples/samples.bat +5 -0
  257. data/ext/drafter/ext/snowcrash/tools/gyp/setup.py +19 -0
  258. data/ext/drafter/ext/snowcrash/tools/gyp/tools/Xcode/Specifications/gyp.pbfilespec +27 -0
  259. data/ext/drafter/ext/snowcrash/tools/gyp/tools/Xcode/Specifications/gyp.xclangspec +226 -0
  260. data/ext/drafter/ext/snowcrash/tools/gyp/tools/emacs/gyp.el +275 -0
  261. data/ext/drafter/ext/snowcrash/tools/gyp/tools/graphviz.py +100 -0
  262. data/ext/drafter/ext/snowcrash/tools/gyp/tools/pretty_gyp.py +155 -0
  263. data/ext/drafter/ext/snowcrash/tools/gyp/tools/pretty_sln.py +169 -0
  264. data/ext/drafter/ext/snowcrash/tools/gyp/tools/pretty_vcproj.py +329 -0
  265. data/ext/drafter/ext/snowcrash/vcbuild.bat +139 -0
  266. data/ext/drafter/ext/sos/Makefile +62 -0
  267. data/ext/drafter/ext/sos/src/sos.cc +235 -0
  268. data/ext/drafter/ext/sos/src/sos.h +188 -0
  269. data/ext/drafter/ext/sos/src/sosJSON.h +121 -0
  270. data/ext/drafter/ext/sos/src/sosYAML.h +105 -0
  271. data/ext/drafter/src/ConversionContext.cc +39 -0
  272. data/ext/drafter/src/ConversionContext.h +34 -0
  273. data/ext/drafter/src/NamedTypesRegistry.cc +405 -0
  274. data/ext/drafter/src/NamedTypesRegistry.h +28 -0
  275. data/ext/drafter/src/NodeInfo.h +143 -0
  276. data/ext/drafter/src/RefractAPI.cc +579 -0
  277. data/ext/drafter/src/RefractAPI.h +28 -0
  278. data/ext/drafter/src/RefractDataStructure.cc +1199 -0
  279. data/ext/drafter/src/RefractDataStructure.h +26 -0
  280. data/ext/drafter/src/RefractElementFactory.cc +107 -0
  281. data/ext/drafter/src/RefractElementFactory.h +67 -0
  282. data/ext/drafter/src/RefractSourceMap.cc +29 -0
  283. data/ext/drafter/src/RefractSourceMap.h +57 -0
  284. data/ext/drafter/src/Render.cc +157 -0
  285. data/ext/drafter/src/Render.h +40 -0
  286. data/ext/drafter/src/Serialize.cc +160 -0
  287. data/ext/drafter/src/Serialize.h +289 -0
  288. data/ext/drafter/src/SerializeAST.cc +507 -0
  289. data/ext/drafter/src/SerializeAST.h +29 -0
  290. data/ext/drafter/src/SerializeResult.cc +170 -0
  291. data/ext/drafter/src/SerializeResult.h +34 -0
  292. data/ext/drafter/src/SerializeSourcemap.cc +331 -0
  293. data/ext/drafter/src/SerializeSourcemap.h +21 -0
  294. data/ext/drafter/src/Version.h +40 -0
  295. data/ext/drafter/src/config.cc +91 -0
  296. data/ext/drafter/src/config.h +38 -0
  297. data/ext/drafter/src/drafter.cc +137 -0
  298. data/ext/drafter/src/drafter.h +102 -0
  299. data/ext/drafter/src/drafter_private.cc +85 -0
  300. data/ext/drafter/src/drafter_private.h +34 -0
  301. data/ext/drafter/src/main.cc +137 -0
  302. data/ext/drafter/src/refract/AppendDecorator.h +58 -0
  303. data/ext/drafter/src/refract/Build.h +67 -0
  304. data/ext/drafter/src/refract/ComparableVisitor.cc +43 -0
  305. data/ext/drafter/src/refract/ComparableVisitor.h +62 -0
  306. data/ext/drafter/src/refract/Element.cc +409 -0
  307. data/ext/drafter/src/refract/Element.h +656 -0
  308. data/ext/drafter/src/refract/ElementFwd.h +37 -0
  309. data/ext/drafter/src/refract/ElementInserter.h +59 -0
  310. data/ext/drafter/src/refract/Exception.h +31 -0
  311. data/ext/drafter/src/refract/ExpandVisitor.cc +359 -0
  312. data/ext/drafter/src/refract/ExpandVisitor.h +58 -0
  313. data/ext/drafter/src/refract/FilterVisitor.h +52 -0
  314. data/ext/drafter/src/refract/IsExpandableVisitor.cc +140 -0
  315. data/ext/drafter/src/refract/IsExpandableVisitor.h +31 -0
  316. data/ext/drafter/src/refract/Iterate.h +160 -0
  317. data/ext/drafter/src/refract/JSONSchemaVisitor.cc +675 -0
  318. data/ext/drafter/src/refract/JSONSchemaVisitor.h +73 -0
  319. data/ext/drafter/src/refract/PrintVisitor.cc +164 -0
  320. data/ext/drafter/src/refract/PrintVisitor.h +50 -0
  321. data/ext/drafter/src/refract/Query.cc +13 -0
  322. data/ext/drafter/src/refract/Query.h +38 -0
  323. data/ext/drafter/src/refract/Registry.cc +114 -0
  324. data/ext/drafter/src/refract/Registry.h +43 -0
  325. data/ext/drafter/src/refract/RenderJSONVisitor.cc +255 -0
  326. data/ext/drafter/src/refract/RenderJSONVisitor.h +51 -0
  327. data/ext/drafter/src/refract/SerializeCompactVisitor.cc +167 -0
  328. data/ext/drafter/src/refract/SerializeCompactVisitor.h +56 -0
  329. data/ext/drafter/src/refract/SerializeVisitor.cc +214 -0
  330. data/ext/drafter/src/refract/SerializeVisitor.h +55 -0
  331. data/ext/drafter/src/refract/TypeQueryVisitor.cc +46 -0
  332. data/ext/drafter/src/refract/TypeQueryVisitor.h +110 -0
  333. data/ext/drafter/src/refract/Visitor.h +126 -0
  334. data/ext/drafter/src/refract/VisitorUtils.cc +63 -0
  335. data/ext/drafter/src/refract/VisitorUtils.h +231 -0
  336. data/ext/drafter/src/reporting.cc +263 -0
  337. data/ext/drafter/src/reporting.h +39 -0
  338. data/ext/drafter/src/stream.h +148 -0
  339. data/ext/drafter/tools/homebrew/drafter.rb +18 -0
  340. data/ext/drafter/tools/make-tarball.sh +39 -0
  341. data/ext/drafter/tools/refract-filter.py +96 -0
  342. data/ext/drafter/tools/release.sh +17 -0
  343. data/ext/drafter/vcbuild.bat +203 -0
  344. data/lib/lounge_lizard/binding.rb +29 -0
  345. data/lib/lounge_lizard/version.rb +3 -0
  346. data/lib/lounge_lizard.rb +18 -0
  347. data/lounge_lizard.gemspec +37 -0
  348. metadata +547 -0
@@ -0,0 +1,548 @@
1
+ #!/usr/bin/env python
2
+
3
+ # Copyright (c) 2012 Google Inc. All rights reserved.
4
+ # Use of this source code is governed by a BSD-style license that can be
5
+ # found in the LICENSE file.
6
+
7
+ import copy
8
+ import gyp.input
9
+ import optparse
10
+ import os.path
11
+ import re
12
+ import shlex
13
+ import sys
14
+ import traceback
15
+ from gyp.common import GypError
16
+
17
+ # Default debug modes for GYP
18
+ debug = {}
19
+
20
+ # List of "official" debug modes, but you can use anything you like.
21
+ DEBUG_GENERAL = 'general'
22
+ DEBUG_VARIABLES = 'variables'
23
+ DEBUG_INCLUDES = 'includes'
24
+
25
+
26
+ def DebugOutput(mode, message, *args):
27
+ if 'all' in gyp.debug or mode in gyp.debug:
28
+ ctx = ('unknown', 0, 'unknown')
29
+ try:
30
+ f = traceback.extract_stack(limit=2)
31
+ if f:
32
+ ctx = f[0][:3]
33
+ except:
34
+ pass
35
+ if args:
36
+ message %= args
37
+ print '%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]),
38
+ ctx[1], ctx[2], message)
39
+
40
+ def FindBuildFiles():
41
+ extension = '.gyp'
42
+ files = os.listdir(os.getcwd())
43
+ build_files = []
44
+ for file in files:
45
+ if file.endswith(extension):
46
+ build_files.append(file)
47
+ return build_files
48
+
49
+
50
+ def Load(build_files, format, default_variables={},
51
+ includes=[], depth='.', params=None, check=False,
52
+ circular_check=True, duplicate_basename_check=True):
53
+ """
54
+ Loads one or more specified build files.
55
+ default_variables and includes will be copied before use.
56
+ Returns the generator for the specified format and the
57
+ data returned by loading the specified build files.
58
+ """
59
+ if params is None:
60
+ params = {}
61
+
62
+ if '-' in format:
63
+ format, params['flavor'] = format.split('-', 1)
64
+
65
+ default_variables = copy.copy(default_variables)
66
+
67
+ # Default variables provided by this program and its modules should be
68
+ # named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace,
69
+ # avoiding collisions with user and automatic variables.
70
+ default_variables['GENERATOR'] = format
71
+ default_variables['GENERATOR_FLAVOR'] = params.get('flavor', '')
72
+
73
+ # Format can be a custom python file, or by default the name of a module
74
+ # within gyp.generator.
75
+ if format.endswith('.py'):
76
+ generator_name = os.path.splitext(format)[0]
77
+ path, generator_name = os.path.split(generator_name)
78
+
79
+ # Make sure the path to the custom generator is in sys.path
80
+ # Don't worry about removing it once we are done. Keeping the path
81
+ # to each generator that is used in sys.path is likely harmless and
82
+ # arguably a good idea.
83
+ path = os.path.abspath(path)
84
+ if path not in sys.path:
85
+ sys.path.insert(0, path)
86
+ else:
87
+ generator_name = 'gyp.generator.' + format
88
+
89
+ # These parameters are passed in order (as opposed to by key)
90
+ # because ActivePython cannot handle key parameters to __import__.
91
+ generator = __import__(generator_name, globals(), locals(), generator_name)
92
+ for (key, val) in generator.generator_default_variables.items():
93
+ default_variables.setdefault(key, val)
94
+
95
+ # Give the generator the opportunity to set additional variables based on
96
+ # the params it will receive in the output phase.
97
+ if getattr(generator, 'CalculateVariables', None):
98
+ generator.CalculateVariables(default_variables, params)
99
+
100
+ # Give the generator the opportunity to set generator_input_info based on
101
+ # the params it will receive in the output phase.
102
+ if getattr(generator, 'CalculateGeneratorInputInfo', None):
103
+ generator.CalculateGeneratorInputInfo(params)
104
+
105
+ # Fetch the generator specific info that gets fed to input, we use getattr
106
+ # so we can default things and the generators only have to provide what
107
+ # they need.
108
+ generator_input_info = {
109
+ 'non_configuration_keys':
110
+ getattr(generator, 'generator_additional_non_configuration_keys', []),
111
+ 'path_sections':
112
+ getattr(generator, 'generator_additional_path_sections', []),
113
+ 'extra_sources_for_rules':
114
+ getattr(generator, 'generator_extra_sources_for_rules', []),
115
+ 'generator_supports_multiple_toolsets':
116
+ getattr(generator, 'generator_supports_multiple_toolsets', False),
117
+ 'generator_wants_static_library_dependencies_adjusted':
118
+ getattr(generator,
119
+ 'generator_wants_static_library_dependencies_adjusted', True),
120
+ 'generator_wants_sorted_dependencies':
121
+ getattr(generator, 'generator_wants_sorted_dependencies', False),
122
+ 'generator_filelist_paths':
123
+ getattr(generator, 'generator_filelist_paths', None),
124
+ }
125
+
126
+ # Process the input specific to this generator.
127
+ result = gyp.input.Load(build_files, default_variables, includes[:],
128
+ depth, generator_input_info, check, circular_check,
129
+ duplicate_basename_check,
130
+ params['parallel'], params['root_targets'])
131
+ return [generator] + result
132
+
133
+ def NameValueListToDict(name_value_list):
134
+ """
135
+ Takes an array of strings of the form 'NAME=VALUE' and creates a dictionary
136
+ of the pairs. If a string is simply NAME, then the value in the dictionary
137
+ is set to True. If VALUE can be converted to an integer, it is.
138
+ """
139
+ result = { }
140
+ for item in name_value_list:
141
+ tokens = item.split('=', 1)
142
+ if len(tokens) == 2:
143
+ # If we can make it an int, use that, otherwise, use the string.
144
+ try:
145
+ token_value = int(tokens[1])
146
+ except ValueError:
147
+ token_value = tokens[1]
148
+ # Set the variable to the supplied value.
149
+ result[tokens[0]] = token_value
150
+ else:
151
+ # No value supplied, treat it as a boolean and set it.
152
+ result[tokens[0]] = True
153
+ return result
154
+
155
+ def ShlexEnv(env_name):
156
+ flags = os.environ.get(env_name, [])
157
+ if flags:
158
+ flags = shlex.split(flags)
159
+ return flags
160
+
161
+ def FormatOpt(opt, value):
162
+ if opt.startswith('--'):
163
+ return '%s=%s' % (opt, value)
164
+ return opt + value
165
+
166
+ def RegenerateAppendFlag(flag, values, predicate, env_name, options):
167
+ """Regenerate a list of command line flags, for an option of action='append'.
168
+
169
+ The |env_name|, if given, is checked in the environment and used to generate
170
+ an initial list of options, then the options that were specified on the
171
+ command line (given in |values|) are appended. This matches the handling of
172
+ environment variables and command line flags where command line flags override
173
+ the environment, while not requiring the environment to be set when the flags
174
+ are used again.
175
+ """
176
+ flags = []
177
+ if options.use_environment and env_name:
178
+ for flag_value in ShlexEnv(env_name):
179
+ value = FormatOpt(flag, predicate(flag_value))
180
+ if value in flags:
181
+ flags.remove(value)
182
+ flags.append(value)
183
+ if values:
184
+ for flag_value in values:
185
+ flags.append(FormatOpt(flag, predicate(flag_value)))
186
+ return flags
187
+
188
+ def RegenerateFlags(options):
189
+ """Given a parsed options object, and taking the environment variables into
190
+ account, returns a list of flags that should regenerate an equivalent options
191
+ object (even in the absence of the environment variables.)
192
+
193
+ Any path options will be normalized relative to depth.
194
+
195
+ The format flag is not included, as it is assumed the calling generator will
196
+ set that as appropriate.
197
+ """
198
+ def FixPath(path):
199
+ path = gyp.common.FixIfRelativePath(path, options.depth)
200
+ if not path:
201
+ return os.path.curdir
202
+ return path
203
+
204
+ def Noop(value):
205
+ return value
206
+
207
+ # We always want to ignore the environment when regenerating, to avoid
208
+ # duplicate or changed flags in the environment at the time of regeneration.
209
+ flags = ['--ignore-environment']
210
+ for name, metadata in options._regeneration_metadata.iteritems():
211
+ opt = metadata['opt']
212
+ value = getattr(options, name)
213
+ value_predicate = metadata['type'] == 'path' and FixPath or Noop
214
+ action = metadata['action']
215
+ env_name = metadata['env_name']
216
+ if action == 'append':
217
+ flags.extend(RegenerateAppendFlag(opt, value, value_predicate,
218
+ env_name, options))
219
+ elif action in ('store', None): # None is a synonym for 'store'.
220
+ if value:
221
+ flags.append(FormatOpt(opt, value_predicate(value)))
222
+ elif options.use_environment and env_name and os.environ.get(env_name):
223
+ flags.append(FormatOpt(opt, value_predicate(os.environ.get(env_name))))
224
+ elif action in ('store_true', 'store_false'):
225
+ if ((action == 'store_true' and value) or
226
+ (action == 'store_false' and not value)):
227
+ flags.append(opt)
228
+ elif options.use_environment and env_name:
229
+ print >>sys.stderr, ('Warning: environment regeneration unimplemented '
230
+ 'for %s flag %r env_name %r' % (action, opt,
231
+ env_name))
232
+ else:
233
+ print >>sys.stderr, ('Warning: regeneration unimplemented for action %r '
234
+ 'flag %r' % (action, opt))
235
+
236
+ return flags
237
+
238
+ class RegeneratableOptionParser(optparse.OptionParser):
239
+ def __init__(self):
240
+ self.__regeneratable_options = {}
241
+ optparse.OptionParser.__init__(self)
242
+
243
+ def add_option(self, *args, **kw):
244
+ """Add an option to the parser.
245
+
246
+ This accepts the same arguments as OptionParser.add_option, plus the
247
+ following:
248
+ regenerate: can be set to False to prevent this option from being included
249
+ in regeneration.
250
+ env_name: name of environment variable that additional values for this
251
+ option come from.
252
+ type: adds type='path', to tell the regenerator that the values of
253
+ this option need to be made relative to options.depth
254
+ """
255
+ env_name = kw.pop('env_name', None)
256
+ if 'dest' in kw and kw.pop('regenerate', True):
257
+ dest = kw['dest']
258
+
259
+ # The path type is needed for regenerating, for optparse we can just treat
260
+ # it as a string.
261
+ type = kw.get('type')
262
+ if type == 'path':
263
+ kw['type'] = 'string'
264
+
265
+ self.__regeneratable_options[dest] = {
266
+ 'action': kw.get('action'),
267
+ 'type': type,
268
+ 'env_name': env_name,
269
+ 'opt': args[0],
270
+ }
271
+
272
+ optparse.OptionParser.add_option(self, *args, **kw)
273
+
274
+ def parse_args(self, *args):
275
+ values, args = optparse.OptionParser.parse_args(self, *args)
276
+ values._regeneration_metadata = self.__regeneratable_options
277
+ return values, args
278
+
279
+ def gyp_main(args):
280
+ my_name = os.path.basename(sys.argv[0])
281
+
282
+ parser = RegeneratableOptionParser()
283
+ usage = 'usage: %s [options ...] [build_file ...]'
284
+ parser.set_usage(usage.replace('%s', '%prog'))
285
+ parser.add_option('--build', dest='configs', action='append',
286
+ help='configuration for build after project generation')
287
+ parser.add_option('--check', dest='check', action='store_true',
288
+ help='check format of gyp files')
289
+ parser.add_option('--config-dir', dest='config_dir', action='store',
290
+ env_name='GYP_CONFIG_DIR', default=None,
291
+ help='The location for configuration files like '
292
+ 'include.gypi.')
293
+ parser.add_option('-d', '--debug', dest='debug', metavar='DEBUGMODE',
294
+ action='append', default=[], help='turn on a debugging '
295
+ 'mode for debugging GYP. Supported modes are "variables", '
296
+ '"includes" and "general" or "all" for all of them.')
297
+ parser.add_option('-D', dest='defines', action='append', metavar='VAR=VAL',
298
+ env_name='GYP_DEFINES',
299
+ help='sets variable VAR to value VAL')
300
+ parser.add_option('--depth', dest='depth', metavar='PATH', type='path',
301
+ help='set DEPTH gyp variable to a relative path to PATH')
302
+ parser.add_option('-f', '--format', dest='formats', action='append',
303
+ env_name='GYP_GENERATORS', regenerate=False,
304
+ help='output formats to generate')
305
+ parser.add_option('-G', dest='generator_flags', action='append', default=[],
306
+ metavar='FLAG=VAL', env_name='GYP_GENERATOR_FLAGS',
307
+ help='sets generator flag FLAG to VAL')
308
+ parser.add_option('--generator-output', dest='generator_output',
309
+ action='store', default=None, metavar='DIR', type='path',
310
+ env_name='GYP_GENERATOR_OUTPUT',
311
+ help='puts generated build files under DIR')
312
+ parser.add_option('--ignore-environment', dest='use_environment',
313
+ action='store_false', default=True, regenerate=False,
314
+ help='do not read options from environment variables')
315
+ parser.add_option('-I', '--include', dest='includes', action='append',
316
+ metavar='INCLUDE', type='path',
317
+ help='files to include in all loaded .gyp files')
318
+ # --no-circular-check disables the check for circular relationships between
319
+ # .gyp files. These relationships should not exist, but they've only been
320
+ # observed to be harmful with the Xcode generator. Chromium's .gyp files
321
+ # currently have some circular relationships on non-Mac platforms, so this
322
+ # option allows the strict behavior to be used on Macs and the lenient
323
+ # behavior to be used elsewhere.
324
+ # TODO(mark): Remove this option when http://crbug.com/35878 is fixed.
325
+ parser.add_option('--no-circular-check', dest='circular_check',
326
+ action='store_false', default=True, regenerate=False,
327
+ help="don't check for circular relationships between files")
328
+ # --no-duplicate-basename-check disables the check for duplicate basenames
329
+ # in a static_library/shared_library project. Visual C++ 2008 generator
330
+ # doesn't support this configuration. Libtool on Mac also generates warnings
331
+ # when duplicate basenames are passed into Make generator on Mac.
332
+ # TODO(yukawa): Remove this option when these legacy generators are
333
+ # deprecated.
334
+ parser.add_option('--no-duplicate-basename-check',
335
+ dest='duplicate_basename_check', action='store_false',
336
+ default=True, regenerate=False,
337
+ help="don't check for duplicate basenames")
338
+ parser.add_option('--no-parallel', action='store_true', default=False,
339
+ help='Disable multiprocessing')
340
+ parser.add_option('-S', '--suffix', dest='suffix', default='',
341
+ help='suffix to add to generated files')
342
+ parser.add_option('--toplevel-dir', dest='toplevel_dir', action='store',
343
+ default=None, metavar='DIR', type='path',
344
+ help='directory to use as the root of the source tree')
345
+ parser.add_option('-R', '--root-target', dest='root_targets',
346
+ action='append', metavar='TARGET',
347
+ help='include only TARGET and its deep dependencies')
348
+
349
+ options, build_files_arg = parser.parse_args(args)
350
+ build_files = build_files_arg
351
+
352
+ # Set up the configuration directory (defaults to ~/.gyp)
353
+ if not options.config_dir:
354
+ home = None
355
+ home_dot_gyp = None
356
+ if options.use_environment:
357
+ home_dot_gyp = os.environ.get('GYP_CONFIG_DIR', None)
358
+ if home_dot_gyp:
359
+ home_dot_gyp = os.path.expanduser(home_dot_gyp)
360
+
361
+ if not home_dot_gyp:
362
+ home_vars = ['HOME']
363
+ if sys.platform in ('cygwin', 'win32'):
364
+ home_vars.append('USERPROFILE')
365
+ for home_var in home_vars:
366
+ home = os.getenv(home_var)
367
+ if home != None:
368
+ home_dot_gyp = os.path.join(home, '.gyp')
369
+ if not os.path.exists(home_dot_gyp):
370
+ home_dot_gyp = None
371
+ else:
372
+ break
373
+ else:
374
+ home_dot_gyp = os.path.expanduser(options.config_dir)
375
+
376
+ if home_dot_gyp and not os.path.exists(home_dot_gyp):
377
+ home_dot_gyp = None
378
+
379
+ if not options.formats:
380
+ # If no format was given on the command line, then check the env variable.
381
+ generate_formats = []
382
+ if options.use_environment:
383
+ generate_formats = os.environ.get('GYP_GENERATORS', [])
384
+ if generate_formats:
385
+ generate_formats = re.split(r'[\s,]', generate_formats)
386
+ if generate_formats:
387
+ options.formats = generate_formats
388
+ else:
389
+ # Nothing in the variable, default based on platform.
390
+ if sys.platform == 'darwin':
391
+ options.formats = ['xcode']
392
+ elif sys.platform in ('win32', 'cygwin'):
393
+ options.formats = ['msvs']
394
+ else:
395
+ options.formats = ['make']
396
+
397
+ if not options.generator_output and options.use_environment:
398
+ g_o = os.environ.get('GYP_GENERATOR_OUTPUT')
399
+ if g_o:
400
+ options.generator_output = g_o
401
+
402
+ options.parallel = not options.no_parallel
403
+
404
+ for mode in options.debug:
405
+ gyp.debug[mode] = 1
406
+
407
+ # Do an extra check to avoid work when we're not debugging.
408
+ if DEBUG_GENERAL in gyp.debug:
409
+ DebugOutput(DEBUG_GENERAL, 'running with these options:')
410
+ for option, value in sorted(options.__dict__.items()):
411
+ if option[0] == '_':
412
+ continue
413
+ if isinstance(value, basestring):
414
+ DebugOutput(DEBUG_GENERAL, " %s: '%s'", option, value)
415
+ else:
416
+ DebugOutput(DEBUG_GENERAL, " %s: %s", option, value)
417
+
418
+ if not build_files:
419
+ build_files = FindBuildFiles()
420
+ if not build_files:
421
+ raise GypError((usage + '\n\n%s: error: no build_file') %
422
+ (my_name, my_name))
423
+
424
+ # TODO(mark): Chromium-specific hack!
425
+ # For Chromium, the gyp "depth" variable should always be a relative path
426
+ # to Chromium's top-level "src" directory. If no depth variable was set
427
+ # on the command line, try to find a "src" directory by looking at the
428
+ # absolute path to each build file's directory. The first "src" component
429
+ # found will be treated as though it were the path used for --depth.
430
+ if not options.depth:
431
+ for build_file in build_files:
432
+ build_file_dir = os.path.abspath(os.path.dirname(build_file))
433
+ build_file_dir_components = build_file_dir.split(os.path.sep)
434
+ components_len = len(build_file_dir_components)
435
+ for index in xrange(components_len - 1, -1, -1):
436
+ if build_file_dir_components[index] == 'src':
437
+ options.depth = os.path.sep.join(build_file_dir_components)
438
+ break
439
+ del build_file_dir_components[index]
440
+
441
+ # If the inner loop found something, break without advancing to another
442
+ # build file.
443
+ if options.depth:
444
+ break
445
+
446
+ if not options.depth:
447
+ raise GypError('Could not automatically locate src directory. This is'
448
+ 'a temporary Chromium feature that will be removed. Use'
449
+ '--depth as a workaround.')
450
+
451
+ # If toplevel-dir is not set, we assume that depth is the root of our source
452
+ # tree.
453
+ if not options.toplevel_dir:
454
+ options.toplevel_dir = options.depth
455
+
456
+ # -D on the command line sets variable defaults - D isn't just for define,
457
+ # it's for default. Perhaps there should be a way to force (-F?) a
458
+ # variable's value so that it can't be overridden by anything else.
459
+ cmdline_default_variables = {}
460
+ defines = []
461
+ if options.use_environment:
462
+ defines += ShlexEnv('GYP_DEFINES')
463
+ if options.defines:
464
+ defines += options.defines
465
+ cmdline_default_variables = NameValueListToDict(defines)
466
+ if DEBUG_GENERAL in gyp.debug:
467
+ DebugOutput(DEBUG_GENERAL,
468
+ "cmdline_default_variables: %s", cmdline_default_variables)
469
+
470
+ # Set up includes.
471
+ includes = []
472
+
473
+ # If ~/.gyp/include.gypi exists, it'll be forcibly included into every
474
+ # .gyp file that's loaded, before anything else is included.
475
+ if home_dot_gyp != None:
476
+ default_include = os.path.join(home_dot_gyp, 'include.gypi')
477
+ if os.path.exists(default_include):
478
+ print 'Using overrides found in ' + default_include
479
+ includes.append(default_include)
480
+
481
+ # Command-line --include files come after the default include.
482
+ if options.includes:
483
+ includes.extend(options.includes)
484
+
485
+ # Generator flags should be prefixed with the target generator since they
486
+ # are global across all generator runs.
487
+ gen_flags = []
488
+ if options.use_environment:
489
+ gen_flags += ShlexEnv('GYP_GENERATOR_FLAGS')
490
+ if options.generator_flags:
491
+ gen_flags += options.generator_flags
492
+ generator_flags = NameValueListToDict(gen_flags)
493
+ if DEBUG_GENERAL in gyp.debug.keys():
494
+ DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags)
495
+
496
+ # Generate all requested formats (use a set in case we got one format request
497
+ # twice)
498
+ for format in set(options.formats):
499
+ params = {'options': options,
500
+ 'build_files': build_files,
501
+ 'generator_flags': generator_flags,
502
+ 'cwd': os.getcwd(),
503
+ 'build_files_arg': build_files_arg,
504
+ 'gyp_binary': sys.argv[0],
505
+ 'home_dot_gyp': home_dot_gyp,
506
+ 'parallel': options.parallel,
507
+ 'root_targets': options.root_targets,
508
+ 'target_arch': cmdline_default_variables.get('target_arch', '')}
509
+
510
+ # Start with the default variables from the command line.
511
+ [generator, flat_list, targets, data] = Load(
512
+ build_files, format, cmdline_default_variables, includes, options.depth,
513
+ params, options.check, options.circular_check,
514
+ options.duplicate_basename_check)
515
+
516
+ # TODO(mark): Pass |data| for now because the generator needs a list of
517
+ # build files that came in. In the future, maybe it should just accept
518
+ # a list, and not the whole data dict.
519
+ # NOTE: flat_list is the flattened dependency graph specifying the order
520
+ # that targets may be built. Build systems that operate serially or that
521
+ # need to have dependencies defined before dependents reference them should
522
+ # generate targets in the order specified in flat_list.
523
+ generator.GenerateOutput(flat_list, targets, data, params)
524
+
525
+ if options.configs:
526
+ valid_configs = targets[flat_list[0]]['configurations'].keys()
527
+ for conf in options.configs:
528
+ if conf not in valid_configs:
529
+ raise GypError('Invalid config specified via --build: %s' % conf)
530
+ generator.PerformBuild(data, options.configs, params)
531
+
532
+ # Done
533
+ return 0
534
+
535
+
536
+ def main(args):
537
+ try:
538
+ return gyp_main(args)
539
+ except GypError, e:
540
+ sys.stderr.write("gyp: %s\n" % e)
541
+ return 1
542
+
543
+ # NOTE: setuptools generated console_scripts calls function with no arguments
544
+ def script_main():
545
+ return main(sys.argv[1:])
546
+
547
+ if __name__ == '__main__':
548
+ sys.exit(script_main())