mt-libuv 4.1.0 → 4.1.03

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2094) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -4
  3. data/ext/Rakefile +1 -1
  4. data/ext/gyp/.gitignore +1 -0
  5. data/ext/gyp/AUTHORS +17 -0
  6. data/ext/gyp/DEPS +23 -0
  7. data/ext/gyp/LICENSE +27 -0
  8. data/ext/gyp/OWNERS +1 -0
  9. data/ext/gyp/PRESUBMIT.py +125 -0
  10. data/ext/gyp/README.md +5 -0
  11. data/ext/gyp/buildbot/buildbot_run.py +138 -0
  12. data/ext/gyp/buildbot/commit_queue/OWNERS +6 -0
  13. data/ext/gyp/buildbot/commit_queue/README +3 -0
  14. data/ext/gyp/buildbot/commit_queue/cq_config.json +15 -0
  15. data/ext/gyp/buildbot/travis-checkout.sh +27 -0
  16. data/ext/gyp/buildbot/travis-test.sh +12 -0
  17. data/ext/gyp/codereview.settings +6 -0
  18. data/ext/gyp/data/win/large-pdb-shim.cc +12 -0
  19. data/ext/gyp/gyp +8 -0
  20. data/ext/gyp/gyp.bat +5 -0
  21. data/ext/gyp/gyp_main.py +16 -0
  22. data/ext/gyp/gyptest.py +243 -0
  23. data/ext/gyp/pylib/gyp/MSVSNew.py +353 -0
  24. data/ext/gyp/pylib/gyp/MSVSProject.py +208 -0
  25. data/ext/gyp/pylib/gyp/MSVSSettings.py +1106 -0
  26. data/ext/gyp/pylib/gyp/MSVSSettings_test.py +1486 -0
  27. data/ext/gyp/pylib/gyp/MSVSToolFile.py +58 -0
  28. data/ext/gyp/pylib/gyp/MSVSUserFile.py +147 -0
  29. data/ext/gyp/pylib/gyp/MSVSUtil.py +271 -0
  30. data/ext/gyp/pylib/gyp/MSVSVersion.py +504 -0
  31. data/ext/gyp/pylib/gyp/__init__.py +555 -0
  32. data/ext/gyp/pylib/gyp/common.py +619 -0
  33. data/ext/gyp/pylib/gyp/common_test.py +73 -0
  34. data/ext/gyp/pylib/gyp/easy_xml.py +170 -0
  35. data/ext/gyp/pylib/gyp/easy_xml_test.py +106 -0
  36. data/ext/gyp/pylib/gyp/flock_tool.py +54 -0
  37. data/ext/gyp/pylib/gyp/generator/__init__.py +0 -0
  38. data/ext/gyp/pylib/gyp/generator/analyzer.py +744 -0
  39. data/ext/gyp/pylib/gyp/generator/cmake.py +1256 -0
  40. data/ext/gyp/pylib/gyp/generator/dump_dependency_json.py +101 -0
  41. data/ext/gyp/pylib/gyp/generator/eclipse.py +425 -0
  42. data/ext/gyp/pylib/gyp/generator/gypd.py +94 -0
  43. data/ext/gyp/pylib/gyp/generator/gypsh.py +56 -0
  44. data/ext/gyp/pylib/gyp/generator/make.py +2260 -0
  45. data/ext/gyp/pylib/gyp/generator/msvs.py +3537 -0
  46. data/ext/gyp/pylib/gyp/generator/msvs_test.py +40 -0
  47. data/ext/gyp/pylib/gyp/generator/ninja.py +2500 -0
  48. data/ext/gyp/pylib/gyp/generator/ninja_test.py +46 -0
  49. data/ext/gyp/pylib/gyp/generator/xcode.py +1302 -0
  50. data/ext/gyp/pylib/gyp/generator/xcode_test.py +23 -0
  51. data/ext/gyp/pylib/gyp/input.py +2908 -0
  52. data/ext/gyp/pylib/gyp/input_test.py +90 -0
  53. data/ext/gyp/pylib/gyp/mac_tool.py +721 -0
  54. data/ext/gyp/pylib/gyp/msvs_emulation.py +1112 -0
  55. data/ext/gyp/pylib/gyp/ninja_syntax.py +168 -0
  56. data/ext/gyp/pylib/gyp/simple_copy.py +57 -0
  57. data/ext/gyp/pylib/gyp/win_tool.py +326 -0
  58. data/ext/gyp/pylib/gyp/xcode_emulation.py +1800 -0
  59. data/ext/gyp/pylib/gyp/xcode_ninja.py +289 -0
  60. data/ext/gyp/pylib/gyp/xcodeproj_file.py +2995 -0
  61. data/ext/gyp/pylib/gyp/xml_fix.py +68 -0
  62. data/ext/gyp/samples/samples +83 -0
  63. data/ext/gyp/samples/samples.bat +5 -0
  64. data/ext/gyp/setup.py +19 -0
  65. data/ext/gyp/test/actions/generated-header/action.py +11 -0
  66. data/ext/gyp/test/actions/generated-header/main.cc +7 -0
  67. data/ext/gyp/test/actions/generated-header/test.gyp +34 -0
  68. data/ext/gyp/test/actions/gyptest-all.py +101 -0
  69. data/ext/gyp/test/actions/gyptest-default.py +68 -0
  70. data/ext/gyp/test/actions/gyptest-errors.py +24 -0
  71. data/ext/gyp/test/actions/gyptest-generated-header.py +38 -0
  72. data/ext/gyp/test/actions/src/action_missing_name.gyp +24 -0
  73. data/ext/gyp/test/actions/src/actions.gyp +114 -0
  74. data/ext/gyp/test/actions/src/confirm-dep-files.py +21 -0
  75. data/ext/gyp/test/actions/src/subdir1/counter.py +44 -0
  76. data/ext/gyp/test/actions/src/subdir1/executable.gyp +74 -0
  77. data/ext/gyp/test/actions/src/subdir1/make-prog1.py +20 -0
  78. data/ext/gyp/test/actions/src/subdir1/make-prog2.py +20 -0
  79. data/ext/gyp/test/actions/src/subdir1/program.c +12 -0
  80. data/ext/gyp/test/actions/src/subdir2/make-file.py +11 -0
  81. data/ext/gyp/test/actions/src/subdir2/none.gyp +33 -0
  82. data/ext/gyp/test/actions/src/subdir3/generate_main.py +21 -0
  83. data/ext/gyp/test/actions/src/subdir3/null_input.gyp +29 -0
  84. data/ext/gyp/test/actions-bare/gyptest-bare.py +24 -0
  85. data/ext/gyp/test/actions-bare/src/bare.gyp +25 -0
  86. data/ext/gyp/test/actions-bare/src/bare.py +11 -0
  87. data/ext/gyp/test/actions-depfile/depfile.gyp +42 -0
  88. data/ext/gyp/test/actions-depfile/gyptest-all.py +30 -0
  89. data/ext/gyp/test/actions-depfile/input.txt +1 -0
  90. data/ext/gyp/test/actions-depfile/touch.py +18 -0
  91. data/ext/gyp/test/actions-multiple/gyptest-all.py +72 -0
  92. data/ext/gyp/test/actions-multiple/src/actions.gyp +226 -0
  93. data/ext/gyp/test/actions-multiple/src/copyfile.py +9 -0
  94. data/ext/gyp/test/actions-multiple/src/filter.py +12 -0
  95. data/ext/gyp/test/actions-multiple/src/foo.c +11 -0
  96. data/ext/gyp/test/actions-multiple/src/input.txt +1 -0
  97. data/ext/gyp/test/actions-multiple/src/main.c +22 -0
  98. data/ext/gyp/test/actions-multiple-outputs/gyptest-multiple-outputs.py +45 -0
  99. data/ext/gyp/test/actions-multiple-outputs/src/multiple-outputs.gyp +23 -0
  100. data/ext/gyp/test/actions-multiple-outputs/src/touch.py +16 -0
  101. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/gyptest-action.py +45 -0
  102. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/src/action.gyp +28 -0
  103. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/src/rcopy.py +20 -0
  104. data/ext/gyp/test/actions-none/gyptest-none.py +24 -0
  105. data/ext/gyp/test/actions-none/src/fake_cross.py +12 -0
  106. data/ext/gyp/test/actions-none/src/foo.cc +1 -0
  107. data/ext/gyp/test/actions-none/src/none_with_source_files.gyp +35 -0
  108. data/ext/gyp/test/actions-subdir/gyptest-action.py +26 -0
  109. data/ext/gyp/test/actions-subdir/src/make-file.py +11 -0
  110. data/ext/gyp/test/actions-subdir/src/none.gyp +31 -0
  111. data/ext/gyp/test/actions-subdir/src/subdir/make-subdir-file.py +11 -0
  112. data/ext/gyp/test/actions-subdir/src/subdir/subdir.gyp +28 -0
  113. data/ext/gyp/test/additional-targets/gyptest-additional.py +63 -0
  114. data/ext/gyp/test/additional-targets/src/all.gyp +13 -0
  115. data/ext/gyp/test/additional-targets/src/dir1/actions.gyp +56 -0
  116. data/ext/gyp/test/additional-targets/src/dir1/emit.py +11 -0
  117. data/ext/gyp/test/additional-targets/src/dir1/lib1.c +6 -0
  118. data/ext/gyp/test/analyzer/common.gypi +6 -0
  119. data/ext/gyp/test/analyzer/gyptest-analyzer.py +427 -0
  120. data/ext/gyp/test/analyzer/static_library_test.gyp +34 -0
  121. data/ext/gyp/test/analyzer/subdir/subdir.gyp +36 -0
  122. data/ext/gyp/test/analyzer/subdir/subdir2/subdir2.gyp +15 -0
  123. data/ext/gyp/test/analyzer/subdir2/subdir.gyp +18 -0
  124. data/ext/gyp/test/analyzer/subdir2/subdir.includes.gypi +9 -0
  125. data/ext/gyp/test/analyzer/test.gyp +114 -0
  126. data/ext/gyp/test/analyzer/test2.gyp +25 -0
  127. data/ext/gyp/test/analyzer/test2.includes.gypi +13 -0
  128. data/ext/gyp/test/analyzer/test2.includes.includes.gypi +9 -0
  129. data/ext/gyp/test/analyzer/test2.toplevel_includes.gypi +15 -0
  130. data/ext/gyp/test/analyzer/test3.gyp +77 -0
  131. data/ext/gyp/test/analyzer/test4.gyp +80 -0
  132. data/ext/gyp/test/analyzer/test5.gyp +25 -0
  133. data/ext/gyp/test/arflags/gyptest-arflags.py +26 -0
  134. data/ext/gyp/test/arflags/lib.cc +0 -0
  135. data/ext/gyp/test/arflags/test.gyp +10 -0
  136. data/ext/gyp/test/assembly/gyptest-assembly.py +31 -0
  137. data/ext/gyp/test/assembly/gyptest-override.py +24 -0
  138. data/ext/gyp/test/assembly/src/as.bat +4 -0
  139. data/ext/gyp/test/assembly/src/assembly.gyp +62 -0
  140. data/ext/gyp/test/assembly/src/lib1.S +15 -0
  141. data/ext/gyp/test/assembly/src/lib1.c +3 -0
  142. data/ext/gyp/test/assembly/src/override.gyp +34 -0
  143. data/ext/gyp/test/assembly/src/override_asm.asm +8 -0
  144. data/ext/gyp/test/assembly/src/program.c +12 -0
  145. data/ext/gyp/test/build-option/gyptest-build.py +27 -0
  146. data/ext/gyp/test/build-option/hello.c +13 -0
  147. data/ext/gyp/test/build-option/hello.gyp +15 -0
  148. data/ext/gyp/test/builddir/gyptest-all.py +85 -0
  149. data/ext/gyp/test/builddir/gyptest-default.py +85 -0
  150. data/ext/gyp/test/builddir/src/builddir.gypi +18 -0
  151. data/ext/gyp/test/builddir/src/func1.c +6 -0
  152. data/ext/gyp/test/builddir/src/func2.c +6 -0
  153. data/ext/gyp/test/builddir/src/func3.c +6 -0
  154. data/ext/gyp/test/builddir/src/func4.c +6 -0
  155. data/ext/gyp/test/builddir/src/func5.c +6 -0
  156. data/ext/gyp/test/builddir/src/prog1.c +10 -0
  157. data/ext/gyp/test/builddir/src/prog1.gyp +30 -0
  158. data/ext/gyp/test/builddir/src/subdir2/prog2.c +10 -0
  159. data/ext/gyp/test/builddir/src/subdir2/prog2.gyp +19 -0
  160. data/ext/gyp/test/builddir/src/subdir2/subdir3/prog3.c +10 -0
  161. data/ext/gyp/test/builddir/src/subdir2/subdir3/prog3.gyp +19 -0
  162. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.c +10 -0
  163. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.gyp +19 -0
  164. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c +10 -0
  165. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.gyp +19 -0
  166. data/ext/gyp/test/cflags/cflags.c +15 -0
  167. data/ext/gyp/test/cflags/cflags.gyp +23 -0
  168. data/ext/gyp/test/cflags/gyptest-cflags.py +75 -0
  169. data/ext/gyp/test/compilable/gyptest-headers.py +29 -0
  170. data/ext/gyp/test/compilable/src/headers.gyp +26 -0
  171. data/ext/gyp/test/compilable/src/lib1.cpp +7 -0
  172. data/ext/gyp/test/compilable/src/lib1.hpp +6 -0
  173. data/ext/gyp/test/compilable/src/program.cpp +9 -0
  174. data/ext/gyp/test/compiler-override/compiler-exe.gyp +16 -0
  175. data/ext/gyp/test/compiler-override/compiler-global-settings.gyp.in +34 -0
  176. data/ext/gyp/test/compiler-override/compiler-host.gyp +17 -0
  177. data/ext/gyp/test/compiler-override/compiler-shared-lib.gyp +16 -0
  178. data/ext/gyp/test/compiler-override/cxxtest.cc +7 -0
  179. data/ext/gyp/test/compiler-override/gyptest-compiler-env-toolchain.py +78 -0
  180. data/ext/gyp/test/compiler-override/gyptest-compiler-env.py +110 -0
  181. data/ext/gyp/test/compiler-override/gyptest-compiler-global-settings.py +82 -0
  182. data/ext/gyp/test/compiler-override/my_cc.py +7 -0
  183. data/ext/gyp/test/compiler-override/my_cxx.py +7 -0
  184. data/ext/gyp/test/compiler-override/my_ld.py +7 -0
  185. data/ext/gyp/test/compiler-override/my_nm.py +9 -0
  186. data/ext/gyp/test/compiler-override/my_readelf.py +9 -0
  187. data/ext/gyp/test/compiler-override/test.c +7 -0
  188. data/ext/gyp/test/conditions/elseif/elseif.gyp +43 -0
  189. data/ext/gyp/test/conditions/elseif/elseif_bad1.gyp +20 -0
  190. data/ext/gyp/test/conditions/elseif/elseif_bad2.gyp +22 -0
  191. data/ext/gyp/test/conditions/elseif/elseif_bad3.gyp +23 -0
  192. data/ext/gyp/test/conditions/elseif/elseif_conditions.gypi +15 -0
  193. data/ext/gyp/test/conditions/elseif/gyptest_elseif.py +33 -0
  194. data/ext/gyp/test/conditions/elseif/program.cc +10 -0
  195. data/ext/gyp/test/configurations/basics/configurations.c +15 -0
  196. data/ext/gyp/test/configurations/basics/configurations.gyp +32 -0
  197. data/ext/gyp/test/configurations/basics/gyptest-configurations.py +29 -0
  198. data/ext/gyp/test/configurations/inheritance/configurations.c +21 -0
  199. data/ext/gyp/test/configurations/inheritance/configurations.gyp +40 -0
  200. data/ext/gyp/test/configurations/inheritance/duplicates.gyp +27 -0
  201. data/ext/gyp/test/configurations/inheritance/duplicates.gypd.golden +12 -0
  202. data/ext/gyp/test/configurations/inheritance/gyptest-duplicates.py +36 -0
  203. data/ext/gyp/test/configurations/inheritance/gyptest-inheritance.py +33 -0
  204. data/ext/gyp/test/configurations/invalid/actions.gyp +18 -0
  205. data/ext/gyp/test/configurations/invalid/all_dependent_settings.gyp +18 -0
  206. data/ext/gyp/test/configurations/invalid/configurations.gyp +18 -0
  207. data/ext/gyp/test/configurations/invalid/dependencies.gyp +18 -0
  208. data/ext/gyp/test/configurations/invalid/direct_dependent_settings.gyp +18 -0
  209. data/ext/gyp/test/configurations/invalid/gyptest-configurations.py +36 -0
  210. data/ext/gyp/test/configurations/invalid/libraries.gyp +18 -0
  211. data/ext/gyp/test/configurations/invalid/link_settings.gyp +18 -0
  212. data/ext/gyp/test/configurations/invalid/sources.gyp +18 -0
  213. data/ext/gyp/test/configurations/invalid/standalone_static_library.gyp +17 -0
  214. data/ext/gyp/test/configurations/invalid/target_name.gyp +18 -0
  215. data/ext/gyp/test/configurations/invalid/type.gyp +18 -0
  216. data/ext/gyp/test/configurations/target_platform/configurations.gyp +58 -0
  217. data/ext/gyp/test/configurations/target_platform/front.c +8 -0
  218. data/ext/gyp/test/configurations/target_platform/gyptest-target_platform.py +40 -0
  219. data/ext/gyp/test/configurations/target_platform/left.c +3 -0
  220. data/ext/gyp/test/configurations/target_platform/right.c +3 -0
  221. data/ext/gyp/test/configurations/x64/configurations.c +12 -0
  222. data/ext/gyp/test/configurations/x64/configurations.gyp +38 -0
  223. data/ext/gyp/test/configurations/x64/gyptest-x86.py +31 -0
  224. data/ext/gyp/test/copies/gyptest-all.py +42 -0
  225. data/ext/gyp/test/copies/gyptest-attribs.py +41 -0
  226. data/ext/gyp/test/copies/gyptest-default.py +42 -0
  227. data/ext/gyp/test/copies/gyptest-samedir.py +28 -0
  228. data/ext/gyp/test/copies/gyptest-slash.py +39 -0
  229. data/ext/gyp/test/copies/gyptest-sourceless-shared-lib.py +20 -0
  230. data/ext/gyp/test/copies/gyptest-updir.py +32 -0
  231. data/ext/gyp/test/copies/src/copies-attribs.gyp +20 -0
  232. data/ext/gyp/test/copies/src/copies-samedir.gyp +37 -0
  233. data/ext/gyp/test/copies/src/copies-slash.gyp +36 -0
  234. data/ext/gyp/test/copies/src/copies-sourceless-shared-lib.gyp +27 -0
  235. data/ext/gyp/test/copies/src/copies-updir.gyp +21 -0
  236. data/ext/gyp/test/copies/src/copies.gyp +70 -0
  237. data/ext/gyp/test/copies/src/directory/file3 +1 -0
  238. data/ext/gyp/test/copies/src/directory/file4 +1 -0
  239. data/ext/gyp/test/copies/src/directory/subdir/file5 +1 -0
  240. data/ext/gyp/test/copies/src/executable-file.sh +3 -0
  241. data/ext/gyp/test/copies/src/file1 +1 -0
  242. data/ext/gyp/test/copies/src/file2 +1 -0
  243. data/ext/gyp/test/copies/src/foo.c +13 -0
  244. data/ext/gyp/test/copies/src/parentdir/subdir/file6 +1 -0
  245. data/ext/gyp/test/custom-generator/gyptest-custom-generator.py +18 -0
  246. data/ext/gyp/test/custom-generator/mygenerator.py +14 -0
  247. data/ext/gyp/test/custom-generator/test.gyp +15 -0
  248. data/ext/gyp/test/cxxflags/cxxflags.cc +15 -0
  249. data/ext/gyp/test/cxxflags/cxxflags.gyp +15 -0
  250. data/ext/gyp/test/cxxflags/gyptest-cxxflags.py +45 -0
  251. data/ext/gyp/test/defines/defines-env.gyp +22 -0
  252. data/ext/gyp/test/defines/defines.c +23 -0
  253. data/ext/gyp/test/defines/defines.gyp +38 -0
  254. data/ext/gyp/test/defines/gyptest-define-override.py +43 -0
  255. data/ext/gyp/test/defines/gyptest-defines-env-regyp.py +51 -0
  256. data/ext/gyp/test/defines/gyptest-defines-env.py +85 -0
  257. data/ext/gyp/test/defines/gyptest-defines.py +39 -0
  258. data/ext/gyp/test/defines-escaping/defines-escaping.c +11 -0
  259. data/ext/gyp/test/defines-escaping/defines-escaping.gyp +19 -0
  260. data/ext/gyp/test/defines-escaping/gyptest-defines-escaping.py +184 -0
  261. data/ext/gyp/test/dependencies/a.c +9 -0
  262. data/ext/gyp/test/dependencies/adso/all_dependent_settings_order.gyp +45 -0
  263. data/ext/gyp/test/dependencies/adso/write_args.py +11 -0
  264. data/ext/gyp/test/dependencies/b/b.c +3 -0
  265. data/ext/gyp/test/dependencies/b/b.gyp +22 -0
  266. data/ext/gyp/test/dependencies/b/b3.c +9 -0
  267. data/ext/gyp/test/dependencies/c/c.c +4 -0
  268. data/ext/gyp/test/dependencies/c/c.gyp +22 -0
  269. data/ext/gyp/test/dependencies/c/d.c +3 -0
  270. data/ext/gyp/test/dependencies/double_dependency.gyp +23 -0
  271. data/ext/gyp/test/dependencies/double_dependent.gyp +12 -0
  272. data/ext/gyp/test/dependencies/extra_targets.gyp +18 -0
  273. data/ext/gyp/test/dependencies/gyptest-all-dependent-settings-order.py +19 -0
  274. data/ext/gyp/test/dependencies/gyptest-double-dependency.py +19 -0
  275. data/ext/gyp/test/dependencies/gyptest-extra-targets.py +22 -0
  276. data/ext/gyp/test/dependencies/gyptest-indirect-module-dependency.py +22 -0
  277. data/ext/gyp/test/dependencies/gyptest-lib-only.py +39 -0
  278. data/ext/gyp/test/dependencies/gyptest-none-traversal.py +25 -0
  279. data/ext/gyp/test/dependencies/gyptest-sharedlib-linksettings.py +21 -0
  280. data/ext/gyp/test/dependencies/lib_only.gyp +16 -0
  281. data/ext/gyp/test/dependencies/main.c +14 -0
  282. data/ext/gyp/test/dependencies/module-dep/a.cc +7 -0
  283. data/ext/gyp/test/dependencies/module-dep/dll.cc +9 -0
  284. data/ext/gyp/test/dependencies/module-dep/exe.cc +7 -0
  285. data/ext/gyp/test/dependencies/module-dep/indirect-module-dependency.gyp +37 -0
  286. data/ext/gyp/test/dependencies/none_traversal.gyp +46 -0
  287. data/ext/gyp/test/dependencies/sharedlib-linksettings/program.c +25 -0
  288. data/ext/gyp/test/dependencies/sharedlib-linksettings/sharedlib.c +16 -0
  289. data/ext/gyp/test/dependencies/sharedlib-linksettings/staticlib.c +24 -0
  290. data/ext/gyp/test/dependencies/sharedlib-linksettings/test.gyp +37 -0
  291. data/ext/gyp/test/dependency-copy/gyptest-copy.py +26 -0
  292. data/ext/gyp/test/dependency-copy/src/copies.gyp +25 -0
  293. data/ext/gyp/test/dependency-copy/src/file1.c +7 -0
  294. data/ext/gyp/test/dependency-copy/src/file2.c +7 -0
  295. data/ext/gyp/test/dependent-settings/nested-dependent-settings/all-dependent-settings.gyp +19 -0
  296. data/ext/gyp/test/dependent-settings/nested-dependent-settings/direct-dependent-settings.gyp +19 -0
  297. data/ext/gyp/test/dependent-settings/nested-dependent-settings/gyptest-nested-dependent-settings.py +18 -0
  298. data/ext/gyp/test/determinism/determinism.gyp +59 -0
  299. data/ext/gyp/test/determinism/empty-targets.gyp +32 -0
  300. data/ext/gyp/test/determinism/gyptest-determinism.py +30 -0
  301. data/ext/gyp/test/determinism/gyptest-empty-target-names.py +30 -0
  302. data/ext/gyp/test/determinism/gyptest-needed-variables.py +30 -0
  303. data/ext/gyp/test/determinism/gyptest-solibs.py +37 -0
  304. data/ext/gyp/test/determinism/main.cc +5 -0
  305. data/ext/gyp/test/determinism/needed-variables.gyp +33 -0
  306. data/ext/gyp/test/determinism/rule.py +8 -0
  307. data/ext/gyp/test/determinism/solib.cc +8 -0
  308. data/ext/gyp/test/determinism/solibs.gyp +32 -0
  309. data/ext/gyp/test/empty-target/empty-target.gyp +12 -0
  310. data/ext/gyp/test/empty-target/gyptest-empty-target.py +18 -0
  311. data/ext/gyp/test/errors/dependency_cycle.gyp +23 -0
  312. data/ext/gyp/test/errors/duplicate_basenames.gyp +13 -0
  313. data/ext/gyp/test/errors/duplicate_node.gyp +12 -0
  314. data/ext/gyp/test/errors/duplicate_rule.gyp +22 -0
  315. data/ext/gyp/test/errors/duplicate_targets.gyp +14 -0
  316. data/ext/gyp/test/errors/error_command.gyp +12 -0
  317. data/ext/gyp/test/errors/file_cycle0.gyp +17 -0
  318. data/ext/gyp/test/errors/file_cycle1.gyp +13 -0
  319. data/ext/gyp/test/errors/gyptest-errors.py +80 -0
  320. data/ext/gyp/test/errors/missing_command.gyp +12 -0
  321. data/ext/gyp/test/errors/missing_dep.gyp +15 -0
  322. data/ext/gyp/test/errors/missing_targets.gyp +8 -0
  323. data/ext/gyp/test/escaping/colon/test.gyp +21 -0
  324. data/ext/gyp/test/escaping/gyptest-colon.py +51 -0
  325. data/ext/gyp/test/exclusion/exclusion.gyp +23 -0
  326. data/ext/gyp/test/exclusion/gyptest-exclusion.py +22 -0
  327. data/ext/gyp/test/exclusion/hello.c +15 -0
  328. data/ext/gyp/test/external-cross-compile/gyptest-cross.py +31 -0
  329. data/ext/gyp/test/external-cross-compile/src/bogus1.cc +1 -0
  330. data/ext/gyp/test/external-cross-compile/src/bogus2.c +1 -0
  331. data/ext/gyp/test/external-cross-compile/src/cross.gyp +83 -0
  332. data/ext/gyp/test/external-cross-compile/src/cross_compile.gypi +23 -0
  333. data/ext/gyp/test/external-cross-compile/src/fake_cross.py +18 -0
  334. data/ext/gyp/test/external-cross-compile/src/program.cc +16 -0
  335. data/ext/gyp/test/external-cross-compile/src/test1.cc +1 -0
  336. data/ext/gyp/test/external-cross-compile/src/test2.c +1 -0
  337. data/ext/gyp/test/external-cross-compile/src/test3.cc +1 -0
  338. data/ext/gyp/test/external-cross-compile/src/test4.c +1 -0
  339. data/ext/gyp/test/external-cross-compile/src/tochar.py +13 -0
  340. data/ext/gyp/test/generator-output/actions/actions.gyp +16 -0
  341. data/ext/gyp/test/generator-output/actions/build/README.txt +4 -0
  342. data/ext/gyp/test/generator-output/actions/subdir1/actions-out/README.txt +4 -0
  343. data/ext/gyp/test/generator-output/actions/subdir1/build/README.txt +4 -0
  344. data/ext/gyp/test/generator-output/actions/subdir1/executable.gyp +44 -0
  345. data/ext/gyp/test/generator-output/actions/subdir1/make-prog1.py +20 -0
  346. data/ext/gyp/test/generator-output/actions/subdir1/make-prog2.py +20 -0
  347. data/ext/gyp/test/generator-output/actions/subdir1/program.c +12 -0
  348. data/ext/gyp/test/generator-output/actions/subdir2/actions-out/README.txt +4 -0
  349. data/ext/gyp/test/generator-output/actions/subdir2/build/README.txt +4 -0
  350. data/ext/gyp/test/generator-output/actions/subdir2/make-file.py +11 -0
  351. data/ext/gyp/test/generator-output/actions/subdir2/none.gyp +31 -0
  352. data/ext/gyp/test/generator-output/copies/build/README.txt +4 -0
  353. data/ext/gyp/test/generator-output/copies/copies-out/README.txt +4 -0
  354. data/ext/gyp/test/generator-output/copies/copies.gyp +50 -0
  355. data/ext/gyp/test/generator-output/copies/file1 +1 -0
  356. data/ext/gyp/test/generator-output/copies/file2 +1 -0
  357. data/ext/gyp/test/generator-output/copies/subdir/build/README.txt +4 -0
  358. data/ext/gyp/test/generator-output/copies/subdir/copies-out/README.txt +4 -0
  359. data/ext/gyp/test/generator-output/copies/subdir/file3 +1 -0
  360. data/ext/gyp/test/generator-output/copies/subdir/file4 +1 -0
  361. data/ext/gyp/test/generator-output/copies/subdir/subdir.gyp +32 -0
  362. data/ext/gyp/test/generator-output/gyptest-actions.py +57 -0
  363. data/ext/gyp/test/generator-output/gyptest-copies.py +59 -0
  364. data/ext/gyp/test/generator-output/gyptest-depth.py +58 -0
  365. data/ext/gyp/test/generator-output/gyptest-mac-bundle.py +33 -0
  366. data/ext/gyp/test/generator-output/gyptest-relocate.py +59 -0
  367. data/ext/gyp/test/generator-output/gyptest-rules.py +58 -0
  368. data/ext/gyp/test/generator-output/gyptest-subdir2-deep.py +36 -0
  369. data/ext/gyp/test/generator-output/gyptest-symlink.py +44 -0
  370. data/ext/gyp/test/generator-output/gyptest-top-all.py +53 -0
  371. data/ext/gyp/test/generator-output/mac-bundle/Info.plist +32 -0
  372. data/ext/gyp/test/generator-output/mac-bundle/app.order +1 -0
  373. data/ext/gyp/test/generator-output/mac-bundle/header.h +1 -0
  374. data/ext/gyp/test/generator-output/mac-bundle/main.c +1 -0
  375. data/ext/gyp/test/generator-output/mac-bundle/resource.sb +1 -0
  376. data/ext/gyp/test/generator-output/mac-bundle/test.gyp +25 -0
  377. data/ext/gyp/test/generator-output/rules/build/README.txt +4 -0
  378. data/ext/gyp/test/generator-output/rules/copy-file.py +12 -0
  379. data/ext/gyp/test/generator-output/rules/rules.gyp +16 -0
  380. data/ext/gyp/test/generator-output/rules/subdir1/build/README.txt +4 -0
  381. data/ext/gyp/test/generator-output/rules/subdir1/define3.in0 +1 -0
  382. data/ext/gyp/test/generator-output/rules/subdir1/define4.in0 +1 -0
  383. data/ext/gyp/test/generator-output/rules/subdir1/executable.gyp +59 -0
  384. data/ext/gyp/test/generator-output/rules/subdir1/function1.in1 +6 -0
  385. data/ext/gyp/test/generator-output/rules/subdir1/function2.in1 +6 -0
  386. data/ext/gyp/test/generator-output/rules/subdir1/program.c +18 -0
  387. data/ext/gyp/test/generator-output/rules/subdir2/build/README.txt +4 -0
  388. data/ext/gyp/test/generator-output/rules/subdir2/file1.in0 +1 -0
  389. data/ext/gyp/test/generator-output/rules/subdir2/file2.in0 +1 -0
  390. data/ext/gyp/test/generator-output/rules/subdir2/file3.in1 +1 -0
  391. data/ext/gyp/test/generator-output/rules/subdir2/file4.in1 +1 -0
  392. data/ext/gyp/test/generator-output/rules/subdir2/none.gyp +49 -0
  393. data/ext/gyp/test/generator-output/rules/subdir2/rules-out/README.txt +4 -0
  394. data/ext/gyp/test/generator-output/src/build/README.txt +4 -0
  395. data/ext/gyp/test/generator-output/src/inc.h +1 -0
  396. data/ext/gyp/test/generator-output/src/inc1/include1.h +1 -0
  397. data/ext/gyp/test/generator-output/src/prog1.c +18 -0
  398. data/ext/gyp/test/generator-output/src/prog1.gyp +28 -0
  399. data/ext/gyp/test/generator-output/src/subdir2/build/README.txt +4 -0
  400. data/ext/gyp/test/generator-output/src/subdir2/deeper/build/README.txt +4 -0
  401. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.c +7 -0
  402. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.gyp +18 -0
  403. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.h +1 -0
  404. data/ext/gyp/test/generator-output/src/subdir2/inc2/include2.h +1 -0
  405. data/ext/gyp/test/generator-output/src/subdir2/prog2.c +18 -0
  406. data/ext/gyp/test/generator-output/src/subdir2/prog2.gyp +28 -0
  407. data/ext/gyp/test/generator-output/src/subdir3/build/README.txt +4 -0
  408. data/ext/gyp/test/generator-output/src/subdir3/inc3/include3.h +1 -0
  409. data/ext/gyp/test/generator-output/src/subdir3/prog3.c +18 -0
  410. data/ext/gyp/test/generator-output/src/subdir3/prog3.gyp +25 -0
  411. data/ext/gyp/test/generator-output/src/symroot.gypi +16 -0
  412. data/ext/gyp/test/gyp-defines/defines.gyp +26 -0
  413. data/ext/gyp/test/gyp-defines/echo.py +11 -0
  414. data/ext/gyp/test/gyp-defines/gyptest-multiple-values.py +36 -0
  415. data/ext/gyp/test/gyp-defines/gyptest-regyp.py +40 -0
  416. data/ext/gyp/test/hard_dependency/gyptest-exported-hard-dependency.py +37 -0
  417. data/ext/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py +36 -0
  418. data/ext/gyp/test/hard_dependency/src/a.c +9 -0
  419. data/ext/gyp/test/hard_dependency/src/a.h +12 -0
  420. data/ext/gyp/test/hard_dependency/src/b.c +9 -0
  421. data/ext/gyp/test/hard_dependency/src/b.h +12 -0
  422. data/ext/gyp/test/hard_dependency/src/c.c +10 -0
  423. data/ext/gyp/test/hard_dependency/src/c.h +10 -0
  424. data/ext/gyp/test/hard_dependency/src/d.c +9 -0
  425. data/ext/gyp/test/hard_dependency/src/emit.py +11 -0
  426. data/ext/gyp/test/hard_dependency/src/hard_dependency.gyp +78 -0
  427. data/ext/gyp/test/hello/gyptest-all.py +24 -0
  428. data/ext/gyp/test/hello/gyptest-default.py +24 -0
  429. data/ext/gyp/test/hello/gyptest-disable-regyp.py +32 -0
  430. data/ext/gyp/test/hello/gyptest-regyp-output.py +36 -0
  431. data/ext/gyp/test/hello/gyptest-regyp.py +32 -0
  432. data/ext/gyp/test/hello/gyptest-target.py +24 -0
  433. data/ext/gyp/test/hello/hello.c +11 -0
  434. data/ext/gyp/test/hello/hello.gyp +15 -0
  435. data/ext/gyp/test/hello/hello2.c +11 -0
  436. data/ext/gyp/test/hello/hello2.gyp +15 -0
  437. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py +31 -0
  438. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-config-env.py +33 -0
  439. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py +44 -0
  440. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes.py +30 -0
  441. data/ext/gyp/test/home_dot_gyp/home/.gyp/include.gypi +5 -0
  442. data/ext/gyp/test/home_dot_gyp/home2/.gyp/include.gypi +5 -0
  443. data/ext/gyp/test/home_dot_gyp/home2/.gyp_new/include.gypi +5 -0
  444. data/ext/gyp/test/home_dot_gyp/src/all.gyp +22 -0
  445. data/ext/gyp/test/home_dot_gyp/src/printfoo.c +7 -0
  446. data/ext/gyp/test/include_dirs/gyptest-all.py +43 -0
  447. data/ext/gyp/test/include_dirs/gyptest-default.py +43 -0
  448. data/ext/gyp/test/include_dirs/src/inc.h +1 -0
  449. data/ext/gyp/test/include_dirs/src/inc1/include1.h +1 -0
  450. data/ext/gyp/test/include_dirs/src/includes.c +19 -0
  451. data/ext/gyp/test/include_dirs/src/includes.gyp +27 -0
  452. data/ext/gyp/test/include_dirs/src/shadow1/shadow.h +1 -0
  453. data/ext/gyp/test/include_dirs/src/shadow2/shadow.h +1 -0
  454. data/ext/gyp/test/include_dirs/src/subdir/inc.h +1 -0
  455. data/ext/gyp/test/include_dirs/src/subdir/inc2/include2.h +1 -0
  456. data/ext/gyp/test/include_dirs/src/subdir/subdir_includes.c +14 -0
  457. data/ext/gyp/test/include_dirs/src/subdir/subdir_includes.gyp +20 -0
  458. data/ext/gyp/test/intermediate_dir/gyptest-intermediate-dir.py +44 -0
  459. data/ext/gyp/test/intermediate_dir/src/script.py +22 -0
  460. data/ext/gyp/test/intermediate_dir/src/shared_infile.txt +1 -0
  461. data/ext/gyp/test/intermediate_dir/src/test.gyp +42 -0
  462. data/ext/gyp/test/intermediate_dir/src/test2.gyp +42 -0
  463. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
  464. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
  465. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/LanguageMap.plist +8 -0
  466. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/MainMenu.xib +17 -0
  467. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/Main_iPhone.storyboard +27 -0
  468. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
  469. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/Contents.json +23 -0
  470. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain.png +0 -0
  471. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@2x.png +0 -0
  472. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@3x.png +0 -0
  473. data/ext/gyp/test/ios/app-bundle/TestApp/TestApp-Info.plist +28 -0
  474. data/ext/gyp/test/ios/app-bundle/TestApp/check_no_signature.py +13 -0
  475. data/ext/gyp/test/ios/app-bundle/TestApp/main.m +13 -0
  476. data/ext/gyp/test/ios/app-bundle/TestApp/only-compile-in-32-bits.m +7 -0
  477. data/ext/gyp/test/ios/app-bundle/TestApp/only-compile-in-64-bits.m +7 -0
  478. data/ext/gyp/test/ios/app-bundle/test-archs.gyp +109 -0
  479. data/ext/gyp/test/ios/app-bundle/test-assets-catalog.gyp +45 -0
  480. data/ext/gyp/test/ios/app-bundle/test-crosscompile.gyp +47 -0
  481. data/ext/gyp/test/ios/app-bundle/test-device.gyp +109 -0
  482. data/ext/gyp/test/ios/app-bundle/test.gyp +75 -0
  483. data/ext/gyp/test/ios/app-bundle/tool_main.cc +7 -0
  484. data/ext/gyp/test/ios/copies-with-xcode-envvars/Info.plist +24 -0
  485. data/ext/gyp/test/ios/copies-with-xcode-envvars/copies-with-xcode-envvars.gyp +97 -0
  486. data/ext/gyp/test/ios/copies-with-xcode-envvars/empty.c +1 -0
  487. data/ext/gyp/test/ios/copies-with-xcode-envvars/file0 +1 -0
  488. data/ext/gyp/test/ios/copies-with-xcode-envvars/file1 +1 -0
  489. data/ext/gyp/test/ios/copies-with-xcode-envvars/file10 +1 -0
  490. data/ext/gyp/test/ios/copies-with-xcode-envvars/file11 +1 -0
  491. data/ext/gyp/test/ios/copies-with-xcode-envvars/file2 +1 -0
  492. data/ext/gyp/test/ios/copies-with-xcode-envvars/file3 +1 -0
  493. data/ext/gyp/test/ios/copies-with-xcode-envvars/file4 +1 -0
  494. data/ext/gyp/test/ios/copies-with-xcode-envvars/file5 +1 -0
  495. data/ext/gyp/test/ios/copies-with-xcode-envvars/file6 +1 -0
  496. data/ext/gyp/test/ios/copies-with-xcode-envvars/file7 +1 -0
  497. data/ext/gyp/test/ios/copies-with-xcode-envvars/file8 +1 -0
  498. data/ext/gyp/test/ios/copies-with-xcode-envvars/file9 +1 -0
  499. data/ext/gyp/test/ios/deployment-target/check-version-min.c +33 -0
  500. data/ext/gyp/test/ios/deployment-target/deployment-target.gyp +34 -0
  501. data/ext/gyp/test/ios/extension/ActionExtension/ActionViewController.h +9 -0
  502. data/ext/gyp/test/ios/extension/ActionExtension/ActionViewController.m +31 -0
  503. data/ext/gyp/test/ios/extension/ActionExtension/Info.plist +42 -0
  504. data/ext/gyp/test/ios/extension/ActionExtension/MainInterface.storyboard +63 -0
  505. data/ext/gyp/test/ios/extension/ExtensionContainer/AppDelegate.h +12 -0
  506. data/ext/gyp/test/ios/extension/ExtensionContainer/AppDelegate.m +19 -0
  507. data/ext/gyp/test/ios/extension/ExtensionContainer/Base.lproj/Main.storyboard +25 -0
  508. data/ext/gyp/test/ios/extension/ExtensionContainer/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  509. data/ext/gyp/test/ios/extension/ExtensionContainer/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
  510. data/ext/gyp/test/ios/extension/ExtensionContainer/Info.plist +32 -0
  511. data/ext/gyp/test/ios/extension/ExtensionContainer/ViewController.h +11 -0
  512. data/ext/gyp/test/ios/extension/ExtensionContainer/ViewController.m +24 -0
  513. data/ext/gyp/test/ios/extension/ExtensionContainer/main.m +13 -0
  514. data/ext/gyp/test/ios/extension/extension.gyp +91 -0
  515. data/ext/gyp/test/ios/framework/framework.gyp +43 -0
  516. data/ext/gyp/test/ios/framework/iOSFramework/Info.plist +26 -0
  517. data/ext/gyp/test/ios/framework/iOSFramework/Thing.h +10 -0
  518. data/ext/gyp/test/ios/framework/iOSFramework/Thing.m +22 -0
  519. data/ext/gyp/test/ios/framework/iOSFramework/iOSFramework.h +9 -0
  520. data/ext/gyp/test/ios/gyptest-app-ios-assets-catalog.py +57 -0
  521. data/ext/gyp/test/ios/gyptest-app-ios.py +76 -0
  522. data/ext/gyp/test/ios/gyptest-archs.py +62 -0
  523. data/ext/gyp/test/ios/gyptest-copies-with-xcode-envvars.py +65 -0
  524. data/ext/gyp/test/ios/gyptest-crosscompile.py +34 -0
  525. data/ext/gyp/test/ios/gyptest-deployment-target.py +23 -0
  526. data/ext/gyp/test/ios/gyptest-extension.py +51 -0
  527. data/ext/gyp/test/ios/gyptest-framework.py +37 -0
  528. data/ext/gyp/test/ios/gyptest-per-config-settings.py +190 -0
  529. data/ext/gyp/test/ios/gyptest-watch.py +44 -0
  530. data/ext/gyp/test/ios/gyptest-xcode-ninja.py +25 -0
  531. data/ext/gyp/test/ios/watch/WatchApp/Images.xcassets/AppIcon.appiconset/Contents.json +62 -0
  532. data/ext/gyp/test/ios/watch/WatchApp/Images.xcassets/LaunchImage.launchimage/Contents.json +24 -0
  533. data/ext/gyp/test/ios/watch/WatchApp/Info.plist +35 -0
  534. data/ext/gyp/test/ios/watch/WatchApp/Interface.storyboard +15 -0
  535. data/ext/gyp/test/ios/watch/WatchContainer/AppDelegate.h +12 -0
  536. data/ext/gyp/test/ios/watch/WatchContainer/AppDelegate.m +19 -0
  537. data/ext/gyp/test/ios/watch/WatchContainer/Base.lproj/Main.storyboard +25 -0
  538. data/ext/gyp/test/ios/watch/WatchContainer/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  539. data/ext/gyp/test/ios/watch/WatchContainer/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
  540. data/ext/gyp/test/ios/watch/WatchContainer/Info.plist +32 -0
  541. data/ext/gyp/test/ios/watch/WatchContainer/ViewController.h +11 -0
  542. data/ext/gyp/test/ios/watch/WatchContainer/ViewController.m +24 -0
  543. data/ext/gyp/test/ios/watch/WatchContainer/main.m +13 -0
  544. data/ext/gyp/test/ios/watch/WatchKitExtension/Images.xcassets/MyImage.imageset/Contents.json +20 -0
  545. data/ext/gyp/test/ios/watch/WatchKitExtension/Info.plist +38 -0
  546. data/ext/gyp/test/ios/watch/WatchKitExtension/InterfaceController.h +10 -0
  547. data/ext/gyp/test/ios/watch/WatchKitExtension/InterfaceController.m +25 -0
  548. data/ext/gyp/test/ios/watch/WatchKitExtension/MainInterface.storyboard +63 -0
  549. data/ext/gyp/test/ios/watch/watch.gyp +105 -0
  550. data/ext/gyp/test/ios/xctests/App/AppDelegate.h +11 -0
  551. data/ext/gyp/test/ios/xctests/App/AppDelegate.m +18 -0
  552. data/ext/gyp/test/ios/xctests/App/Base.lproj/LaunchScreen.xib +41 -0
  553. data/ext/gyp/test/ios/xctests/App/Base.lproj/Main.storyboard +25 -0
  554. data/ext/gyp/test/ios/xctests/App/Images.xcassets/AppIcon.appiconset/Contents.json +68 -0
  555. data/ext/gyp/test/ios/xctests/App/Info.plist +47 -0
  556. data/ext/gyp/test/ios/xctests/App/ViewController.h +9 -0
  557. data/ext/gyp/test/ios/xctests/App/ViewController.m +21 -0
  558. data/ext/gyp/test/ios/xctests/App/main.m +13 -0
  559. data/ext/gyp/test/ios/xctests/AppTests/AppTests.m +31 -0
  560. data/ext/gyp/test/ios/xctests/AppTests/Info.plist +24 -0
  561. data/ext/gyp/test/ios/xctests/gyptest-xctests.py +49 -0
  562. data/ext/gyp/test/ios/xctests/xctests.gyp +74 -0
  563. data/ext/gyp/test/lib/README.txt +17 -0
  564. data/ext/gyp/test/lib/TestCmd.py +1597 -0
  565. data/ext/gyp/test/lib/TestCommon.py +591 -0
  566. data/ext/gyp/test/lib/TestGyp.py +1259 -0
  567. data/ext/gyp/test/lib/TestMac.py +76 -0
  568. data/ext/gyp/test/lib/TestWin.py +101 -0
  569. data/ext/gyp/test/library/gyptest-shared-obj-install-path.py +39 -0
  570. data/ext/gyp/test/library/gyptest-shared.py +84 -0
  571. data/ext/gyp/test/library/gyptest-static.py +84 -0
  572. data/ext/gyp/test/library/src/lib1.c +10 -0
  573. data/ext/gyp/test/library/src/lib1_moveable.c +10 -0
  574. data/ext/gyp/test/library/src/lib2.c +10 -0
  575. data/ext/gyp/test/library/src/lib2_moveable.c +10 -0
  576. data/ext/gyp/test/library/src/library.gyp +58 -0
  577. data/ext/gyp/test/library/src/program.c +15 -0
  578. data/ext/gyp/test/library/src/shared_dependency.gyp +33 -0
  579. data/ext/gyp/test/library_dirs/gyptest-library-dirs.py +50 -0
  580. data/ext/gyp/test/library_dirs/subdir/README.txt +1 -0
  581. data/ext/gyp/test/library_dirs/subdir/hello.cc +11 -0
  582. data/ext/gyp/test/library_dirs/subdir/mylib.cc +9 -0
  583. data/ext/gyp/test/library_dirs/subdir/mylib.h +12 -0
  584. data/ext/gyp/test/library_dirs/subdir/test-win.gyp +60 -0
  585. data/ext/gyp/test/library_dirs/subdir/test.gyp +68 -0
  586. data/ext/gyp/test/link-dependency/gyptest-link-dependency.py +23 -0
  587. data/ext/gyp/test/link-dependency/main.c +7 -0
  588. data/ext/gyp/test/link-dependency/mymalloc.c +12 -0
  589. data/ext/gyp/test/link-dependency/test.gyp +37 -0
  590. data/ext/gyp/test/link-objects/base.c +6 -0
  591. data/ext/gyp/test/link-objects/extra.c +5 -0
  592. data/ext/gyp/test/link-objects/gyptest-all.py +28 -0
  593. data/ext/gyp/test/link-objects/link-objects.gyp +24 -0
  594. data/ext/gyp/test/linux/gyptest-implicit-rpath.py +48 -0
  595. data/ext/gyp/test/linux/gyptest-ldflags-duplicates.py +22 -0
  596. data/ext/gyp/test/linux/gyptest-ldflags-from-environment.py +45 -0
  597. data/ext/gyp/test/linux/gyptest-target-rpath.py +43 -0
  598. data/ext/gyp/test/linux/implicit-rpath/file.c +1 -0
  599. data/ext/gyp/test/linux/implicit-rpath/main.c +1 -0
  600. data/ext/gyp/test/linux/implicit-rpath/test.gyp +47 -0
  601. data/ext/gyp/test/linux/ldflags-duplicates/check-ldflags.py +28 -0
  602. data/ext/gyp/test/linux/ldflags-duplicates/lib1.c +6 -0
  603. data/ext/gyp/test/linux/ldflags-duplicates/lib2.c +6 -0
  604. data/ext/gyp/test/linux/ldflags-duplicates/main.c +7 -0
  605. data/ext/gyp/test/linux/ldflags-duplicates/test.gyp +45 -0
  606. data/ext/gyp/test/linux/ldflags-from-environment/main.c +7 -0
  607. data/ext/gyp/test/linux/ldflags-from-environment/test.gyp +23 -0
  608. data/ext/gyp/test/linux/target-rpath/file.c +1 -0
  609. data/ext/gyp/test/linux/target-rpath/main.c +1 -0
  610. data/ext/gyp/test/linux/target-rpath/test.gyp +47 -0
  611. data/ext/gyp/test/mac/action-envvars/action/action.gyp +34 -0
  612. data/ext/gyp/test/mac/action-envvars/action/action.sh +8 -0
  613. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
  614. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
  615. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/MainMenu.xib +4119 -0
  616. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16be.strings +0 -0
  617. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16le.strings +0 -0
  618. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
  619. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/Contents.json +23 -0
  620. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain.png +0 -0
  621. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@2x.png +0 -0
  622. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@3x.png +0 -0
  623. data/ext/gyp/test/mac/app-bundle/TestApp/TestApp-Info.plist +34 -0
  624. data/ext/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.h +13 -0
  625. data/ext/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.m +15 -0
  626. data/ext/gyp/test/mac/app-bundle/TestApp/main.m +10 -0
  627. data/ext/gyp/test/mac/app-bundle/empty.c +0 -0
  628. data/ext/gyp/test/mac/app-bundle/test-assets-catalog.gyp +43 -0
  629. data/ext/gyp/test/mac/app-bundle/test-error.gyp +31 -0
  630. data/ext/gyp/test/mac/app-bundle/test.gyp +41 -0
  631. data/ext/gyp/test/mac/archs/empty_main.cc +1 -0
  632. data/ext/gyp/test/mac/archs/file.mm +1 -0
  633. data/ext/gyp/test/mac/archs/file_a.cc +8 -0
  634. data/ext/gyp/test/mac/archs/file_a.h +10 -0
  635. data/ext/gyp/test/mac/archs/file_b.cc +8 -0
  636. data/ext/gyp/test/mac/archs/file_b.h +10 -0
  637. data/ext/gyp/test/mac/archs/file_c.cc +11 -0
  638. data/ext/gyp/test/mac/archs/file_d.cc +11 -0
  639. data/ext/gyp/test/mac/archs/header.h +1 -0
  640. data/ext/gyp/test/mac/archs/my_file.cc +4 -0
  641. data/ext/gyp/test/mac/archs/my_main_file.cc +9 -0
  642. data/ext/gyp/test/mac/archs/test-archs-multiarch.gyp +92 -0
  643. data/ext/gyp/test/mac/archs/test-archs-x86_64.gyp +27 -0
  644. data/ext/gyp/test/mac/archs/test-dependencies.gyp +92 -0
  645. data/ext/gyp/test/mac/archs/test-no-archs.gyp +21 -0
  646. data/ext/gyp/test/mac/archs/test-valid-archs.gyp +28 -0
  647. data/ext/gyp/test/mac/bundle-resources/change.sh +3 -0
  648. data/ext/gyp/test/mac/bundle-resources/executable-file.sh +3 -0
  649. data/ext/gyp/test/mac/bundle-resources/secret.txt +1 -0
  650. data/ext/gyp/test/mac/bundle-resources/test.gyp +59 -0
  651. data/ext/gyp/test/mac/cflags/ccfile.cc +7 -0
  652. data/ext/gyp/test/mac/cflags/ccfile_withcflags.cc +7 -0
  653. data/ext/gyp/test/mac/cflags/cfile.c +7 -0
  654. data/ext/gyp/test/mac/cflags/cppfile.cpp +7 -0
  655. data/ext/gyp/test/mac/cflags/cppfile_withcflags.cpp +7 -0
  656. data/ext/gyp/test/mac/cflags/cxxfile.cxx +7 -0
  657. data/ext/gyp/test/mac/cflags/cxxfile_withcflags.cxx +7 -0
  658. data/ext/gyp/test/mac/cflags/mfile.m +7 -0
  659. data/ext/gyp/test/mac/cflags/mmfile.mm +7 -0
  660. data/ext/gyp/test/mac/cflags/mmfile_withcflags.mm +7 -0
  661. data/ext/gyp/test/mac/cflags/test.gyp +132 -0
  662. data/ext/gyp/test/mac/clang-cxx-language-standard/c++11.cc +8 -0
  663. data/ext/gyp/test/mac/clang-cxx-language-standard/c++98.cc +24 -0
  664. data/ext/gyp/test/mac/clang-cxx-language-standard/clang-cxx-language-standard.gyp +30 -0
  665. data/ext/gyp/test/mac/clang-cxx-library/clang-cxx-library.gyp +32 -0
  666. data/ext/gyp/test/mac/clang-cxx-library/libc++.cc +11 -0
  667. data/ext/gyp/test/mac/clang-cxx-library/libstdc++.cc +11 -0
  668. data/ext/gyp/test/mac/copies-with-xcode-envvars/copies-with-xcode-envvars.gyp +87 -0
  669. data/ext/gyp/test/mac/copies-with-xcode-envvars/empty.c +1 -0
  670. data/ext/gyp/test/mac/copies-with-xcode-envvars/file0 +1 -0
  671. data/ext/gyp/test/mac/copies-with-xcode-envvars/file1 +1 -0
  672. data/ext/gyp/test/mac/copies-with-xcode-envvars/file10 +1 -0
  673. data/ext/gyp/test/mac/copies-with-xcode-envvars/file11 +1 -0
  674. data/ext/gyp/test/mac/copies-with-xcode-envvars/file2 +1 -0
  675. data/ext/gyp/test/mac/copies-with-xcode-envvars/file3 +1 -0
  676. data/ext/gyp/test/mac/copies-with-xcode-envvars/file4 +1 -0
  677. data/ext/gyp/test/mac/copies-with-xcode-envvars/file5 +1 -0
  678. data/ext/gyp/test/mac/copies-with-xcode-envvars/file6 +1 -0
  679. data/ext/gyp/test/mac/copies-with-xcode-envvars/file7 +1 -0
  680. data/ext/gyp/test/mac/copies-with-xcode-envvars/file8 +1 -0
  681. data/ext/gyp/test/mac/copies-with-xcode-envvars/file9 +1 -0
  682. data/ext/gyp/test/mac/copy-dylib/empty.c +1 -0
  683. data/ext/gyp/test/mac/copy-dylib/test.gyp +31 -0
  684. data/ext/gyp/test/mac/debuginfo/file.c +6 -0
  685. data/ext/gyp/test/mac/debuginfo/test.gyp +82 -0
  686. data/ext/gyp/test/mac/depend-on-bundle/English.lproj/InfoPlist.strings +1 -0
  687. data/ext/gyp/test/mac/depend-on-bundle/Info.plist +28 -0
  688. data/ext/gyp/test/mac/depend-on-bundle/bundle.c +1 -0
  689. data/ext/gyp/test/mac/depend-on-bundle/executable.c +4 -0
  690. data/ext/gyp/test/mac/depend-on-bundle/test.gyp +28 -0
  691. data/ext/gyp/test/mac/deployment-target/check-version-min.c +33 -0
  692. data/ext/gyp/test/mac/deployment-target/deployment-target.gyp +28 -0
  693. data/ext/gyp/test/mac/framework/TestFramework/English.lproj/InfoPlist.strings +2 -0
  694. data/ext/gyp/test/mac/framework/TestFramework/Info.plist +28 -0
  695. data/ext/gyp/test/mac/framework/TestFramework/ObjCVector.h +28 -0
  696. data/ext/gyp/test/mac/framework/TestFramework/ObjCVector.mm +63 -0
  697. data/ext/gyp/test/mac/framework/TestFramework/ObjCVectorInternal.h +9 -0
  698. data/ext/gyp/test/mac/framework/TestFramework/TestFramework_Prefix.pch +7 -0
  699. data/ext/gyp/test/mac/framework/empty.c +0 -0
  700. data/ext/gyp/test/mac/framework/framework.gyp +108 -0
  701. data/ext/gyp/test/mac/framework-dirs/calculate.c +15 -0
  702. data/ext/gyp/test/mac/framework-dirs/framework-dirs.gyp +21 -0
  703. data/ext/gyp/test/mac/framework-headers/myframework.h +8 -0
  704. data/ext/gyp/test/mac/framework-headers/myframework.m +8 -0
  705. data/ext/gyp/test/mac/framework-headers/test.gyp +44 -0
  706. data/ext/gyp/test/mac/global-settings/src/dir1/dir1.gyp +11 -0
  707. data/ext/gyp/test/mac/global-settings/src/dir2/dir2.gyp +22 -0
  708. data/ext/gyp/test/mac/global-settings/src/dir2/file.txt +1 -0
  709. data/ext/gyp/test/mac/gyptest-action-envvars.py +36 -0
  710. data/ext/gyp/test/mac/gyptest-app-assets-catalog.py +125 -0
  711. data/ext/gyp/test/mac/gyptest-app-error.py +49 -0
  712. data/ext/gyp/test/mac/gyptest-app.py +122 -0
  713. data/ext/gyp/test/mac/gyptest-archs.py +96 -0
  714. data/ext/gyp/test/mac/gyptest-bundle-resources.py +64 -0
  715. data/ext/gyp/test/mac/gyptest-cflags.py +21 -0
  716. data/ext/gyp/test/mac/gyptest-clang-cxx-language-standard.py +25 -0
  717. data/ext/gyp/test/mac/gyptest-clang-cxx-library.py +32 -0
  718. data/ext/gyp/test/mac/gyptest-copies-with-xcode-envvars.py +65 -0
  719. data/ext/gyp/test/mac/gyptest-copies.py +62 -0
  720. data/ext/gyp/test/mac/gyptest-copy-dylib.py +25 -0
  721. data/ext/gyp/test/mac/gyptest-debuginfo.py +36 -0
  722. data/ext/gyp/test/mac/gyptest-depend-on-bundle.py +45 -0
  723. data/ext/gyp/test/mac/gyptest-deployment-target.py +27 -0
  724. data/ext/gyp/test/mac/gyptest-framework-dirs.py +23 -0
  725. data/ext/gyp/test/mac/gyptest-framework-headers.py +38 -0
  726. data/ext/gyp/test/mac/gyptest-framework.py +80 -0
  727. data/ext/gyp/test/mac/gyptest-global-settings.py +33 -0
  728. data/ext/gyp/test/mac/gyptest-identical-name.py +45 -0
  729. data/ext/gyp/test/mac/gyptest-infoplist-process.py +56 -0
  730. data/ext/gyp/test/mac/gyptest-installname.py +85 -0
  731. data/ext/gyp/test/mac/gyptest-kext.py +27 -0
  732. data/ext/gyp/test/mac/gyptest-ldflags-passed-to-libtool.py +37 -0
  733. data/ext/gyp/test/mac/gyptest-ldflags.py +74 -0
  734. data/ext/gyp/test/mac/gyptest-libraries.py +30 -0
  735. data/ext/gyp/test/mac/gyptest-libtool-zero.py +26 -0
  736. data/ext/gyp/test/mac/gyptest-loadable-module-bundle-product-extension.py +31 -0
  737. data/ext/gyp/test/mac/gyptest-loadable-module.py +54 -0
  738. data/ext/gyp/test/mac/gyptest-lto.py +66 -0
  739. data/ext/gyp/test/mac/gyptest-missing-cfbundlesignature.py +34 -0
  740. data/ext/gyp/test/mac/gyptest-non-strs-flattened-to-env.py +38 -0
  741. data/ext/gyp/test/mac/gyptest-objc-arc.py +27 -0
  742. data/ext/gyp/test/mac/gyptest-objc-gc.py +51 -0
  743. data/ext/gyp/test/mac/gyptest-postbuild-copy-bundle.py +75 -0
  744. data/ext/gyp/test/mac/gyptest-postbuild-defaults.py +34 -0
  745. data/ext/gyp/test/mac/gyptest-postbuild-fail.py +71 -0
  746. data/ext/gyp/test/mac/gyptest-postbuild-multiple-configurations.py +26 -0
  747. data/ext/gyp/test/mac/gyptest-postbuild-static-library.py +28 -0
  748. data/ext/gyp/test/mac/gyptest-postbuild.py +53 -0
  749. data/ext/gyp/test/mac/gyptest-prefixheader.py +20 -0
  750. data/ext/gyp/test/mac/gyptest-rebuild.py +46 -0
  751. data/ext/gyp/test/mac/gyptest-rpath.py +50 -0
  752. data/ext/gyp/test/mac/gyptest-sdkroot.py +56 -0
  753. data/ext/gyp/test/mac/gyptest-sourceless-module.py +77 -0
  754. data/ext/gyp/test/mac/gyptest-strip-default.py +97 -0
  755. data/ext/gyp/test/mac/gyptest-strip.py +66 -0
  756. data/ext/gyp/test/mac/gyptest-swift-library.py +67 -0
  757. data/ext/gyp/test/mac/gyptest-type-envvars.py +26 -0
  758. data/ext/gyp/test/mac/gyptest-unicode-settings.py +20 -0
  759. data/ext/gyp/test/mac/gyptest-xcode-env-order.py +95 -0
  760. data/ext/gyp/test/mac/gyptest-xcode-gcc-clang.py +40 -0
  761. data/ext/gyp/test/mac/gyptest-xcode-gcc.py +60 -0
  762. data/ext/gyp/test/mac/gyptest-xcode-support-actions.py +25 -0
  763. data/ext/gyp/test/mac/gyptest-xctest.py +41 -0
  764. data/ext/gyp/test/mac/gyptest-xcuitest.py +39 -0
  765. data/ext/gyp/test/mac/identical-name/proxy/proxy.cc +2 -0
  766. data/ext/gyp/test/mac/identical-name/proxy/proxy.gyp +9 -0
  767. data/ext/gyp/test/mac/identical-name/proxy/testlib/testlib.cc +2 -0
  768. data/ext/gyp/test/mac/identical-name/proxy/testlib/testlib.gyp +8 -0
  769. data/ext/gyp/test/mac/identical-name/test-should-fail.gyp +10 -0
  770. data/ext/gyp/test/mac/identical-name/test.gyp +11 -0
  771. data/ext/gyp/test/mac/identical-name/test.gypi +7 -0
  772. data/ext/gyp/test/mac/identical-name/testlib/main.cc +3 -0
  773. data/ext/gyp/test/mac/identical-name/testlib/testlib.gyp +14 -0
  774. data/ext/gyp/test/mac/identical-name/testlib/void.cc +2 -0
  775. data/ext/gyp/test/mac/infoplist-process/Info.plist +36 -0
  776. data/ext/gyp/test/mac/infoplist-process/main.c +7 -0
  777. data/ext/gyp/test/mac/infoplist-process/test1.gyp +25 -0
  778. data/ext/gyp/test/mac/infoplist-process/test2.gyp +25 -0
  779. data/ext/gyp/test/mac/infoplist-process/test3.gyp +25 -0
  780. data/ext/gyp/test/mac/installname/Info.plist +28 -0
  781. data/ext/gyp/test/mac/installname/file.c +1 -0
  782. data/ext/gyp/test/mac/installname/main.c +1 -0
  783. data/ext/gyp/test/mac/installname/test.gyp +93 -0
  784. data/ext/gyp/test/mac/kext/GypKext/GypKext-Info.plist +35 -0
  785. data/ext/gyp/test/mac/kext/GypKext/GypKext.c +16 -0
  786. data/ext/gyp/test/mac/kext/kext.gyp +18 -0
  787. data/ext/gyp/test/mac/ldflags/subdirectory/Info.plist +8 -0
  788. data/ext/gyp/test/mac/ldflags/subdirectory/file.c +2 -0
  789. data/ext/gyp/test/mac/ldflags/subdirectory/symbol_list.def +1 -0
  790. data/ext/gyp/test/mac/ldflags/subdirectory/test.gyp +66 -0
  791. data/ext/gyp/test/mac/ldflags-libtool/file.c +1 -0
  792. data/ext/gyp/test/mac/ldflags-libtool/test.gyp +17 -0
  793. data/ext/gyp/test/mac/libraries/subdir/README.txt +1 -0
  794. data/ext/gyp/test/mac/libraries/subdir/hello.cc +10 -0
  795. data/ext/gyp/test/mac/libraries/subdir/mylib.c +7 -0
  796. data/ext/gyp/test/mac/libraries/subdir/test.gyp +65 -0
  797. data/ext/gyp/test/mac/libtool-zero/mylib.c +7 -0
  798. data/ext/gyp/test/mac/libtool-zero/test.gyp +18 -0
  799. data/ext/gyp/test/mac/loadable-module/Info.plist +26 -0
  800. data/ext/gyp/test/mac/loadable-module/module.c +11 -0
  801. data/ext/gyp/test/mac/loadable-module/test.gyp +18 -0
  802. data/ext/gyp/test/mac/loadable-module-bundle-product-extension/src.cc +7 -0
  803. data/ext/gyp/test/mac/loadable-module-bundle-product-extension/test.gyp +24 -0
  804. data/ext/gyp/test/mac/lto/asmfile.S +2 -0
  805. data/ext/gyp/test/mac/lto/ccfile.cc +1 -0
  806. data/ext/gyp/test/mac/lto/cfile.c +1 -0
  807. data/ext/gyp/test/mac/lto/mfile.m +1 -0
  808. data/ext/gyp/test/mac/lto/mmfile.mm +1 -0
  809. data/ext/gyp/test/mac/lto/test.gyp +35 -0
  810. data/ext/gyp/test/mac/missing-cfbundlesignature/Info.plist +10 -0
  811. data/ext/gyp/test/mac/missing-cfbundlesignature/Other-Info.plist +12 -0
  812. data/ext/gyp/test/mac/missing-cfbundlesignature/Third-Info.plist +12 -0
  813. data/ext/gyp/test/mac/missing-cfbundlesignature/file.c +1 -0
  814. data/ext/gyp/test/mac/missing-cfbundlesignature/test.gyp +34 -0
  815. data/ext/gyp/test/mac/non-strs-flattened-to-env/Info.plist +15 -0
  816. data/ext/gyp/test/mac/non-strs-flattened-to-env/main.c +7 -0
  817. data/ext/gyp/test/mac/non-strs-flattened-to-env/test.gyp +27 -0
  818. data/ext/gyp/test/mac/objc-arc/c-file.c +5 -0
  819. data/ext/gyp/test/mac/objc-arc/cc-file.cc +5 -0
  820. data/ext/gyp/test/mac/objc-arc/m-file-arc-weak.m +9 -0
  821. data/ext/gyp/test/mac/objc-arc/m-file-no-arc.m +9 -0
  822. data/ext/gyp/test/mac/objc-arc/m-file.m +9 -0
  823. data/ext/gyp/test/mac/objc-arc/mm-file-arc-weak.mm +9 -0
  824. data/ext/gyp/test/mac/objc-arc/mm-file-no-arc.mm +9 -0
  825. data/ext/gyp/test/mac/objc-arc/mm-file.mm +9 -0
  826. data/ext/gyp/test/mac/objc-arc/test.gyp +53 -0
  827. data/ext/gyp/test/mac/objc-gc/c-file.c +1 -0
  828. data/ext/gyp/test/mac/objc-gc/cc-file.cc +1 -0
  829. data/ext/gyp/test/mac/objc-gc/main.m +6 -0
  830. data/ext/gyp/test/mac/objc-gc/needs-gc-mm.mm +1 -0
  831. data/ext/gyp/test/mac/objc-gc/needs-gc.m +1 -0
  832. data/ext/gyp/test/mac/objc-gc/test.gyp +102 -0
  833. data/ext/gyp/test/mac/postbuild-copy-bundle/Framework-Info.plist +30 -0
  834. data/ext/gyp/test/mac/postbuild-copy-bundle/TestApp-Info.plist +32 -0
  835. data/ext/gyp/test/mac/postbuild-copy-bundle/copied.txt +1 -0
  836. data/ext/gyp/test/mac/postbuild-copy-bundle/empty.c +0 -0
  837. data/ext/gyp/test/mac/postbuild-copy-bundle/main.c +4 -0
  838. data/ext/gyp/test/mac/postbuild-copy-bundle/postbuild-copy-framework.sh +9 -0
  839. data/ext/gyp/test/mac/postbuild-copy-bundle/resource_file.sb +1 -0
  840. data/ext/gyp/test/mac/postbuild-copy-bundle/test.gyp +49 -0
  841. data/ext/gyp/test/mac/postbuild-defaults/Info.plist +13 -0
  842. data/ext/gyp/test/mac/postbuild-defaults/main.c +7 -0
  843. data/ext/gyp/test/mac/postbuild-defaults/postbuild-defaults.sh +15 -0
  844. data/ext/gyp/test/mac/postbuild-defaults/test.gyp +26 -0
  845. data/ext/gyp/test/mac/postbuild-fail/file.c +6 -0
  846. data/ext/gyp/test/mac/postbuild-fail/postbuild-fail.sh +6 -0
  847. data/ext/gyp/test/mac/postbuild-fail/test.gyp +38 -0
  848. data/ext/gyp/test/mac/postbuild-fail/touch-dynamic.sh +7 -0
  849. data/ext/gyp/test/mac/postbuild-fail/touch-static.sh +7 -0
  850. data/ext/gyp/test/mac/postbuild-multiple-configurations/main.c +4 -0
  851. data/ext/gyp/test/mac/postbuild-multiple-configurations/postbuild-touch-file.sh +7 -0
  852. data/ext/gyp/test/mac/postbuild-multiple-configurations/test.gyp +26 -0
  853. data/ext/gyp/test/mac/postbuild-static-library/empty.c +4 -0
  854. data/ext/gyp/test/mac/postbuild-static-library/postbuild-touch-file.sh +7 -0
  855. data/ext/gyp/test/mac/postbuild-static-library/test.gyp +34 -0
  856. data/ext/gyp/test/mac/postbuilds/copy.sh +3 -0
  857. data/ext/gyp/test/mac/postbuilds/file.c +4 -0
  858. data/ext/gyp/test/mac/postbuilds/file_g.c +4 -0
  859. data/ext/gyp/test/mac/postbuilds/file_h.c +4 -0
  860. data/ext/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh +23 -0
  861. data/ext/gyp/test/mac/postbuilds/script/static_library_postbuild.sh +23 -0
  862. data/ext/gyp/test/mac/postbuilds/subdirectory/copied_file.txt +1 -0
  863. data/ext/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp +53 -0
  864. data/ext/gyp/test/mac/postbuilds/test.gyp +93 -0
  865. data/ext/gyp/test/mac/prefixheader/file.c +1 -0
  866. data/ext/gyp/test/mac/prefixheader/file.cc +1 -0
  867. data/ext/gyp/test/mac/prefixheader/file.m +1 -0
  868. data/ext/gyp/test/mac/prefixheader/file.mm +1 -0
  869. data/ext/gyp/test/mac/prefixheader/header.h +1 -0
  870. data/ext/gyp/test/mac/prefixheader/test.gyp +82 -0
  871. data/ext/gyp/test/mac/rebuild/TestApp-Info.plist +32 -0
  872. data/ext/gyp/test/mac/rebuild/delay-touch.sh +6 -0
  873. data/ext/gyp/test/mac/rebuild/empty.c +0 -0
  874. data/ext/gyp/test/mac/rebuild/main.c +1 -0
  875. data/ext/gyp/test/mac/rebuild/test.gyp +56 -0
  876. data/ext/gyp/test/mac/rpath/file.c +1 -0
  877. data/ext/gyp/test/mac/rpath/main.c +1 -0
  878. data/ext/gyp/test/mac/rpath/test.gyp +48 -0
  879. data/ext/gyp/test/mac/sdkroot/file.cc +5 -0
  880. data/ext/gyp/test/mac/sdkroot/test.gyp +35 -0
  881. data/ext/gyp/test/mac/sdkroot/test_shorthand.sh +20 -0
  882. data/ext/gyp/test/mac/sourceless-module/empty.c +1 -0
  883. data/ext/gyp/test/mac/sourceless-module/empty.txt +2 -0
  884. data/ext/gyp/test/mac/sourceless-module/fun.c +1 -0
  885. data/ext/gyp/test/mac/sourceless-module/test.gyp +96 -0
  886. data/ext/gyp/test/mac/strip/file.c +22 -0
  887. data/ext/gyp/test/mac/strip/main.c +25 -0
  888. data/ext/gyp/test/mac/strip/strip.saves +5 -0
  889. data/ext/gyp/test/mac/strip/subdirectory/nested_file.c +1 -0
  890. data/ext/gyp/test/mac/strip/subdirectory/nested_strip.saves +5 -0
  891. data/ext/gyp/test/mac/strip/subdirectory/subdirectory.gyp +38 -0
  892. data/ext/gyp/test/mac/strip/subdirectory/test_reading_save_file_from_postbuild.sh +5 -0
  893. data/ext/gyp/test/mac/strip/test-defaults.gyp +51 -0
  894. data/ext/gyp/test/mac/strip/test.gyp +119 -0
  895. data/ext/gyp/test/mac/swift-library/Info.plist +28 -0
  896. data/ext/gyp/test/mac/swift-library/file.swift +9 -0
  897. data/ext/gyp/test/mac/swift-library/test.gyp +21 -0
  898. data/ext/gyp/test/mac/type_envvars/file.c +6 -0
  899. data/ext/gyp/test/mac/type_envvars/test.gyp +100 -0
  900. data/ext/gyp/test/mac/type_envvars/test_bundle_executable.sh +30 -0
  901. data/ext/gyp/test/mac/type_envvars/test_bundle_loadable_module.sh +35 -0
  902. data/ext/gyp/test/mac/type_envvars/test_bundle_shared_library.sh +38 -0
  903. data/ext/gyp/test/mac/type_envvars/test_check_sdkroot.sh +47 -0
  904. data/ext/gyp/test/mac/type_envvars/test_nonbundle_executable.sh +33 -0
  905. data/ext/gyp/test/mac/type_envvars/test_nonbundle_loadable_module.sh +31 -0
  906. data/ext/gyp/test/mac/type_envvars/test_nonbundle_none.sh +32 -0
  907. data/ext/gyp/test/mac/type_envvars/test_nonbundle_shared_library.sh +31 -0
  908. data/ext/gyp/test/mac/type_envvars/test_nonbundle_static_library.sh +31 -0
  909. data/ext/gyp/test/mac/unicode-settings/file.cc +2 -0
  910. data/ext/gyp/test/mac/unicode-settings/test.gyp +23 -0
  911. data/ext/gyp/test/mac/unicode-settings/test_bundle_display_name.sh +7 -0
  912. data/ext/gyp/test/mac/xcode-env-order/Info.plist +56 -0
  913. data/ext/gyp/test/mac/xcode-env-order/file.ext1 +0 -0
  914. data/ext/gyp/test/mac/xcode-env-order/file.ext2 +0 -0
  915. data/ext/gyp/test/mac/xcode-env-order/file.ext3 +0 -0
  916. data/ext/gyp/test/mac/xcode-env-order/main.c +7 -0
  917. data/ext/gyp/test/mac/xcode-env-order/test.gyp +121 -0
  918. data/ext/gyp/test/mac/xcode-gcc/aliasing.cc +13 -0
  919. data/ext/gyp/test/mac/xcode-gcc/test-clang.gyp +42 -0
  920. data/ext/gyp/test/mac/xcode-gcc/test.gyp +60 -0
  921. data/ext/gyp/test/mac/xcode-gcc/valid_c.c +8 -0
  922. data/ext/gyp/test/mac/xcode-gcc/valid_cc.cc +8 -0
  923. data/ext/gyp/test/mac/xcode-gcc/valid_m.m +8 -0
  924. data/ext/gyp/test/mac/xcode-gcc/valid_mm.mm +8 -0
  925. data/ext/gyp/test/mac/xcode-gcc/warn_about_invalid_offsetof_macro.cc +15 -0
  926. data/ext/gyp/test/mac/xcode-gcc/warn_about_missing_newline.c +8 -0
  927. data/ext/gyp/test/mac/xcode-support-actions/source.c +0 -0
  928. data/ext/gyp/test/mac/xcode-support-actions/test.gyp +26 -0
  929. data/ext/gyp/test/mac/xctest/MyClass.h +8 -0
  930. data/ext/gyp/test/mac/xctest/MyClass.m +8 -0
  931. data/ext/gyp/test/mac/xctest/TestCase.m +16 -0
  932. data/ext/gyp/test/mac/xctest/resource.txt +1 -0
  933. data/ext/gyp/test/mac/xctest/test.gyp +47 -0
  934. data/ext/gyp/test/mac/xctest/test.xcodeproj/xcshareddata/xcschemes/classes.xcscheme +69 -0
  935. data/ext/gyp/test/mac/xcuitest/Info.plist +28 -0
  936. data/ext/gyp/test/mac/xcuitest/MyAppDelegate.h +8 -0
  937. data/ext/gyp/test/mac/xcuitest/MyAppDelegate.m +19 -0
  938. data/ext/gyp/test/mac/xcuitest/TestCase.m +15 -0
  939. data/ext/gyp/test/mac/xcuitest/main.m +15 -0
  940. data/ext/gyp/test/mac/xcuitest/resource.txt +1 -0
  941. data/ext/gyp/test/mac/xcuitest/test.gyp +69 -0
  942. data/ext/gyp/test/make/dependencies.gyp +15 -0
  943. data/ext/gyp/test/make/gyptest-dependencies.py +26 -0
  944. data/ext/gyp/test/make/gyptest-noload.py +57 -0
  945. data/ext/gyp/test/make/main.cc +12 -0
  946. data/ext/gyp/test/make/main.h +0 -0
  947. data/ext/gyp/test/make/noload/all.gyp +18 -0
  948. data/ext/gyp/test/make/noload/lib/shared.c +3 -0
  949. data/ext/gyp/test/make/noload/lib/shared.gyp +16 -0
  950. data/ext/gyp/test/make/noload/lib/shared.h +1 -0
  951. data/ext/gyp/test/make/noload/main.c +9 -0
  952. data/ext/gyp/test/make_global_settings/ar/gyptest-make_global_settings_ar.py +126 -0
  953. data/ext/gyp/test/make_global_settings/ar/make_global_settings_ar.gyp +29 -0
  954. data/ext/gyp/test/make_global_settings/basics/gyptest-make_global_settings.py +51 -0
  955. data/ext/gyp/test/make_global_settings/basics/make_global_settings.gyp +17 -0
  956. data/ext/gyp/test/make_global_settings/env-wrapper/gyptest-wrapper.py +51 -0
  957. data/ext/gyp/test/make_global_settings/env-wrapper/wrapper.gyp +17 -0
  958. data/ext/gyp/test/make_global_settings/full-toolchain/bar.cc +1 -0
  959. data/ext/gyp/test/make_global_settings/full-toolchain/foo.c +1 -0
  960. data/ext/gyp/test/make_global_settings/full-toolchain/gyptest-make_global_settings.py +53 -0
  961. data/ext/gyp/test/make_global_settings/full-toolchain/make_global_settings.gyp +22 -0
  962. data/ext/gyp/test/make_global_settings/full-toolchain/my_nm.py +9 -0
  963. data/ext/gyp/test/make_global_settings/full-toolchain/my_readelf.py +9 -0
  964. data/ext/gyp/test/make_global_settings/ld/gyptest-make_global_settings_ld.py +130 -0
  965. data/ext/gyp/test/make_global_settings/ld/make_global_settings_ld.gyp +29 -0
  966. data/ext/gyp/test/make_global_settings/wrapper/gyptest-wrapper.py +52 -0
  967. data/ext/gyp/test/make_global_settings/wrapper/wrapper.gyp +21 -0
  968. data/ext/gyp/test/many-actions/file0 +0 -0
  969. data/ext/gyp/test/many-actions/file1 +0 -0
  970. data/ext/gyp/test/many-actions/file2 +0 -0
  971. data/ext/gyp/test/many-actions/file3 +0 -0
  972. data/ext/gyp/test/many-actions/file4 +0 -0
  973. data/ext/gyp/test/many-actions/gyptest-many-actions-unsorted.py +43 -0
  974. data/ext/gyp/test/many-actions/gyptest-many-actions.py +29 -0
  975. data/ext/gyp/test/many-actions/many-actions-unsorted.gyp +154 -0
  976. data/ext/gyp/test/many-actions/many-actions.gyp +1817 -0
  977. data/ext/gyp/test/module/gyptest-default.py +28 -0
  978. data/ext/gyp/test/module/src/lib1.c +10 -0
  979. data/ext/gyp/test/module/src/lib2.c +10 -0
  980. data/ext/gyp/test/module/src/module.gyp +53 -0
  981. data/ext/gyp/test/module/src/program.c +111 -0
  982. data/ext/gyp/test/msvs/buildevents/buildevents.gyp +14 -0
  983. data/ext/gyp/test/msvs/buildevents/gyptest-msbuild-supports-prepostbuild.py +24 -0
  984. data/ext/gyp/test/msvs/buildevents/gyptest-ninja-warnings.py +29 -0
  985. data/ext/gyp/test/msvs/buildevents/main.cc +5 -0
  986. data/ext/gyp/test/msvs/config_attrs/gyptest-config_attrs.py +41 -0
  987. data/ext/gyp/test/msvs/config_attrs/hello.c +11 -0
  988. data/ext/gyp/test/msvs/config_attrs/hello.gyp +21 -0
  989. data/ext/gyp/test/msvs/express/base/base.gyp +22 -0
  990. data/ext/gyp/test/msvs/express/express.gyp +19 -0
  991. data/ext/gyp/test/msvs/express/gyptest-express.py +29 -0
  992. data/ext/gyp/test/msvs/external_builder/external.gyp +68 -0
  993. data/ext/gyp/test/msvs/external_builder/external_builder.py +9 -0
  994. data/ext/gyp/test/msvs/external_builder/gyptest-all.py +59 -0
  995. data/ext/gyp/test/msvs/external_builder/hello.cpp +10 -0
  996. data/ext/gyp/test/msvs/external_builder/hello.z +6 -0
  997. data/ext/gyp/test/msvs/external_builder/msbuild_action.py +9 -0
  998. data/ext/gyp/test/msvs/external_builder/msbuild_rule.py +11 -0
  999. data/ext/gyp/test/msvs/filters/filters.gyp +47 -0
  1000. data/ext/gyp/test/msvs/filters/gyptest-filters-2008.py +68 -0
  1001. data/ext/gyp/test/msvs/filters/gyptest-filters-2010.py +57 -0
  1002. data/ext/gyp/test/msvs/list_excluded/gyptest-all.py +51 -0
  1003. data/ext/gyp/test/msvs/list_excluded/hello.cpp +10 -0
  1004. data/ext/gyp/test/msvs/list_excluded/hello_exclude.gyp +19 -0
  1005. data/ext/gyp/test/msvs/list_excluded/hello_mac.cpp +10 -0
  1006. data/ext/gyp/test/msvs/missing_sources/gyptest-missing.py +43 -0
  1007. data/ext/gyp/test/msvs/missing_sources/hello_missing.gyp +15 -0
  1008. data/ext/gyp/test/msvs/multiple_actions_error_handling/action_fail.py +7 -0
  1009. data/ext/gyp/test/msvs/multiple_actions_error_handling/action_succeed.py +7 -0
  1010. data/ext/gyp/test/msvs/multiple_actions_error_handling/actions.gyp +40 -0
  1011. data/ext/gyp/test/msvs/multiple_actions_error_handling/gyptest.py +26 -0
  1012. data/ext/gyp/test/msvs/props/AppName.props +14 -0
  1013. data/ext/gyp/test/msvs/props/AppName.vsprops +11 -0
  1014. data/ext/gyp/test/msvs/props/gyptest-props.py +22 -0
  1015. data/ext/gyp/test/msvs/props/hello.c +11 -0
  1016. data/ext/gyp/test/msvs/props/hello.gyp +22 -0
  1017. data/ext/gyp/test/msvs/rules_stdout_stderr/dummy.bar +5 -0
  1018. data/ext/gyp/test/msvs/rules_stdout_stderr/dummy.foo +5 -0
  1019. data/ext/gyp/test/msvs/rules_stdout_stderr/gyptest-rules-stdout-stderr.py +29 -0
  1020. data/ext/gyp/test/msvs/rules_stdout_stderr/rule_stderr.py +8 -0
  1021. data/ext/gyp/test/msvs/rules_stdout_stderr/rule_stdout.py +7 -0
  1022. data/ext/gyp/test/msvs/rules_stdout_stderr/rules-stdout-stderr.gyp +52 -0
  1023. data/ext/gyp/test/msvs/shared_output/common.gypi +17 -0
  1024. data/ext/gyp/test/msvs/shared_output/gyptest-shared_output.py +41 -0
  1025. data/ext/gyp/test/msvs/shared_output/hello.c +12 -0
  1026. data/ext/gyp/test/msvs/shared_output/hello.gyp +21 -0
  1027. data/ext/gyp/test/msvs/shared_output/there/there.c +12 -0
  1028. data/ext/gyp/test/msvs/shared_output/there/there.gyp +16 -0
  1029. data/ext/gyp/test/msvs/uldi2010/gyptest-all.py +20 -0
  1030. data/ext/gyp/test/msvs/uldi2010/hello.c +13 -0
  1031. data/ext/gyp/test/msvs/uldi2010/hello.gyp +26 -0
  1032. data/ext/gyp/test/msvs/uldi2010/hello2.c +10 -0
  1033. data/ext/gyp/test/multiple-targets/gyptest-all.py +30 -0
  1034. data/ext/gyp/test/multiple-targets/gyptest-default.py +30 -0
  1035. data/ext/gyp/test/multiple-targets/src/common.c +7 -0
  1036. data/ext/gyp/test/multiple-targets/src/multiple.gyp +24 -0
  1037. data/ext/gyp/test/multiple-targets/src/prog1.c +10 -0
  1038. data/ext/gyp/test/multiple-targets/src/prog2.c +10 -0
  1039. data/ext/gyp/test/ninja/action-rule-hash/gyptest-action-rule-hash.py +32 -0
  1040. data/ext/gyp/test/ninja/action-rule-hash/subdir/action-rule-hash.gyp +29 -0
  1041. data/ext/gyp/test/ninja/action-rule-hash/subdir/emit.py +13 -0
  1042. data/ext/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py +64 -0
  1043. data/ext/gyp/test/ninja/action_dependencies/src/a.c +10 -0
  1044. data/ext/gyp/test/ninja/action_dependencies/src/a.h +13 -0
  1045. data/ext/gyp/test/ninja/action_dependencies/src/action_dependencies.gyp +88 -0
  1046. data/ext/gyp/test/ninja/action_dependencies/src/b.c +18 -0
  1047. data/ext/gyp/test/ninja/action_dependencies/src/b.h +13 -0
  1048. data/ext/gyp/test/ninja/action_dependencies/src/c.c +10 -0
  1049. data/ext/gyp/test/ninja/action_dependencies/src/c.h +13 -0
  1050. data/ext/gyp/test/ninja/action_dependencies/src/emit.py +11 -0
  1051. data/ext/gyp/test/ninja/chained-dependency/chained-dependency.gyp +53 -0
  1052. data/ext/gyp/test/ninja/chained-dependency/chained.c +5 -0
  1053. data/ext/gyp/test/ninja/chained-dependency/gyptest-chained-dependency.py +30 -0
  1054. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/gyptest-empty-and-non-empty-duplicate-name.py +23 -0
  1055. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/subdir/included.gyp +19 -0
  1056. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/test.gyp +19 -0
  1057. data/ext/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py +46 -0
  1058. data/ext/gyp/test/ninja/normalize-paths-win/hello.cc +7 -0
  1059. data/ext/gyp/test/ninja/normalize-paths-win/normalize-paths.gyp +68 -0
  1060. data/ext/gyp/test/ninja/s-needs-no-depfiles/empty.s +1 -0
  1061. data/ext/gyp/test/ninja/s-needs-no-depfiles/gyptest-s-needs-no-depfiles.py +42 -0
  1062. data/ext/gyp/test/ninja/s-needs-no-depfiles/s-needs-no-depfiles.gyp +13 -0
  1063. data/ext/gyp/test/ninja/solibs_avoid_relinking/gyptest-solibs-avoid-relinking.py +48 -0
  1064. data/ext/gyp/test/ninja/solibs_avoid_relinking/main.cc +5 -0
  1065. data/ext/gyp/test/ninja/solibs_avoid_relinking/solib.cc +8 -0
  1066. data/ext/gyp/test/ninja/solibs_avoid_relinking/solibs_avoid_relinking.gyp +38 -0
  1067. data/ext/gyp/test/ninja/use-console/foo.bar +5 -0
  1068. data/ext/gyp/test/ninja/use-console/gyptest-use-console.py +29 -0
  1069. data/ext/gyp/test/ninja/use-console/use-console.gyp +60 -0
  1070. data/ext/gyp/test/ninja/use-custom-environment-files/gyptest-use-custom-environment-files.py +28 -0
  1071. data/ext/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.cc +7 -0
  1072. data/ext/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.gyp +15 -0
  1073. data/ext/gyp/test/no-cpp/gyptest-no-cpp.py +53 -0
  1074. data/ext/gyp/test/no-cpp/src/call-f-main.c +2 -0
  1075. data/ext/gyp/test/no-cpp/src/empty-main.c +1 -0
  1076. data/ext/gyp/test/no-cpp/src/f.cc +3 -0
  1077. data/ext/gyp/test/no-cpp/src/test.gyp +25 -0
  1078. data/ext/gyp/test/no-output/gyptest-no-output.py +21 -0
  1079. data/ext/gyp/test/no-output/src/nooutput.gyp +17 -0
  1080. data/ext/gyp/test/product/gyptest-product.py +43 -0
  1081. data/ext/gyp/test/product/hello.c +15 -0
  1082. data/ext/gyp/test/product/product.gyp +128 -0
  1083. data/ext/gyp/test/prune_targets/gyptest-prune-targets.py +66 -0
  1084. data/ext/gyp/test/prune_targets/lib1.cc +6 -0
  1085. data/ext/gyp/test/prune_targets/lib2.cc +6 -0
  1086. data/ext/gyp/test/prune_targets/lib3.cc +6 -0
  1087. data/ext/gyp/test/prune_targets/lib_indirect.cc +6 -0
  1088. data/ext/gyp/test/prune_targets/program.cc +7 -0
  1089. data/ext/gyp/test/prune_targets/test1.gyp +26 -0
  1090. data/ext/gyp/test/prune_targets/test2.gyp +30 -0
  1091. data/ext/gyp/test/relative/foo/a/a.cc +9 -0
  1092. data/ext/gyp/test/relative/foo/a/a.gyp +13 -0
  1093. data/ext/gyp/test/relative/foo/a/c/c.cc +9 -0
  1094. data/ext/gyp/test/relative/foo/a/c/c.gyp +12 -0
  1095. data/ext/gyp/test/relative/foo/b/b.cc +9 -0
  1096. data/ext/gyp/test/relative/foo/b/b.gyp +9 -0
  1097. data/ext/gyp/test/relative/gyptest-default.py +25 -0
  1098. data/ext/gyp/test/rename/filecase/file.c +1 -0
  1099. data/ext/gyp/test/rename/filecase/test-casesensitive.gyp +15 -0
  1100. data/ext/gyp/test/rename/filecase/test.gyp +14 -0
  1101. data/ext/gyp/test/rename/gyptest-filecase.py +35 -0
  1102. data/ext/gyp/test/restat/gyptest-restat.py +31 -0
  1103. data/ext/gyp/test/restat/src/create_intermediate.py +17 -0
  1104. data/ext/gyp/test/restat/src/restat.gyp +50 -0
  1105. data/ext/gyp/test/restat/src/touch.py +16 -0
  1106. data/ext/gyp/test/rules/gyptest-all.py +84 -0
  1107. data/ext/gyp/test/rules/gyptest-default.py +70 -0
  1108. data/ext/gyp/test/rules/gyptest-input-root.py +26 -0
  1109. data/ext/gyp/test/rules/gyptest-special-variables.py +18 -0
  1110. data/ext/gyp/test/rules/src/actions.gyp +23 -0
  1111. data/ext/gyp/test/rules/src/an_asm.S +6 -0
  1112. data/ext/gyp/test/rules/src/as.bat +7 -0
  1113. data/ext/gyp/test/rules/src/copy-file.py +11 -0
  1114. data/ext/gyp/test/rules/src/external/external.gyp +66 -0
  1115. data/ext/gyp/test/rules/src/external/file1.in +1 -0
  1116. data/ext/gyp/test/rules/src/external/file2.in +1 -0
  1117. data/ext/gyp/test/rules/src/input-root.gyp +24 -0
  1118. data/ext/gyp/test/rules/src/noaction/file1.in +1 -0
  1119. data/ext/gyp/test/rules/src/noaction/no_action_with_rules_fails.gyp +37 -0
  1120. data/ext/gyp/test/rules/src/rule.py +17 -0
  1121. data/ext/gyp/test/rules/src/somefile.ext +0 -0
  1122. data/ext/gyp/test/rules/src/special-variables.gyp +34 -0
  1123. data/ext/gyp/test/rules/src/subdir1/executable.gyp +37 -0
  1124. data/ext/gyp/test/rules/src/subdir1/function1.in +6 -0
  1125. data/ext/gyp/test/rules/src/subdir1/function2.in +6 -0
  1126. data/ext/gyp/test/rules/src/subdir1/program.c +12 -0
  1127. data/ext/gyp/test/rules/src/subdir2/both_rule_and_action_input.gyp +50 -0
  1128. data/ext/gyp/test/rules/src/subdir2/file1.in +1 -0
  1129. data/ext/gyp/test/rules/src/subdir2/file2.in +1 -0
  1130. data/ext/gyp/test/rules/src/subdir2/never_used.gyp +31 -0
  1131. data/ext/gyp/test/rules/src/subdir2/no_action.gyp +38 -0
  1132. data/ext/gyp/test/rules/src/subdir2/no_inputs.gyp +32 -0
  1133. data/ext/gyp/test/rules/src/subdir2/none.gyp +33 -0
  1134. data/ext/gyp/test/rules/src/subdir2/program.c +12 -0
  1135. data/ext/gyp/test/rules/src/subdir3/executable2.gyp +37 -0
  1136. data/ext/gyp/test/rules/src/subdir3/function3.in +6 -0
  1137. data/ext/gyp/test/rules/src/subdir3/program.c +10 -0
  1138. data/ext/gyp/test/rules/src/subdir4/asm-function.assem +10 -0
  1139. data/ext/gyp/test/rules/src/subdir4/build-asm.gyp +49 -0
  1140. data/ext/gyp/test/rules/src/subdir4/program.c +19 -0
  1141. data/ext/gyp/test/rules-dirname/gyptest-dirname.py +57 -0
  1142. data/ext/gyp/test/rules-dirname/src/actions.gyp +15 -0
  1143. data/ext/gyp/test/rules-dirname/src/copy-file.py +11 -0
  1144. data/ext/gyp/test/rules-dirname/src/subdir/a/b/c.gencc +8 -0
  1145. data/ext/gyp/test/rules-dirname/src/subdir/a/b/c.printvars +1 -0
  1146. data/ext/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc +8 -0
  1147. data/ext/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars +1 -0
  1148. data/ext/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp +140 -0
  1149. data/ext/gyp/test/rules-dirname/src/subdir/main.cc +14 -0
  1150. data/ext/gyp/test/rules-dirname/src/subdir/nodir.gencc +8 -0
  1151. data/ext/gyp/test/rules-dirname/src/subdir/printvars.py +14 -0
  1152. data/ext/gyp/test/rules-rebuild/gyptest-all.py +70 -0
  1153. data/ext/gyp/test/rules-rebuild/gyptest-default.py +91 -0
  1154. data/ext/gyp/test/rules-rebuild/src/main.c +12 -0
  1155. data/ext/gyp/test/rules-rebuild/src/make-sources.py +19 -0
  1156. data/ext/gyp/test/rules-rebuild/src/prog1.in +7 -0
  1157. data/ext/gyp/test/rules-rebuild/src/prog2.in +7 -0
  1158. data/ext/gyp/test/rules-rebuild/src/same_target.gyp +31 -0
  1159. data/ext/gyp/test/rules-use-built-dependencies/gyptest-use-built-dependencies.py +23 -0
  1160. data/ext/gyp/test/rules-use-built-dependencies/src/main.cc +17 -0
  1161. data/ext/gyp/test/rules-use-built-dependencies/src/use-built-dependencies-rule.gyp +42 -0
  1162. data/ext/gyp/test/rules-variables/gyptest-rules-variables.py +35 -0
  1163. data/ext/gyp/test/rules-variables/src/input_ext.c +9 -0
  1164. data/ext/gyp/test/rules-variables/src/input_name/test.c +9 -0
  1165. data/ext/gyp/test/rules-variables/src/input_path/subdir/test.c +9 -0
  1166. data/ext/gyp/test/rules-variables/src/subdir/input_dirname.c +9 -0
  1167. data/ext/gyp/test/rules-variables/src/subdir/test.c +18 -0
  1168. data/ext/gyp/test/rules-variables/src/test.input_root.c +9 -0
  1169. data/ext/gyp/test/rules-variables/src/variables.gyp +40 -0
  1170. data/ext/gyp/test/same-gyp-name/gyptest-all.py +38 -0
  1171. data/ext/gyp/test/same-gyp-name/gyptest-default.py +38 -0
  1172. data/ext/gyp/test/same-gyp-name/gyptest-library.py +20 -0
  1173. data/ext/gyp/test/same-gyp-name/library/one/sub.gyp +11 -0
  1174. data/ext/gyp/test/same-gyp-name/library/test.gyp +15 -0
  1175. data/ext/gyp/test/same-gyp-name/library/two/sub.gyp +11 -0
  1176. data/ext/gyp/test/same-gyp-name/src/all.gyp +16 -0
  1177. data/ext/gyp/test/same-gyp-name/src/subdir1/executable.gyp +15 -0
  1178. data/ext/gyp/test/same-gyp-name/src/subdir1/main1.cc +6 -0
  1179. data/ext/gyp/test/same-gyp-name/src/subdir2/executable.gyp +15 -0
  1180. data/ext/gyp/test/same-gyp-name/src/subdir2/main2.cc +6 -0
  1181. data/ext/gyp/test/same-rule-output-file-name/gyptest-all.py +23 -0
  1182. data/ext/gyp/test/same-rule-output-file-name/src/subdir1/subdir1.gyp +30 -0
  1183. data/ext/gyp/test/same-rule-output-file-name/src/subdir2/subdir2.gyp +30 -0
  1184. data/ext/gyp/test/same-rule-output-file-name/src/subdirs.gyp +16 -0
  1185. data/ext/gyp/test/same-rule-output-file-name/src/touch.py +11 -0
  1186. data/ext/gyp/test/same-source-file-name/gyptest-all.py +34 -0
  1187. data/ext/gyp/test/same-source-file-name/gyptest-default.py +34 -0
  1188. data/ext/gyp/test/same-source-file-name/gyptest-pass-executable.py +33 -0
  1189. data/ext/gyp/test/same-source-file-name/gyptest-pass-shared.py +18 -0
  1190. data/ext/gyp/test/same-source-file-name/gyptest-static.py +34 -0
  1191. data/ext/gyp/test/same-source-file-name/src/all.gyp +30 -0
  1192. data/ext/gyp/test/same-source-file-name/src/double-executable.gyp +21 -0
  1193. data/ext/gyp/test/same-source-file-name/src/double-shared.gyp +27 -0
  1194. data/ext/gyp/test/same-source-file-name/src/double-static.gyp +22 -0
  1195. data/ext/gyp/test/same-source-file-name/src/func.c +6 -0
  1196. data/ext/gyp/test/same-source-file-name/src/prog1.c +16 -0
  1197. data/ext/gyp/test/same-source-file-name/src/prog2.c +16 -0
  1198. data/ext/gyp/test/same-source-file-name/src/prog3.c +18 -0
  1199. data/ext/gyp/test/same-source-file-name/src/subdir1/func.c +6 -0
  1200. data/ext/gyp/test/same-source-file-name/src/subdir2/func.c +6 -0
  1201. data/ext/gyp/test/same-target-name/gyptest-same-target-name.py +18 -0
  1202. data/ext/gyp/test/same-target-name/src/all.gyp +16 -0
  1203. data/ext/gyp/test/same-target-name/src/executable1.gyp +15 -0
  1204. data/ext/gyp/test/same-target-name/src/executable2.gyp +15 -0
  1205. data/ext/gyp/test/same-target-name-different-directory/gyptest-all.py +41 -0
  1206. data/ext/gyp/test/same-target-name-different-directory/src/subdir1/subdir1.gyp +66 -0
  1207. data/ext/gyp/test/same-target-name-different-directory/src/subdir2/subdir2.gyp +66 -0
  1208. data/ext/gyp/test/same-target-name-different-directory/src/subdirs.gyp +16 -0
  1209. data/ext/gyp/test/same-target-name-different-directory/src/touch.py +11 -0
  1210. data/ext/gyp/test/sanitize-rule-names/blah.S +0 -0
  1211. data/ext/gyp/test/sanitize-rule-names/gyptest-sanitize-rule-names.py +17 -0
  1212. data/ext/gyp/test/sanitize-rule-names/hello.cc +7 -0
  1213. data/ext/gyp/test/sanitize-rule-names/sanitize-rule-names.gyp +27 -0
  1214. data/ext/gyp/test/sanitize-rule-names/script.py +10 -0
  1215. data/ext/gyp/test/self-dependency/common.gypi +13 -0
  1216. data/ext/gyp/test/self-dependency/dep.gyp +23 -0
  1217. data/ext/gyp/test/self-dependency/gyptest-self-dependency.py +19 -0
  1218. data/ext/gyp/test/self-dependency/self_dependency.gyp +15 -0
  1219. data/ext/gyp/test/sibling/gyptest-all.py +42 -0
  1220. data/ext/gyp/test/sibling/gyptest-relocate.py +44 -0
  1221. data/ext/gyp/test/sibling/src/build/all.gyp +16 -0
  1222. data/ext/gyp/test/sibling/src/prog1/prog1.c +7 -0
  1223. data/ext/gyp/test/sibling/src/prog1/prog1.gyp +15 -0
  1224. data/ext/gyp/test/sibling/src/prog2/prog2.c +7 -0
  1225. data/ext/gyp/test/sibling/src/prog2/prog2.gyp +15 -0
  1226. data/ext/gyp/test/small/gyptest-small.py +56 -0
  1227. data/ext/gyp/test/standalone/gyptest-standalone.py +35 -0
  1228. data/ext/gyp/test/standalone/standalone.gyp +12 -0
  1229. data/ext/gyp/test/standalone-static-library/gyptest-standalone-static-library.py +50 -0
  1230. data/ext/gyp/test/standalone-static-library/invalid.gyp +16 -0
  1231. data/ext/gyp/test/standalone-static-library/mylib.c +7 -0
  1232. data/ext/gyp/test/standalone-static-library/mylib.gyp +26 -0
  1233. data/ext/gyp/test/standalone-static-library/prog.c +7 -0
  1234. data/ext/gyp/test/subdirectory/gyptest-SYMROOT-all.py +36 -0
  1235. data/ext/gyp/test/subdirectory/gyptest-SYMROOT-default.py +37 -0
  1236. data/ext/gyp/test/subdirectory/gyptest-subdir-all.py +34 -0
  1237. data/ext/gyp/test/subdirectory/gyptest-subdir-default.py +34 -0
  1238. data/ext/gyp/test/subdirectory/gyptest-subdir2-deep.py +25 -0
  1239. data/ext/gyp/test/subdirectory/gyptest-top-all.py +43 -0
  1240. data/ext/gyp/test/subdirectory/gyptest-top-default.py +43 -0
  1241. data/ext/gyp/test/subdirectory/src/prog1.c +7 -0
  1242. data/ext/gyp/test/subdirectory/src/prog1.gyp +21 -0
  1243. data/ext/gyp/test/subdirectory/src/subdir/prog2.c +7 -0
  1244. data/ext/gyp/test/subdirectory/src/subdir/prog2.gyp +18 -0
  1245. data/ext/gyp/test/subdirectory/src/subdir/subdir2/prog3.c +7 -0
  1246. data/ext/gyp/test/subdirectory/src/subdir/subdir2/prog3.gyp +18 -0
  1247. data/ext/gyp/test/subdirectory/src/symroot.gypi +16 -0
  1248. data/ext/gyp/test/symlinks/gyptest-symlinks.py +66 -0
  1249. data/ext/gyp/test/symlinks/hello.c +12 -0
  1250. data/ext/gyp/test/symlinks/hello.gyp +15 -0
  1251. data/ext/gyp/test/target/gyptest-target.py +37 -0
  1252. data/ext/gyp/test/target/hello.c +7 -0
  1253. data/ext/gyp/test/target/target.gyp +24 -0
  1254. data/ext/gyp/test/toolsets/gyptest-toolsets.py +31 -0
  1255. data/ext/gyp/test/toolsets/main.cc +13 -0
  1256. data/ext/gyp/test/toolsets/toolsets.cc +11 -0
  1257. data/ext/gyp/test/toolsets/toolsets.gyp +62 -0
  1258. data/ext/gyp/test/toolsets/toolsets_shared.cc +11 -0
  1259. data/ext/gyp/test/toplevel-dir/gyptest-toplevel-dir.py +31 -0
  1260. data/ext/gyp/test/toplevel-dir/src/sub1/main.gyp +18 -0
  1261. data/ext/gyp/test/toplevel-dir/src/sub1/prog1.c +7 -0
  1262. data/ext/gyp/test/toplevel-dir/src/sub2/prog2.c +7 -0
  1263. data/ext/gyp/test/toplevel-dir/src/sub2/prog2.gyp +15 -0
  1264. data/ext/gyp/test/variables/commands/commands-repeated.gyp +128 -0
  1265. data/ext/gyp/test/variables/commands/commands-repeated.gyp.stdout +136 -0
  1266. data/ext/gyp/test/variables/commands/commands-repeated.gypd.golden +77 -0
  1267. data/ext/gyp/test/variables/commands/commands.gyp +91 -0
  1268. data/ext/gyp/test/variables/commands/commands.gyp.ignore-env.stdout +96 -0
  1269. data/ext/gyp/test/variables/commands/commands.gyp.stdout +96 -0
  1270. data/ext/gyp/test/variables/commands/commands.gypd.golden +66 -0
  1271. data/ext/gyp/test/variables/commands/commands.gypi +23 -0
  1272. data/ext/gyp/test/variables/commands/gyptest-commands-ignore-env.py +47 -0
  1273. data/ext/gyp/test/variables/commands/gyptest-commands-repeated-multidir.py +23 -0
  1274. data/ext/gyp/test/variables/commands/gyptest-commands-repeated.py +40 -0
  1275. data/ext/gyp/test/variables/commands/gyptest-commands.py +40 -0
  1276. data/ext/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp +13 -0
  1277. data/ext/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp +13 -0
  1278. data/ext/gyp/test/variables/commands/repeated_multidir/main.gyp +16 -0
  1279. data/ext/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py +11 -0
  1280. data/ext/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi +25 -0
  1281. data/ext/gyp/test/variables/commands/test.py +7 -0
  1282. data/ext/gyp/test/variables/commands/update_golden +11 -0
  1283. data/ext/gyp/test/variables/empty/empty.gyp +13 -0
  1284. data/ext/gyp/test/variables/empty/empty.gypi +9 -0
  1285. data/ext/gyp/test/variables/empty/gyptest-empty.py +19 -0
  1286. data/ext/gyp/test/variables/filelist/filelist.gyp.stdout +26 -0
  1287. data/ext/gyp/test/variables/filelist/filelist.gypd.golden +43 -0
  1288. data/ext/gyp/test/variables/filelist/gyptest-filelist-golden.py +53 -0
  1289. data/ext/gyp/test/variables/filelist/gyptest-filelist.py +29 -0
  1290. data/ext/gyp/test/variables/filelist/src/dummy.py +5 -0
  1291. data/ext/gyp/test/variables/filelist/src/filelist.gyp +93 -0
  1292. data/ext/gyp/test/variables/filelist/src/filelist2.gyp +40 -0
  1293. data/ext/gyp/test/variables/filelist/update_golden +8 -0
  1294. data/ext/gyp/test/variables/latelate/gyptest-latelate.py +25 -0
  1295. data/ext/gyp/test/variables/latelate/src/latelate.gyp +34 -0
  1296. data/ext/gyp/test/variables/latelate/src/program.cc +13 -0
  1297. data/ext/gyp/test/variables/variable-in-path/C1/hello.cc +7 -0
  1298. data/ext/gyp/test/variables/variable-in-path/gyptest-variable-in-path.py +23 -0
  1299. data/ext/gyp/test/variables/variable-in-path/variable-in-path.gyp +31 -0
  1300. data/ext/gyp/test/win/asm-files/asm-files.gyp +17 -0
  1301. data/ext/gyp/test/win/asm-files/b.s +0 -0
  1302. data/ext/gyp/test/win/asm-files/c.S +0 -0
  1303. data/ext/gyp/test/win/asm-files/hello.cc +7 -0
  1304. data/ext/gyp/test/win/batch-file-action/batch-file-action.gyp +21 -0
  1305. data/ext/gyp/test/win/batch-file-action/infile +1 -0
  1306. data/ext/gyp/test/win/batch-file-action/somecmd.bat +5 -0
  1307. data/ext/gyp/test/win/command-quote/a.S +0 -0
  1308. data/ext/gyp/test/win/command-quote/bat with spaces.bat +7 -0
  1309. data/ext/gyp/test/win/command-quote/command-quote.gyp +79 -0
  1310. data/ext/gyp/test/win/command-quote/go.bat +7 -0
  1311. data/ext/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp +27 -0
  1312. data/ext/gyp/test/win/compiler-flags/additional-include-dirs.cc +10 -0
  1313. data/ext/gyp/test/win/compiler-flags/additional-include-dirs.gyp +20 -0
  1314. data/ext/gyp/test/win/compiler-flags/additional-options.cc +10 -0
  1315. data/ext/gyp/test/win/compiler-flags/additional-options.gyp +31 -0
  1316. data/ext/gyp/test/win/compiler-flags/analysis.gyp +40 -0
  1317. data/ext/gyp/test/win/compiler-flags/buffer-security-check.gyp +51 -0
  1318. data/ext/gyp/test/win/compiler-flags/buffer-security.cc +12 -0
  1319. data/ext/gyp/test/win/compiler-flags/calling-convention-cdecl.def +6 -0
  1320. data/ext/gyp/test/win/compiler-flags/calling-convention-fastcall.def +6 -0
  1321. data/ext/gyp/test/win/compiler-flags/calling-convention-stdcall.def +6 -0
  1322. data/ext/gyp/test/win/compiler-flags/calling-convention-vectorcall.def +6 -0
  1323. data/ext/gyp/test/win/compiler-flags/calling-convention.cc +6 -0
  1324. data/ext/gyp/test/win/compiler-flags/calling-convention.gyp +66 -0
  1325. data/ext/gyp/test/win/compiler-flags/character-set-mbcs.cc +11 -0
  1326. data/ext/gyp/test/win/compiler-flags/character-set-unicode.cc +15 -0
  1327. data/ext/gyp/test/win/compiler-flags/character-set.gyp +35 -0
  1328. data/ext/gyp/test/win/compiler-flags/compile-as-managed.cc +9 -0
  1329. data/ext/gyp/test/win/compiler-flags/compile-as-managed.gyp +29 -0
  1330. data/ext/gyp/test/win/compiler-flags/compile-as-winrt.cc +12 -0
  1331. data/ext/gyp/test/win/compiler-flags/compile-as-winrt.gyp +20 -0
  1332. data/ext/gyp/test/win/compiler-flags/debug-format.gyp +48 -0
  1333. data/ext/gyp/test/win/compiler-flags/default-char-is-unsigned.cc +15 -0
  1334. data/ext/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp +20 -0
  1335. data/ext/gyp/test/win/compiler-flags/disable-specific-warnings.cc +9 -0
  1336. data/ext/gyp/test/win/compiler-flags/disable-specific-warnings.gyp +29 -0
  1337. data/ext/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc +28 -0
  1338. data/ext/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp +68 -0
  1339. data/ext/gyp/test/win/compiler-flags/exception-handling-on.cc +24 -0
  1340. data/ext/gyp/test/win/compiler-flags/exception-handling.gyp +46 -0
  1341. data/ext/gyp/test/win/compiler-flags/floating-point-model-fast.cc +19 -0
  1342. data/ext/gyp/test/win/compiler-flags/floating-point-model-precise.cc +19 -0
  1343. data/ext/gyp/test/win/compiler-flags/floating-point-model-strict.cc +19 -0
  1344. data/ext/gyp/test/win/compiler-flags/floating-point-model.gyp +43 -0
  1345. data/ext/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc +10 -0
  1346. data/ext/gyp/test/win/compiler-flags/force-include-files.cc +8 -0
  1347. data/ext/gyp/test/win/compiler-flags/force-include-files.gyp +36 -0
  1348. data/ext/gyp/test/win/compiler-flags/function-level-linking.cc +11 -0
  1349. data/ext/gyp/test/win/compiler-flags/function-level-linking.gyp +28 -0
  1350. data/ext/gyp/test/win/compiler-flags/hello.cc +7 -0
  1351. data/ext/gyp/test/win/compiler-flags/optimizations.gyp +207 -0
  1352. data/ext/gyp/test/win/compiler-flags/pdbname-override.gyp +26 -0
  1353. data/ext/gyp/test/win/compiler-flags/pdbname.cc +7 -0
  1354. data/ext/gyp/test/win/compiler-flags/pdbname.gyp +24 -0
  1355. data/ext/gyp/test/win/compiler-flags/precomp.cc +6 -0
  1356. data/ext/gyp/test/win/compiler-flags/rtti-on.cc +11 -0
  1357. data/ext/gyp/test/win/compiler-flags/rtti.gyp +37 -0
  1358. data/ext/gyp/test/win/compiler-flags/runtime-checks.cc +11 -0
  1359. data/ext/gyp/test/win/compiler-flags/runtime-checks.gyp +29 -0
  1360. data/ext/gyp/test/win/compiler-flags/runtime-library-md.cc +19 -0
  1361. data/ext/gyp/test/win/compiler-flags/runtime-library-mdd.cc +19 -0
  1362. data/ext/gyp/test/win/compiler-flags/runtime-library-mt.cc +19 -0
  1363. data/ext/gyp/test/win/compiler-flags/runtime-library-mtd.cc +19 -0
  1364. data/ext/gyp/test/win/compiler-flags/runtime-library.gyp +48 -0
  1365. data/ext/gyp/test/win/compiler-flags/subdir/header.h +0 -0
  1366. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp +33 -0
  1367. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc +11 -0
  1368. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc +11 -0
  1369. data/ext/gyp/test/win/compiler-flags/uninit.cc +13 -0
  1370. data/ext/gyp/test/win/compiler-flags/warning-as-error.cc +9 -0
  1371. data/ext/gyp/test/win/compiler-flags/warning-as-error.gyp +37 -0
  1372. data/ext/gyp/test/win/compiler-flags/warning-level.gyp +115 -0
  1373. data/ext/gyp/test/win/compiler-flags/warning-level1.cc +8 -0
  1374. data/ext/gyp/test/win/compiler-flags/warning-level2.cc +14 -0
  1375. data/ext/gyp/test/win/compiler-flags/warning-level3.cc +11 -0
  1376. data/ext/gyp/test/win/compiler-flags/warning-level4.cc +10 -0
  1377. data/ext/gyp/test/win/enable-winrt/dllmain.cc +30 -0
  1378. data/ext/gyp/test/win/enable-winrt/enable-winrt.gyp +39 -0
  1379. data/ext/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py +44 -0
  1380. data/ext/gyp/test/win/generator-output-different-drive/prog.c +10 -0
  1381. data/ext/gyp/test/win/generator-output-different-drive/prog.gyp +15 -0
  1382. data/ext/gyp/test/win/gyptest-asm-files.py +26 -0
  1383. data/ext/gyp/test/win/gyptest-cl-additional-include-dirs.py +22 -0
  1384. data/ext/gyp/test/win/gyptest-cl-additional-options.py +28 -0
  1385. data/ext/gyp/test/win/gyptest-cl-analysis.py +30 -0
  1386. data/ext/gyp/test/win/gyptest-cl-buffer-security-check.py +53 -0
  1387. data/ext/gyp/test/win/gyptest-cl-calling-convention.py +22 -0
  1388. data/ext/gyp/test/win/gyptest-cl-character-set.py +22 -0
  1389. data/ext/gyp/test/win/gyptest-cl-compile-as-managed.py +24 -0
  1390. data/ext/gyp/test/win/gyptest-cl-compile-as-winrt.py +20 -0
  1391. data/ext/gyp/test/win/gyptest-cl-debug-format.py +43 -0
  1392. data/ext/gyp/test/win/gyptest-cl-default-char-is-unsigned.py +22 -0
  1393. data/ext/gyp/test/win/gyptest-cl-disable-specific-warnings.py +32 -0
  1394. data/ext/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py +49 -0
  1395. data/ext/gyp/test/win/gyptest-cl-exception-handling.py +33 -0
  1396. data/ext/gyp/test/win/gyptest-cl-floating-point-model.py +22 -0
  1397. data/ext/gyp/test/win/gyptest-cl-force-include-files.py +22 -0
  1398. data/ext/gyp/test/win/gyptest-cl-function-level-linking.py +54 -0
  1399. data/ext/gyp/test/win/gyptest-cl-optimizations.py +105 -0
  1400. data/ext/gyp/test/win/gyptest-cl-pdbname-override.py +27 -0
  1401. data/ext/gyp/test/win/gyptest-cl-pdbname.py +30 -0
  1402. data/ext/gyp/test/win/gyptest-cl-rtti.py +30 -0
  1403. data/ext/gyp/test/win/gyptest-cl-runtime-checks.py +30 -0
  1404. data/ext/gyp/test/win/gyptest-cl-runtime-library.py +22 -0
  1405. data/ext/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py +22 -0
  1406. data/ext/gyp/test/win/gyptest-cl-warning-as-error.py +30 -0
  1407. data/ext/gyp/test/win/gyptest-cl-warning-level.py +41 -0
  1408. data/ext/gyp/test/win/gyptest-command-quote.py +42 -0
  1409. data/ext/gyp/test/win/gyptest-crosscompile-ar.py +29 -0
  1410. data/ext/gyp/test/win/gyptest-lib-ltcg.py +22 -0
  1411. data/ext/gyp/test/win/gyptest-link-additional-deps.py +22 -0
  1412. data/ext/gyp/test/win/gyptest-link-additional-options.py +22 -0
  1413. data/ext/gyp/test/win/gyptest-link-aslr.py +35 -0
  1414. data/ext/gyp/test/win/gyptest-link-base-address.py +62 -0
  1415. data/ext/gyp/test/win/gyptest-link-debug-info.py +26 -0
  1416. data/ext/gyp/test/win/gyptest-link-default-libs.py +22 -0
  1417. data/ext/gyp/test/win/gyptest-link-deffile.py +43 -0
  1418. data/ext/gyp/test/win/gyptest-link-defrelink.py +56 -0
  1419. data/ext/gyp/test/win/gyptest-link-delay-load-dlls.py +35 -0
  1420. data/ext/gyp/test/win/gyptest-link-embed-manifest.py +100 -0
  1421. data/ext/gyp/test/win/gyptest-link-enable-uac.py +104 -0
  1422. data/ext/gyp/test/win/gyptest-link-enable-winrt-app-revision.py +43 -0
  1423. data/ext/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py +47 -0
  1424. data/ext/gyp/test/win/gyptest-link-enable-winrt.py +37 -0
  1425. data/ext/gyp/test/win/gyptest-link-entrypointsymbol.py +24 -0
  1426. data/ext/gyp/test/win/gyptest-link-fixed-base.py +40 -0
  1427. data/ext/gyp/test/win/gyptest-link-force-symbol-reference.py +26 -0
  1428. data/ext/gyp/test/win/gyptest-link-generate-manifest.py +127 -0
  1429. data/ext/gyp/test/win/gyptest-link-incremental.py +37 -0
  1430. data/ext/gyp/test/win/gyptest-link-large-address-aware.py +35 -0
  1431. data/ext/gyp/test/win/gyptest-link-large-pdb.py +76 -0
  1432. data/ext/gyp/test/win/gyptest-link-library-adjust.py +21 -0
  1433. data/ext/gyp/test/win/gyptest-link-library-directories.py +35 -0
  1434. data/ext/gyp/test/win/gyptest-link-ltcg.py +44 -0
  1435. data/ext/gyp/test/win/gyptest-link-mapfile.py +44 -0
  1436. data/ext/gyp/test/win/gyptest-link-nodefaultlib.py +24 -0
  1437. data/ext/gyp/test/win/gyptest-link-noimportlib.py +30 -0
  1438. data/ext/gyp/test/win/gyptest-link-nxcompat.py +37 -0
  1439. data/ext/gyp/test/win/gyptest-link-opt-icf.py +41 -0
  1440. data/ext/gyp/test/win/gyptest-link-opt-ref.py +40 -0
  1441. data/ext/gyp/test/win/gyptest-link-ordering.py +103 -0
  1442. data/ext/gyp/test/win/gyptest-link-outputfile.py +28 -0
  1443. data/ext/gyp/test/win/gyptest-link-pdb-no-output.py +25 -0
  1444. data/ext/gyp/test/win/gyptest-link-pdb-output.py +33 -0
  1445. data/ext/gyp/test/win/gyptest-link-pdb.py +35 -0
  1446. data/ext/gyp/test/win/gyptest-link-pgo.py +75 -0
  1447. data/ext/gyp/test/win/gyptest-link-profile.py +37 -0
  1448. data/ext/gyp/test/win/gyptest-link-restat-importlib.py +47 -0
  1449. data/ext/gyp/test/win/gyptest-link-safeseh.py +46 -0
  1450. data/ext/gyp/test/win/gyptest-link-shard.py +30 -0
  1451. data/ext/gyp/test/win/gyptest-link-stacksize.py +62 -0
  1452. data/ext/gyp/test/win/gyptest-link-subsystem.py +38 -0
  1453. data/ext/gyp/test/win/gyptest-link-target-machine.py +28 -0
  1454. data/ext/gyp/test/win/gyptest-link-tsaware.py +33 -0
  1455. data/ext/gyp/test/win/gyptest-link-uldi-depending-on-module.py +24 -0
  1456. data/ext/gyp/test/win/gyptest-link-uldi.py +28 -0
  1457. data/ext/gyp/test/win/gyptest-link-unsupported-manifest.py +27 -0
  1458. data/ext/gyp/test/win/gyptest-link-update-manifest.py +104 -0
  1459. data/ext/gyp/test/win/gyptest-link-warnings-as-errors.py +24 -0
  1460. data/ext/gyp/test/win/gyptest-long-command-line.py +23 -0
  1461. data/ext/gyp/test/win/gyptest-macro-projectname.py +24 -0
  1462. data/ext/gyp/test/win/gyptest-macro-targetext.py +26 -0
  1463. data/ext/gyp/test/win/gyptest-macro-targetfilename.py +37 -0
  1464. data/ext/gyp/test/win/gyptest-macro-targetname.py +29 -0
  1465. data/ext/gyp/test/win/gyptest-macro-targetpath.py +30 -0
  1466. data/ext/gyp/test/win/gyptest-macro-vcinstalldir.py +24 -0
  1467. data/ext/gyp/test/win/gyptest-macros-containing-gyp.py +21 -0
  1468. data/ext/gyp/test/win/gyptest-macros-in-inputs-and-outputs.py +27 -0
  1469. data/ext/gyp/test/win/gyptest-midl-excluded.py +22 -0
  1470. data/ext/gyp/test/win/gyptest-midl-includedirs.py +21 -0
  1471. data/ext/gyp/test/win/gyptest-midl-rules.py +28 -0
  1472. data/ext/gyp/test/win/gyptest-ml-safeseh.py +22 -0
  1473. data/ext/gyp/test/win/gyptest-quoting-commands.py +25 -0
  1474. data/ext/gyp/test/win/gyptest-rc-build.py +29 -0
  1475. data/ext/gyp/test/win/gyptest-sys.py +27 -0
  1476. data/ext/gyp/test/win/gyptest-system-include.py +21 -0
  1477. data/ext/gyp/test/win/idl-excluded/bad.idl +6 -0
  1478. data/ext/gyp/test/win/idl-excluded/copy-file.py +11 -0
  1479. data/ext/gyp/test/win/idl-excluded/idl-excluded.gyp +58 -0
  1480. data/ext/gyp/test/win/idl-excluded/program.cc +7 -0
  1481. data/ext/gyp/test/win/idl-includedirs/hello.cc +7 -0
  1482. data/ext/gyp/test/win/idl-includedirs/idl-includedirs.gyp +26 -0
  1483. data/ext/gyp/test/win/idl-includedirs/subdir/bar.idl +13 -0
  1484. data/ext/gyp/test/win/idl-includedirs/subdir/foo.idl +14 -0
  1485. data/ext/gyp/test/win/idl-rules/Window.idl +9 -0
  1486. data/ext/gyp/test/win/idl-rules/basic-idl.gyp +67 -0
  1487. data/ext/gyp/test/win/idl-rules/history_indexer.idl +17 -0
  1488. data/ext/gyp/test/win/idl-rules/history_indexer_user.cc +15 -0
  1489. data/ext/gyp/test/win/idl-rules/idl_compiler.py +17 -0
  1490. data/ext/gyp/test/win/importlib/dll_no_exports.cc +9 -0
  1491. data/ext/gyp/test/win/importlib/has-exports.cc +10 -0
  1492. data/ext/gyp/test/win/importlib/hello.cc +9 -0
  1493. data/ext/gyp/test/win/importlib/importlib.gyp +30 -0
  1494. data/ext/gyp/test/win/importlib/noimplib.gyp +16 -0
  1495. data/ext/gyp/test/win/large-pdb/dllmain.cc +9 -0
  1496. data/ext/gyp/test/win/large-pdb/large-pdb.gyp +98 -0
  1497. data/ext/gyp/test/win/large-pdb/main.cc +7 -0
  1498. data/ext/gyp/test/win/lib-crosscompile/answer.cc +9 -0
  1499. data/ext/gyp/test/win/lib-crosscompile/answer.h +5 -0
  1500. data/ext/gyp/test/win/lib-crosscompile/use_host_ar.gyp +17 -0
  1501. data/ext/gyp/test/win/lib-flags/answer.cc +9 -0
  1502. data/ext/gyp/test/win/lib-flags/answer.h +5 -0
  1503. data/ext/gyp/test/win/lib-flags/ltcg.gyp +21 -0
  1504. data/ext/gyp/test/win/linker-flags/a/x.cc +7 -0
  1505. data/ext/gyp/test/win/linker-flags/a/z.cc +7 -0
  1506. data/ext/gyp/test/win/linker-flags/additional-deps.cc +10 -0
  1507. data/ext/gyp/test/win/linker-flags/additional-deps.gyp +30 -0
  1508. data/ext/gyp/test/win/linker-flags/additional-options.gyp +29 -0
  1509. data/ext/gyp/test/win/linker-flags/aslr.gyp +35 -0
  1510. data/ext/gyp/test/win/linker-flags/b/y.cc +7 -0
  1511. data/ext/gyp/test/win/linker-flags/base-address.gyp +38 -0
  1512. data/ext/gyp/test/win/linker-flags/debug-info.gyp +28 -0
  1513. data/ext/gyp/test/win/linker-flags/deffile-multiple.gyp +17 -0
  1514. data/ext/gyp/test/win/linker-flags/deffile.cc +13 -0
  1515. data/ext/gyp/test/win/linker-flags/deffile.def +8 -0
  1516. data/ext/gyp/test/win/linker-flags/deffile.gyp +38 -0
  1517. data/ext/gyp/test/win/linker-flags/delay-load-dlls.gyp +35 -0
  1518. data/ext/gyp/test/win/linker-flags/delay-load.cc +10 -0
  1519. data/ext/gyp/test/win/linker-flags/embed-manifest.gyp +109 -0
  1520. data/ext/gyp/test/win/linker-flags/enable-uac.gyp +45 -0
  1521. data/ext/gyp/test/win/linker-flags/entrypointsymbol.cc +13 -0
  1522. data/ext/gyp/test/win/linker-flags/entrypointsymbol.gyp +28 -0
  1523. data/ext/gyp/test/win/linker-flags/extra.manifest +11 -0
  1524. data/ext/gyp/test/win/linker-flags/extra2.manifest +11 -0
  1525. data/ext/gyp/test/win/linker-flags/fixed-base.gyp +52 -0
  1526. data/ext/gyp/test/win/linker-flags/force-symbol-reference.gyp +39 -0
  1527. data/ext/gyp/test/win/linker-flags/generate-manifest.gyp +166 -0
  1528. data/ext/gyp/test/win/linker-flags/hello.cc +7 -0
  1529. data/ext/gyp/test/win/linker-flags/incremental.gyp +65 -0
  1530. data/ext/gyp/test/win/linker-flags/inline_test.cc +12 -0
  1531. data/ext/gyp/test/win/linker-flags/inline_test.h +5 -0
  1532. data/ext/gyp/test/win/linker-flags/inline_test_main.cc +15 -0
  1533. data/ext/gyp/test/win/linker-flags/large-address-aware.gyp +28 -0
  1534. data/ext/gyp/test/win/linker-flags/library-adjust.cc +10 -0
  1535. data/ext/gyp/test/win/linker-flags/library-adjust.gyp +16 -0
  1536. data/ext/gyp/test/win/linker-flags/library-directories-define.cc +7 -0
  1537. data/ext/gyp/test/win/linker-flags/library-directories-reference.cc +10 -0
  1538. data/ext/gyp/test/win/linker-flags/library-directories.gyp +42 -0
  1539. data/ext/gyp/test/win/linker-flags/link-ordering.gyp +95 -0
  1540. data/ext/gyp/test/win/linker-flags/link-warning.cc +10 -0
  1541. data/ext/gyp/test/win/linker-flags/ltcg.gyp +42 -0
  1542. data/ext/gyp/test/win/linker-flags/main-crt.c +8 -0
  1543. data/ext/gyp/test/win/linker-flags/manifest-in-comment.cc +13 -0
  1544. data/ext/gyp/test/win/linker-flags/mapfile.cc +12 -0
  1545. data/ext/gyp/test/win/linker-flags/mapfile.gyp +45 -0
  1546. data/ext/gyp/test/win/linker-flags/no-default-libs.cc +18 -0
  1547. data/ext/gyp/test/win/linker-flags/no-default-libs.gyp +13 -0
  1548. data/ext/gyp/test/win/linker-flags/nodefaultlib.cc +13 -0
  1549. data/ext/gyp/test/win/linker-flags/nodefaultlib.gyp +30 -0
  1550. data/ext/gyp/test/win/linker-flags/nxcompat.gyp +35 -0
  1551. data/ext/gyp/test/win/linker-flags/opt-icf.cc +29 -0
  1552. data/ext/gyp/test/win/linker-flags/opt-icf.gyp +63 -0
  1553. data/ext/gyp/test/win/linker-flags/opt-ref.cc +11 -0
  1554. data/ext/gyp/test/win/linker-flags/opt-ref.gyp +56 -0
  1555. data/ext/gyp/test/win/linker-flags/outputfile.gyp +58 -0
  1556. data/ext/gyp/test/win/linker-flags/pdb-output.gyp +49 -0
  1557. data/ext/gyp/test/win/linker-flags/pgo.gyp +143 -0
  1558. data/ext/gyp/test/win/linker-flags/profile.gyp +50 -0
  1559. data/ext/gyp/test/win/linker-flags/program-database.gyp +40 -0
  1560. data/ext/gyp/test/win/linker-flags/safeseh.gyp +79 -0
  1561. data/ext/gyp/test/win/linker-flags/safeseh_hello.cc +11 -0
  1562. data/ext/gyp/test/win/linker-flags/safeseh_zero.asm +10 -0
  1563. data/ext/gyp/test/win/linker-flags/safeseh_zero64.asm +9 -0
  1564. data/ext/gyp/test/win/linker-flags/stacksize.gyp +44 -0
  1565. data/ext/gyp/test/win/linker-flags/subdir/library.gyp +13 -0
  1566. data/ext/gyp/test/win/linker-flags/subsystem-windows.cc +9 -0
  1567. data/ext/gyp/test/win/linker-flags/subsystem.gyp +70 -0
  1568. data/ext/gyp/test/win/linker-flags/target-machine.gyp +48 -0
  1569. data/ext/gyp/test/win/linker-flags/tsaware.gyp +28 -0
  1570. data/ext/gyp/test/win/linker-flags/unsupported-manifest.gyp +13 -0
  1571. data/ext/gyp/test/win/linker-flags/update_pgd.py +35 -0
  1572. data/ext/gyp/test/win/linker-flags/warn-as-error.gyp +33 -0
  1573. data/ext/gyp/test/win/linker-flags/x.cc +7 -0
  1574. data/ext/gyp/test/win/linker-flags/y.cc +7 -0
  1575. data/ext/gyp/test/win/linker-flags/z.cc +7 -0
  1576. data/ext/gyp/test/win/long-command-line/function.cc +7 -0
  1577. data/ext/gyp/test/win/long-command-line/hello.cc +7 -0
  1578. data/ext/gyp/test/win/long-command-line/long-command-line.gyp +54 -0
  1579. data/ext/gyp/test/win/ml-safeseh/a.asm +10 -0
  1580. data/ext/gyp/test/win/ml-safeseh/hello.cc +11 -0
  1581. data/ext/gyp/test/win/ml-safeseh/ml-safeseh.gyp +24 -0
  1582. data/ext/gyp/test/win/precompiled/gyptest-all.py +21 -0
  1583. data/ext/gyp/test/win/precompiled/hello.c +14 -0
  1584. data/ext/gyp/test/win/precompiled/hello.gyp +28 -0
  1585. data/ext/gyp/test/win/precompiled/hello2.c +13 -0
  1586. data/ext/gyp/test/win/precompiled/precomp.c +8 -0
  1587. data/ext/gyp/test/win/rc-build/Resource.h +26 -0
  1588. data/ext/gyp/test/win/rc-build/hello.cpp +30 -0
  1589. data/ext/gyp/test/win/rc-build/hello.gyp +92 -0
  1590. data/ext/gyp/test/win/rc-build/hello.h +3 -0
  1591. data/ext/gyp/test/win/rc-build/hello.ico +0 -0
  1592. data/ext/gyp/test/win/rc-build/hello.rc +86 -0
  1593. data/ext/gyp/test/win/rc-build/hello3.rc +87 -0
  1594. data/ext/gyp/test/win/rc-build/small.ico +0 -0
  1595. data/ext/gyp/test/win/rc-build/subdir/hello2.rc +87 -0
  1596. data/ext/gyp/test/win/rc-build/subdir/include.h +1 -0
  1597. data/ext/gyp/test/win/rc-build/targetver.h +24 -0
  1598. data/ext/gyp/test/win/shard/hello.cc +7 -0
  1599. data/ext/gyp/test/win/shard/hello1.cc +7 -0
  1600. data/ext/gyp/test/win/shard/hello2.cc +7 -0
  1601. data/ext/gyp/test/win/shard/hello3.cc +7 -0
  1602. data/ext/gyp/test/win/shard/hello4.cc +7 -0
  1603. data/ext/gyp/test/win/shard/shard.gyp +31 -0
  1604. data/ext/gyp/test/win/shard/shard_ref.gyp +41 -0
  1605. data/ext/gyp/test/win/system-include/bar/header.h +0 -0
  1606. data/ext/gyp/test/win/system-include/common/commonheader.h +0 -0
  1607. data/ext/gyp/test/win/system-include/foo/header.h +0 -0
  1608. data/ext/gyp/test/win/system-include/main.cc +4 -0
  1609. data/ext/gyp/test/win/system-include/test.gyp +26 -0
  1610. data/ext/gyp/test/win/uldi/a.cc +7 -0
  1611. data/ext/gyp/test/win/uldi/b.cc +7 -0
  1612. data/ext/gyp/test/win/uldi/dll.cc +6 -0
  1613. data/ext/gyp/test/win/uldi/exe.cc +7 -0
  1614. data/ext/gyp/test/win/uldi/main.cc +10 -0
  1615. data/ext/gyp/test/win/uldi/uldi-depending-on-module.gyp +42 -0
  1616. data/ext/gyp/test/win/uldi/uldi.gyp +45 -0
  1617. data/ext/gyp/test/win/vs-macros/as.py +20 -0
  1618. data/ext/gyp/test/win/vs-macros/containing-gyp.gyp +39 -0
  1619. data/ext/gyp/test/win/vs-macros/do_stuff.py +8 -0
  1620. data/ext/gyp/test/win/vs-macros/hello.cc +7 -0
  1621. data/ext/gyp/test/win/vs-macros/input-output-macros.gyp +32 -0
  1622. data/ext/gyp/test/win/vs-macros/input.S +0 -0
  1623. data/ext/gyp/test/win/vs-macros/projectname.gyp +29 -0
  1624. data/ext/gyp/test/win/vs-macros/stuff.blah +1 -0
  1625. data/ext/gyp/test/win/vs-macros/targetext.gyp +59 -0
  1626. data/ext/gyp/test/win/vs-macros/targetfilename.gyp +59 -0
  1627. data/ext/gyp/test/win/vs-macros/targetname.gyp +52 -0
  1628. data/ext/gyp/test/win/vs-macros/targetpath.gyp +59 -0
  1629. data/ext/gyp/test/win/vs-macros/test_exists.py +10 -0
  1630. data/ext/gyp/test/win/vs-macros/vcinstalldir.gyp +41 -0
  1631. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.c +10 -0
  1632. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp +32 -0
  1633. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.h +13 -0
  1634. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.rc +14 -0
  1635. data/ext/gyp/test/win/win-tool/copies_readonly_files.gyp +29 -0
  1636. data/ext/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py +55 -0
  1637. data/ext/gyp/test/win/winrt-app-type-revision/dllmain.cc +30 -0
  1638. data/ext/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp +43 -0
  1639. data/ext/gyp/test/win/winrt-target-platform-version/dllmain.cc +30 -0
  1640. data/ext/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp +49 -0
  1641. data/ext/gyp/test/xcode-ninja/list_excluded/gyptest-all.py +49 -0
  1642. data/ext/gyp/test/xcode-ninja/list_excluded/hello.cpp +7 -0
  1643. data/ext/gyp/test/xcode-ninja/list_excluded/hello_exclude.gyp +19 -0
  1644. data/ext/gyp/test/xcode-ninja/list_excluded/hello_excluded.cpp +7 -0
  1645. data/ext/gyp/tools/README +15 -0
  1646. data/ext/gyp/tools/Xcode/README +5 -0
  1647. data/ext/gyp/tools/Xcode/Specifications/gyp.pbfilespec +27 -0
  1648. data/ext/gyp/tools/Xcode/Specifications/gyp.xclangspec +226 -0
  1649. data/ext/gyp/tools/emacs/README +12 -0
  1650. data/ext/gyp/tools/emacs/gyp-tests.el +63 -0
  1651. data/ext/gyp/tools/emacs/gyp.el +275 -0
  1652. data/ext/gyp/tools/emacs/run-unit-tests.sh +7 -0
  1653. data/ext/gyp/tools/emacs/testdata/media.gyp +1105 -0
  1654. data/ext/gyp/tools/emacs/testdata/media.gyp.fontified +1107 -0
  1655. data/ext/gyp/tools/graphviz.py +102 -0
  1656. data/ext/gyp/tools/pretty_gyp.py +156 -0
  1657. data/ext/gyp/tools/pretty_sln.py +171 -0
  1658. data/ext/gyp/tools/pretty_vcproj.py +337 -0
  1659. data/ext/libuv/.gitattributes +1 -0
  1660. data/ext/libuv/.github/ISSUE_TEMPLATE.md +13 -0
  1661. data/ext/libuv/.github/stale.yml +22 -0
  1662. data/ext/libuv/.gitignore +80 -0
  1663. data/ext/libuv/.mailmap +50 -0
  1664. data/ext/libuv/AUTHORS +415 -0
  1665. data/ext/libuv/CMakeLists.txt +430 -0
  1666. data/ext/libuv/CONTRIBUTING.md +172 -0
  1667. data/ext/libuv/ChangeLog +4548 -0
  1668. data/ext/libuv/LICENSE +70 -0
  1669. data/ext/libuv/LICENSE-docs +396 -0
  1670. data/ext/libuv/MAINTAINERS.md +48 -0
  1671. data/ext/libuv/Makefile.am +548 -0
  1672. data/ext/libuv/README.md +431 -0
  1673. data/ext/libuv/SUPPORTED_PLATFORMS.md +68 -0
  1674. data/ext/libuv/android-configure-arm +23 -0
  1675. data/ext/libuv/android-configure-arm64 +23 -0
  1676. data/ext/libuv/android-configure-x86 +23 -0
  1677. data/ext/libuv/android-configure-x86_64 +25 -0
  1678. data/ext/libuv/appveyor.yml +32 -0
  1679. data/ext/libuv/autogen.sh +46 -0
  1680. data/ext/libuv/common.gypi +213 -0
  1681. data/ext/libuv/configure.ac +82 -0
  1682. data/ext/libuv/docs/Makefile +183 -0
  1683. data/ext/libuv/docs/code/cgi/main.c +81 -0
  1684. data/ext/libuv/docs/code/cgi/tick.c +13 -0
  1685. data/ext/libuv/docs/code/detach/main.c +31 -0
  1686. data/ext/libuv/docs/code/dns/main.c +80 -0
  1687. data/ext/libuv/docs/code/helloworld/main.c +15 -0
  1688. data/ext/libuv/docs/code/idle-basic/main.c +24 -0
  1689. data/ext/libuv/docs/code/idle-compute/main.c +43 -0
  1690. data/ext/libuv/docs/code/interfaces/main.c +33 -0
  1691. data/ext/libuv/docs/code/locks/main.c +57 -0
  1692. data/ext/libuv/docs/code/multi-echo-server/hammer.js +20 -0
  1693. data/ext/libuv/docs/code/multi-echo-server/main.c +114 -0
  1694. data/ext/libuv/docs/code/multi-echo-server/worker.c +88 -0
  1695. data/ext/libuv/docs/code/onchange/main.c +44 -0
  1696. data/ext/libuv/docs/code/pipe-echo-server/main.c +94 -0
  1697. data/ext/libuv/docs/code/plugin/hello.c +5 -0
  1698. data/ext/libuv/docs/code/plugin/main.c +39 -0
  1699. data/ext/libuv/docs/code/plugin/plugin.h +7 -0
  1700. data/ext/libuv/docs/code/proc-streams/main.c +49 -0
  1701. data/ext/libuv/docs/code/proc-streams/test.c +8 -0
  1702. data/ext/libuv/docs/code/progress/main.c +47 -0
  1703. data/ext/libuv/docs/code/queue-cancel/main.c +59 -0
  1704. data/ext/libuv/docs/code/queue-work/main.c +44 -0
  1705. data/ext/libuv/docs/code/ref-timer/main.c +29 -0
  1706. data/ext/libuv/docs/code/signal/main.c +66 -0
  1707. data/ext/libuv/docs/code/spawn/main.c +36 -0
  1708. data/ext/libuv/docs/code/tcp-echo-server/main.c +87 -0
  1709. data/ext/libuv/docs/code/thread-create/main.c +36 -0
  1710. data/ext/libuv/docs/code/tty/main.c +29 -0
  1711. data/ext/libuv/docs/code/tty-gravity/main.c +48 -0
  1712. data/ext/libuv/docs/code/udp-dhcp/main.c +127 -0
  1713. data/ext/libuv/docs/code/uvcat/main.c +63 -0
  1714. data/ext/libuv/docs/code/uvstop/main.c +33 -0
  1715. data/ext/libuv/docs/code/uvtee/main.c +80 -0
  1716. data/ext/libuv/docs/code/uvwget/main.c +166 -0
  1717. data/ext/libuv/docs/make.bat +243 -0
  1718. data/ext/libuv/docs/src/api.rst +35 -0
  1719. data/ext/libuv/docs/src/async.rst +65 -0
  1720. data/ext/libuv/docs/src/check.rst +46 -0
  1721. data/ext/libuv/docs/src/conf.py +348 -0
  1722. data/ext/libuv/docs/src/design.rst +140 -0
  1723. data/ext/libuv/docs/src/dll.rst +44 -0
  1724. data/ext/libuv/docs/src/dns.rst +108 -0
  1725. data/ext/libuv/docs/src/errors.rst +365 -0
  1726. data/ext/libuv/docs/src/fs.rst +689 -0
  1727. data/ext/libuv/docs/src/fs_event.rst +132 -0
  1728. data/ext/libuv/docs/src/fs_poll.rst +77 -0
  1729. data/ext/libuv/docs/src/guide/about.rst +22 -0
  1730. data/ext/libuv/docs/src/guide/basics.rst +219 -0
  1731. data/ext/libuv/docs/src/guide/eventloops.rst +48 -0
  1732. data/ext/libuv/docs/src/guide/filesystem.rst +330 -0
  1733. data/ext/libuv/docs/src/guide/introduction.rst +75 -0
  1734. data/ext/libuv/docs/src/guide/networking.rst +250 -0
  1735. data/ext/libuv/docs/src/guide/processes.rst +406 -0
  1736. data/ext/libuv/docs/src/guide/threads.rst +385 -0
  1737. data/ext/libuv/docs/src/guide/utilities.rst +437 -0
  1738. data/ext/libuv/docs/src/guide.rst +22 -0
  1739. data/ext/libuv/docs/src/handle.rst +283 -0
  1740. data/ext/libuv/docs/src/idle.rst +54 -0
  1741. data/ext/libuv/docs/src/index.rst +62 -0
  1742. data/ext/libuv/docs/src/loop.rst +238 -0
  1743. data/ext/libuv/docs/src/migration_010_100.rst +244 -0
  1744. data/ext/libuv/docs/src/misc.rst +702 -0
  1745. data/ext/libuv/docs/src/pipe.rst +116 -0
  1746. data/ext/libuv/docs/src/poll.rst +121 -0
  1747. data/ext/libuv/docs/src/prepare.rst +46 -0
  1748. data/ext/libuv/docs/src/process.rst +250 -0
  1749. data/ext/libuv/docs/src/request.rst +116 -0
  1750. data/ext/libuv/docs/src/signal.rst +101 -0
  1751. data/ext/libuv/docs/src/sphinx-plugins/manpage.py +45 -0
  1752. data/ext/libuv/docs/src/static/architecture.png +0 -0
  1753. data/ext/libuv/docs/src/static/diagrams.key/Data/st0-311.jpg +0 -0
  1754. data/ext/libuv/docs/src/static/diagrams.key/Data/st1-475.jpg +0 -0
  1755. data/ext/libuv/docs/src/static/diagrams.key/Index.zip +0 -0
  1756. data/ext/libuv/docs/src/static/diagrams.key/Metadata/BuildVersionHistory.plist +8 -0
  1757. data/ext/libuv/docs/src/static/diagrams.key/Metadata/DocumentIdentifier +1 -0
  1758. data/ext/libuv/docs/src/static/diagrams.key/Metadata/Properties.plist +0 -0
  1759. data/ext/libuv/docs/src/static/diagrams.key/preview-micro.jpg +0 -0
  1760. data/ext/libuv/docs/src/static/diagrams.key/preview-web.jpg +0 -0
  1761. data/ext/libuv/docs/src/static/diagrams.key/preview.jpg +0 -0
  1762. data/ext/libuv/docs/src/static/favicon.ico +0 -0
  1763. data/ext/libuv/docs/src/static/logo.png +0 -0
  1764. data/ext/libuv/docs/src/static/loop_iteration.png +0 -0
  1765. data/ext/libuv/docs/src/stream.rst +237 -0
  1766. data/ext/libuv/docs/src/tcp.rst +125 -0
  1767. data/ext/libuv/docs/src/threading.rst +197 -0
  1768. data/ext/libuv/docs/src/threadpool.rst +69 -0
  1769. data/ext/libuv/docs/src/timer.rst +81 -0
  1770. data/ext/libuv/docs/src/tty.rst +139 -0
  1771. data/ext/libuv/docs/src/udp.rst +390 -0
  1772. data/ext/libuv/docs/src/upgrading.rst +11 -0
  1773. data/ext/libuv/docs/src/version.rst +60 -0
  1774. data/ext/libuv/gyp_uv.py +73 -0
  1775. data/ext/libuv/img/banner.png +0 -0
  1776. data/ext/libuv/img/logos.svg +152 -0
  1777. data/ext/libuv/include/uv/aix.h +32 -0
  1778. data/ext/libuv/include/uv/android-ifaddrs.h +54 -0
  1779. data/ext/libuv/include/uv/bsd.h +34 -0
  1780. data/ext/libuv/include/uv/darwin.h +61 -0
  1781. data/ext/libuv/include/uv/errno.h +448 -0
  1782. data/ext/libuv/include/uv/linux.h +34 -0
  1783. data/ext/libuv/include/uv/os390.h +33 -0
  1784. data/ext/libuv/include/uv/posix.h +31 -0
  1785. data/ext/libuv/include/uv/stdint-msvc2008.h +247 -0
  1786. data/ext/libuv/include/uv/sunos.h +44 -0
  1787. data/ext/libuv/include/uv/threadpool.h +37 -0
  1788. data/ext/libuv/include/uv/tree.h +768 -0
  1789. data/ext/libuv/include/uv/unix.h +505 -0
  1790. data/ext/libuv/include/uv/version.h +43 -0
  1791. data/ext/libuv/include/uv/win.h +691 -0
  1792. data/ext/libuv/include/uv.h +1782 -0
  1793. data/ext/libuv/libuv.pc.in +12 -0
  1794. data/ext/libuv/m4/.gitignore +4 -0
  1795. data/ext/libuv/m4/as_case.m4 +21 -0
  1796. data/ext/libuv/m4/libuv-check-flags.m4 +319 -0
  1797. data/ext/libuv/src/fs-poll.c +287 -0
  1798. data/ext/libuv/src/heap-inl.h +245 -0
  1799. data/ext/libuv/src/idna.c +291 -0
  1800. data/ext/libuv/src/idna.h +31 -0
  1801. data/ext/libuv/src/inet.c +302 -0
  1802. data/ext/libuv/src/queue.h +108 -0
  1803. data/ext/libuv/src/random.c +123 -0
  1804. data/ext/libuv/src/strscpy.c +17 -0
  1805. data/ext/libuv/src/strscpy.h +18 -0
  1806. data/ext/libuv/src/threadpool.c +388 -0
  1807. data/ext/libuv/src/timer.c +181 -0
  1808. data/ext/libuv/src/unix/aix-common.c +337 -0
  1809. data/ext/libuv/src/unix/aix.c +1066 -0
  1810. data/ext/libuv/src/unix/android-ifaddrs.c +712 -0
  1811. data/ext/libuv/src/unix/async.c +298 -0
  1812. data/ext/libuv/src/unix/atomic-ops.h +59 -0
  1813. data/ext/libuv/src/unix/bsd-ifaddrs.c +161 -0
  1814. data/ext/libuv/src/unix/bsd-proctitle.c +93 -0
  1815. data/ext/libuv/src/unix/core.c +1571 -0
  1816. data/ext/libuv/src/unix/cygwin.c +53 -0
  1817. data/ext/libuv/src/unix/darwin-proctitle.c +202 -0
  1818. data/ext/libuv/src/unix/darwin.c +225 -0
  1819. data/ext/libuv/src/unix/dl.c +80 -0
  1820. data/ext/libuv/src/unix/freebsd.c +290 -0
  1821. data/ext/libuv/src/unix/fs.c +2044 -0
  1822. data/ext/libuv/src/unix/fsevents.c +924 -0
  1823. data/ext/libuv/src/unix/getaddrinfo.c +255 -0
  1824. data/ext/libuv/src/unix/getnameinfo.c +121 -0
  1825. data/ext/libuv/src/unix/haiku.c +167 -0
  1826. data/ext/libuv/src/unix/ibmi.c +249 -0
  1827. data/ext/libuv/src/unix/internal.h +331 -0
  1828. data/ext/libuv/src/unix/kqueue.c +544 -0
  1829. data/ext/libuv/src/unix/linux-core.c +1091 -0
  1830. data/ext/libuv/src/unix/linux-inotify.c +354 -0
  1831. data/ext/libuv/src/unix/linux-syscalls.c +394 -0
  1832. data/ext/libuv/src/unix/linux-syscalls.h +153 -0
  1833. data/ext/libuv/src/unix/loop-watcher.c +68 -0
  1834. data/ext/libuv/src/unix/loop.c +194 -0
  1835. data/ext/libuv/src/unix/netbsd.c +259 -0
  1836. data/ext/libuv/src/unix/no-fsevents.c +42 -0
  1837. data/ext/libuv/src/unix/no-proctitle.c +42 -0
  1838. data/ext/libuv/src/unix/openbsd.c +244 -0
  1839. data/ext/libuv/src/unix/os390-syscalls.c +519 -0
  1840. data/ext/libuv/src/unix/os390-syscalls.h +68 -0
  1841. data/ext/libuv/src/unix/os390.c +1003 -0
  1842. data/ext/libuv/src/unix/pipe.c +377 -0
  1843. data/ext/libuv/src/unix/poll.c +150 -0
  1844. data/ext/libuv/src/unix/posix-hrtime.c +35 -0
  1845. data/ext/libuv/src/unix/posix-poll.c +336 -0
  1846. data/ext/libuv/src/unix/process.c +603 -0
  1847. data/ext/libuv/src/unix/procfs-exepath.c +45 -0
  1848. data/ext/libuv/src/unix/proctitle.c +132 -0
  1849. data/ext/libuv/src/unix/pthread-fixes.c +56 -0
  1850. data/ext/libuv/src/unix/random-devurandom.c +93 -0
  1851. data/ext/libuv/src/unix/random-getentropy.c +57 -0
  1852. data/ext/libuv/src/unix/random-getrandom.c +88 -0
  1853. data/ext/libuv/src/unix/random-sysctl-linux.c +99 -0
  1854. data/ext/libuv/src/unix/signal.c +577 -0
  1855. data/ext/libuv/src/unix/spinlock.h +53 -0
  1856. data/ext/libuv/src/unix/stream.c +1697 -0
  1857. data/ext/libuv/src/unix/sunos.c +836 -0
  1858. data/ext/libuv/src/unix/sysinfo-loadavg.c +36 -0
  1859. data/ext/libuv/src/unix/sysinfo-memory.c +42 -0
  1860. data/ext/libuv/src/unix/tcp.c +450 -0
  1861. data/ext/libuv/src/unix/thread.c +852 -0
  1862. data/ext/libuv/src/unix/tty.c +381 -0
  1863. data/ext/libuv/src/unix/udp.c +1136 -0
  1864. data/ext/libuv/src/uv-common.c +812 -0
  1865. data/ext/libuv/src/uv-common.h +326 -0
  1866. data/ext/libuv/src/uv-data-getter-setters.c +98 -0
  1867. data/ext/libuv/src/version.c +45 -0
  1868. data/ext/libuv/src/win/async.c +98 -0
  1869. data/ext/libuv/src/win/atomicops-inl.h +57 -0
  1870. data/ext/libuv/src/win/core.c +657 -0
  1871. data/ext/libuv/src/win/detect-wakeup.c +35 -0
  1872. data/ext/libuv/src/win/dl.c +136 -0
  1873. data/ext/libuv/src/win/error.c +172 -0
  1874. data/ext/libuv/src/win/fs-event.c +589 -0
  1875. data/ext/libuv/src/win/fs-fd-hash-inl.h +178 -0
  1876. data/ext/libuv/src/win/fs.c +3238 -0
  1877. data/ext/libuv/src/win/getaddrinfo.c +463 -0
  1878. data/ext/libuv/src/win/getnameinfo.c +157 -0
  1879. data/ext/libuv/src/win/handle-inl.h +180 -0
  1880. data/ext/libuv/src/win/handle.c +162 -0
  1881. data/ext/libuv/src/win/internal.h +344 -0
  1882. data/ext/libuv/src/win/loop-watcher.c +122 -0
  1883. data/ext/libuv/src/win/pipe.c +2386 -0
  1884. data/ext/libuv/src/win/poll.c +643 -0
  1885. data/ext/libuv/src/win/process-stdio.c +512 -0
  1886. data/ext/libuv/src/win/process.c +1282 -0
  1887. data/ext/libuv/src/win/req-inl.h +221 -0
  1888. data/ext/libuv/src/win/signal.c +277 -0
  1889. data/ext/libuv/src/win/snprintf.c +42 -0
  1890. data/ext/libuv/src/win/stream-inl.h +54 -0
  1891. data/ext/libuv/src/win/stream.c +243 -0
  1892. data/ext/libuv/src/win/tcp.c +1520 -0
  1893. data/ext/libuv/src/win/thread.c +520 -0
  1894. data/ext/libuv/src/win/tty.c +2348 -0
  1895. data/ext/libuv/src/win/udp.c +1185 -0
  1896. data/ext/libuv/src/win/util.c +1879 -0
  1897. data/ext/libuv/src/win/winapi.c +149 -0
  1898. data/ext/libuv/src/win/winapi.h +4751 -0
  1899. data/ext/libuv/src/win/winsock.c +575 -0
  1900. data/ext/libuv/src/win/winsock.h +201 -0
  1901. data/ext/libuv/test/benchmark-async-pummel.c +119 -0
  1902. data/ext/libuv/test/benchmark-async.c +141 -0
  1903. data/ext/libuv/test/benchmark-fs-stat.c +136 -0
  1904. data/ext/libuv/test/benchmark-getaddrinfo.c +92 -0
  1905. data/ext/libuv/test/benchmark-list.h +163 -0
  1906. data/ext/libuv/test/benchmark-loop-count.c +92 -0
  1907. data/ext/libuv/test/benchmark-million-async.c +112 -0
  1908. data/ext/libuv/test/benchmark-million-timers.c +86 -0
  1909. data/ext/libuv/test/benchmark-multi-accept.c +447 -0
  1910. data/ext/libuv/test/benchmark-ping-pongs.c +221 -0
  1911. data/ext/libuv/test/benchmark-pound.c +351 -0
  1912. data/ext/libuv/test/benchmark-pump.c +476 -0
  1913. data/ext/libuv/test/benchmark-sizes.c +46 -0
  1914. data/ext/libuv/test/benchmark-spawn.c +164 -0
  1915. data/ext/libuv/test/benchmark-tcp-write-batch.c +144 -0
  1916. data/ext/libuv/test/benchmark-thread.c +64 -0
  1917. data/ext/libuv/test/benchmark-udp-pummel.c +243 -0
  1918. data/ext/libuv/test/blackhole-server.c +121 -0
  1919. data/ext/libuv/test/dns-server.c +340 -0
  1920. data/ext/libuv/test/echo-server.c +382 -0
  1921. data/ext/libuv/test/fixtures/empty_file +0 -0
  1922. data/ext/libuv/test/fixtures/load_error.node +1 -0
  1923. data/ext/libuv/test/fixtures/lorem_ipsum.txt +1 -0
  1924. data/ext/libuv/test/run-benchmarks.c +65 -0
  1925. data/ext/libuv/test/run-tests.c +239 -0
  1926. data/ext/libuv/test/runner-unix.c +450 -0
  1927. data/ext/libuv/test/runner-unix.h +36 -0
  1928. data/ext/libuv/test/runner-win.c +357 -0
  1929. data/ext/libuv/test/runner-win.h +41 -0
  1930. data/ext/libuv/test/runner.c +431 -0
  1931. data/ext/libuv/test/runner.h +176 -0
  1932. data/ext/libuv/test/task.h +238 -0
  1933. data/ext/libuv/test/test-active.c +84 -0
  1934. data/ext/libuv/test/test-async-null-cb.c +64 -0
  1935. data/ext/libuv/test/test-async.c +134 -0
  1936. data/ext/libuv/test/test-barrier.c +148 -0
  1937. data/ext/libuv/test/test-callback-order.c +77 -0
  1938. data/ext/libuv/test/test-callback-stack.c +204 -0
  1939. data/ext/libuv/test/test-close-fd.c +80 -0
  1940. data/ext/libuv/test/test-close-order.c +80 -0
  1941. data/ext/libuv/test/test-condvar.c +267 -0
  1942. data/ext/libuv/test/test-connect-unspecified.c +63 -0
  1943. data/ext/libuv/test/test-connection-fail.c +151 -0
  1944. data/ext/libuv/test/test-cwd-and-chdir.c +58 -0
  1945. data/ext/libuv/test/test-default-loop-close.c +59 -0
  1946. data/ext/libuv/test/test-delayed-accept.c +189 -0
  1947. data/ext/libuv/test/test-dlerror.c +61 -0
  1948. data/ext/libuv/test/test-eintr-handling.c +94 -0
  1949. data/ext/libuv/test/test-embed.c +139 -0
  1950. data/ext/libuv/test/test-emfile.c +121 -0
  1951. data/ext/libuv/test/test-env-vars.c +140 -0
  1952. data/ext/libuv/test/test-error.c +79 -0
  1953. data/ext/libuv/test/test-fail-always.c +29 -0
  1954. data/ext/libuv/test/test-fork.c +683 -0
  1955. data/ext/libuv/test/test-fs-copyfile.c +209 -0
  1956. data/ext/libuv/test/test-fs-event.c +1165 -0
  1957. data/ext/libuv/test/test-fs-fd-hash.c +133 -0
  1958. data/ext/libuv/test/test-fs-open-flags.c +435 -0
  1959. data/ext/libuv/test/test-fs-poll.c +300 -0
  1960. data/ext/libuv/test/test-fs-readdir.c +462 -0
  1961. data/ext/libuv/test/test-fs.c +4238 -0
  1962. data/ext/libuv/test/test-get-currentexe.c +86 -0
  1963. data/ext/libuv/test/test-get-loadavg.c +35 -0
  1964. data/ext/libuv/test/test-get-memory.c +40 -0
  1965. data/ext/libuv/test/test-get-passwd.c +86 -0
  1966. data/ext/libuv/test/test-getaddrinfo.c +191 -0
  1967. data/ext/libuv/test/test-gethostname.c +58 -0
  1968. data/ext/libuv/test/test-getnameinfo.c +101 -0
  1969. data/ext/libuv/test/test-getsockname.c +361 -0
  1970. data/ext/libuv/test/test-getters-setters.c +88 -0
  1971. data/ext/libuv/test/test-gettimeofday.c +39 -0
  1972. data/ext/libuv/test/test-handle-fileno.c +125 -0
  1973. data/ext/libuv/test/test-homedir.c +72 -0
  1974. data/ext/libuv/test/test-hrtime.c +52 -0
  1975. data/ext/libuv/test/test-idle.c +99 -0
  1976. data/ext/libuv/test/test-idna.c +195 -0
  1977. data/ext/libuv/test/test-ip4-addr.c +55 -0
  1978. data/ext/libuv/test/test-ip6-addr.c +171 -0
  1979. data/ext/libuv/test/test-ipc-heavy-traffic-deadlock-bug.c +159 -0
  1980. data/ext/libuv/test/test-ipc-send-recv.c +429 -0
  1981. data/ext/libuv/test/test-ipc.c +974 -0
  1982. data/ext/libuv/test/test-list.h +1064 -0
  1983. data/ext/libuv/test/test-loop-alive.c +67 -0
  1984. data/ext/libuv/test/test-loop-close.c +75 -0
  1985. data/ext/libuv/test/test-loop-configure.c +38 -0
  1986. data/ext/libuv/test/test-loop-handles.c +337 -0
  1987. data/ext/libuv/test/test-loop-stop.c +71 -0
  1988. data/ext/libuv/test/test-loop-time.c +63 -0
  1989. data/ext/libuv/test/test-multiple-listen.c +109 -0
  1990. data/ext/libuv/test/test-mutexes.c +182 -0
  1991. data/ext/libuv/test/test-osx-select.c +140 -0
  1992. data/ext/libuv/test/test-pass-always.c +28 -0
  1993. data/ext/libuv/test/test-ping-pong.c +301 -0
  1994. data/ext/libuv/test/test-pipe-bind-error.c +139 -0
  1995. data/ext/libuv/test/test-pipe-close-stdout-read-stdin.c +112 -0
  1996. data/ext/libuv/test/test-pipe-connect-error.c +95 -0
  1997. data/ext/libuv/test/test-pipe-connect-multiple.c +107 -0
  1998. data/ext/libuv/test/test-pipe-connect-prepare.c +83 -0
  1999. data/ext/libuv/test/test-pipe-getsockname.c +266 -0
  2000. data/ext/libuv/test/test-pipe-pending-instances.c +59 -0
  2001. data/ext/libuv/test/test-pipe-sendmsg.c +172 -0
  2002. data/ext/libuv/test/test-pipe-server-close.c +94 -0
  2003. data/ext/libuv/test/test-pipe-set-fchmod.c +90 -0
  2004. data/ext/libuv/test/test-pipe-set-non-blocking.c +99 -0
  2005. data/ext/libuv/test/test-platform-output.c +170 -0
  2006. data/ext/libuv/test/test-poll-close-doesnt-corrupt-stack.c +114 -0
  2007. data/ext/libuv/test/test-poll-close.c +73 -0
  2008. data/ext/libuv/test/test-poll-closesocket.c +92 -0
  2009. data/ext/libuv/test/test-poll-oob.c +210 -0
  2010. data/ext/libuv/test/test-poll.c +668 -0
  2011. data/ext/libuv/test/test-process-priority.c +83 -0
  2012. data/ext/libuv/test/test-process-title-threadsafe.c +89 -0
  2013. data/ext/libuv/test/test-process-title.c +76 -0
  2014. data/ext/libuv/test/test-queue-foreach-delete.c +204 -0
  2015. data/ext/libuv/test/test-random.c +94 -0
  2016. data/ext/libuv/test/test-ref.c +445 -0
  2017. data/ext/libuv/test/test-run-nowait.c +45 -0
  2018. data/ext/libuv/test/test-run-once.c +48 -0
  2019. data/ext/libuv/test/test-semaphore.c +111 -0
  2020. data/ext/libuv/test/test-shutdown-close.c +108 -0
  2021. data/ext/libuv/test/test-shutdown-eof.c +182 -0
  2022. data/ext/libuv/test/test-shutdown-twice.c +85 -0
  2023. data/ext/libuv/test/test-signal-multiple-loops.c +302 -0
  2024. data/ext/libuv/test/test-signal-pending-on-close.c +94 -0
  2025. data/ext/libuv/test/test-signal.c +325 -0
  2026. data/ext/libuv/test/test-socket-buffer-size.c +77 -0
  2027. data/ext/libuv/test/test-spawn.c +1924 -0
  2028. data/ext/libuv/test/test-stdio-over-pipes.c +256 -0
  2029. data/ext/libuv/test/test-strscpy.c +53 -0
  2030. data/ext/libuv/test/test-tcp-alloc-cb-fail.c +123 -0
  2031. data/ext/libuv/test/test-tcp-bind-error.c +254 -0
  2032. data/ext/libuv/test/test-tcp-bind6-error.c +176 -0
  2033. data/ext/libuv/test/test-tcp-close-accept.c +198 -0
  2034. data/ext/libuv/test/test-tcp-close-reset.c +290 -0
  2035. data/ext/libuv/test/test-tcp-close-while-connecting.c +97 -0
  2036. data/ext/libuv/test/test-tcp-close.c +136 -0
  2037. data/ext/libuv/test/test-tcp-connect-error-after-write.c +98 -0
  2038. data/ext/libuv/test/test-tcp-connect-error.c +73 -0
  2039. data/ext/libuv/test/test-tcp-connect-timeout.c +91 -0
  2040. data/ext/libuv/test/test-tcp-connect6-error.c +71 -0
  2041. data/ext/libuv/test/test-tcp-create-socket-early.c +209 -0
  2042. data/ext/libuv/test/test-tcp-flags.c +52 -0
  2043. data/ext/libuv/test/test-tcp-oob.c +146 -0
  2044. data/ext/libuv/test/test-tcp-open.c +400 -0
  2045. data/ext/libuv/test/test-tcp-read-stop.c +76 -0
  2046. data/ext/libuv/test/test-tcp-shutdown-after-write.c +138 -0
  2047. data/ext/libuv/test/test-tcp-try-write-error.c +109 -0
  2048. data/ext/libuv/test/test-tcp-try-write.c +135 -0
  2049. data/ext/libuv/test/test-tcp-unexpected-read.c +117 -0
  2050. data/ext/libuv/test/test-tcp-write-after-connect.c +72 -0
  2051. data/ext/libuv/test/test-tcp-write-fail.c +115 -0
  2052. data/ext/libuv/test/test-tcp-write-queue-order.c +139 -0
  2053. data/ext/libuv/test/test-tcp-write-to-half-open-connection.c +141 -0
  2054. data/ext/libuv/test/test-tcp-writealot.c +180 -0
  2055. data/ext/libuv/test/test-thread-equal.c +45 -0
  2056. data/ext/libuv/test/test-thread.c +286 -0
  2057. data/ext/libuv/test/test-threadpool-cancel.c +349 -0
  2058. data/ext/libuv/test/test-threadpool.c +76 -0
  2059. data/ext/libuv/test/test-timer-again.c +141 -0
  2060. data/ext/libuv/test/test-timer-from-check.c +80 -0
  2061. data/ext/libuv/test/test-timer.c +343 -0
  2062. data/ext/libuv/test/test-tmpdir.c +82 -0
  2063. data/ext/libuv/test/test-tty-duplicate-key.c +321 -0
  2064. data/ext/libuv/test/test-tty.c +464 -0
  2065. data/ext/libuv/test/test-udp-alloc-cb-fail.c +196 -0
  2066. data/ext/libuv/test/test-udp-bind.c +93 -0
  2067. data/ext/libuv/test/test-udp-connect.c +182 -0
  2068. data/ext/libuv/test/test-udp-create-socket-early.c +135 -0
  2069. data/ext/libuv/test/test-udp-dgram-too-big.c +91 -0
  2070. data/ext/libuv/test/test-udp-ipv6.c +200 -0
  2071. data/ext/libuv/test/test-udp-multicast-interface.c +99 -0
  2072. data/ext/libuv/test/test-udp-multicast-interface6.c +103 -0
  2073. data/ext/libuv/test/test-udp-multicast-join.c +181 -0
  2074. data/ext/libuv/test/test-udp-multicast-join6.c +215 -0
  2075. data/ext/libuv/test/test-udp-multicast-ttl.c +94 -0
  2076. data/ext/libuv/test/test-udp-open.c +350 -0
  2077. data/ext/libuv/test/test-udp-options.c +156 -0
  2078. data/ext/libuv/test/test-udp-send-and-recv.c +212 -0
  2079. data/ext/libuv/test/test-udp-send-hang-loop.c +99 -0
  2080. data/ext/libuv/test/test-udp-send-immediate.c +148 -0
  2081. data/ext/libuv/test/test-udp-send-unreachable.c +150 -0
  2082. data/ext/libuv/test/test-udp-try-send.c +121 -0
  2083. data/ext/libuv/test/test-uname.c +69 -0
  2084. data/ext/libuv/test/test-walk-handles.c +77 -0
  2085. data/ext/libuv/test/test-watcher-cross-stop.c +111 -0
  2086. data/ext/libuv/test/test.gyp +293 -0
  2087. data/ext/libuv/tools/make_dist_html.py +124 -0
  2088. data/ext/libuv/tools/vswhere_usability_wrapper.cmd +33 -0
  2089. data/ext/libuv/uv.gyp +368 -0
  2090. data/ext/libuv/vcbuild.bat +184 -0
  2091. data/lib/mt-libuv/tcp.rb +2 -2
  2092. data/lib/mt-libuv/version.rb +1 -1
  2093. data/mt-libuv.gemspec +26 -26
  2094. metadata +2089 -2
@@ -0,0 +1,2995 @@
1
+ # Copyright (c) 2012 Google Inc. All rights reserved.
2
+ # Use of this source code is governed by a BSD-style license that can be
3
+ # found in the LICENSE file.
4
+
5
+ """Xcode project file generator.
6
+
7
+ This module is both an Xcode project file generator and a documentation of the
8
+ Xcode project file format. Knowledge of the project file format was gained
9
+ based on extensive experience with Xcode, and by making changes to projects in
10
+ Xcode.app and observing the resultant changes in the associated project files.
11
+
12
+ XCODE PROJECT FILES
13
+
14
+ The generator targets the file format as written by Xcode 3.2 (specifically,
15
+ 3.2.6), but past experience has taught that the format has not changed
16
+ significantly in the past several years, and future versions of Xcode are able
17
+ to read older project files.
18
+
19
+ Xcode project files are "bundled": the project "file" from an end-user's
20
+ perspective is actually a directory with an ".xcodeproj" extension. The
21
+ project file from this module's perspective is actually a file inside this
22
+ directory, always named "project.pbxproj". This file contains a complete
23
+ description of the project and is all that is needed to use the xcodeproj.
24
+ Other files contained in the xcodeproj directory are simply used to store
25
+ per-user settings, such as the state of various UI elements in the Xcode
26
+ application.
27
+
28
+ The project.pbxproj file is a property list, stored in a format almost
29
+ identical to the NeXTstep property list format. The file is able to carry
30
+ Unicode data, and is encoded in UTF-8. The root element in the property list
31
+ is a dictionary that contains several properties of minimal interest, and two
32
+ properties of immense interest. The most important property is a dictionary
33
+ named "objects". The entire structure of the project is represented by the
34
+ children of this property. The objects dictionary is keyed by unique 96-bit
35
+ values represented by 24 uppercase hexadecimal characters. Each value in the
36
+ objects dictionary is itself a dictionary, describing an individual object.
37
+
38
+ Each object in the dictionary is a member of a class, which is identified by
39
+ the "isa" property of each object. A variety of classes are represented in a
40
+ project file. Objects can refer to other objects by ID, using the 24-character
41
+ hexadecimal object key. A project's objects form a tree, with a root object
42
+ of class PBXProject at the root. As an example, the PBXProject object serves
43
+ as parent to an XCConfigurationList object defining the build configurations
44
+ used in the project, a PBXGroup object serving as a container for all files
45
+ referenced in the project, and a list of target objects, each of which defines
46
+ a target in the project. There are several different types of target object,
47
+ such as PBXNativeTarget and PBXAggregateTarget. In this module, this
48
+ relationship is expressed by having each target type derive from an abstract
49
+ base named XCTarget.
50
+
51
+ The project.pbxproj file's root dictionary also contains a property, sibling to
52
+ the "objects" dictionary, named "rootObject". The value of rootObject is a
53
+ 24-character object key referring to the root PBXProject object in the
54
+ objects dictionary.
55
+
56
+ In Xcode, every file used as input to a target or produced as a final product
57
+ of a target must appear somewhere in the hierarchy rooted at the PBXGroup
58
+ object referenced by the PBXProject's mainGroup property. A PBXGroup is
59
+ generally represented as a folder in the Xcode application. PBXGroups can
60
+ contain other PBXGroups as well as PBXFileReferences, which are pointers to
61
+ actual files.
62
+
63
+ Each XCTarget contains a list of build phases, represented in this module by
64
+ the abstract base XCBuildPhase. Examples of concrete XCBuildPhase derivations
65
+ are PBXSourcesBuildPhase and PBXFrameworksBuildPhase, which correspond to the
66
+ "Compile Sources" and "Link Binary With Libraries" phases displayed in the
67
+ Xcode application. Files used as input to these phases (for example, source
68
+ files in the former case and libraries and frameworks in the latter) are
69
+ represented by PBXBuildFile objects, referenced by elements of "files" lists
70
+ in XCTarget objects. Each PBXBuildFile object refers to a PBXBuildFile
71
+ object as a "weak" reference: it does not "own" the PBXBuildFile, which is
72
+ owned by the root object's mainGroup or a descendant group. In most cases, the
73
+ layer of indirection between an XCBuildPhase and a PBXFileReference via a
74
+ PBXBuildFile appears extraneous, but there's actually one reason for this:
75
+ file-specific compiler flags are added to the PBXBuildFile object so as to
76
+ allow a single file to be a member of multiple targets while having distinct
77
+ compiler flags for each. These flags can be modified in the Xcode applciation
78
+ in the "Build" tab of a File Info window.
79
+
80
+ When a project is open in the Xcode application, Xcode will rewrite it. As
81
+ such, this module is careful to adhere to the formatting used by Xcode, to
82
+ avoid insignificant changes appearing in the file when it is used in the
83
+ Xcode application. This will keep version control repositories happy, and
84
+ makes it possible to compare a project file used in Xcode to one generated by
85
+ this module to determine if any significant changes were made in the
86
+ application.
87
+
88
+ Xcode has its own way of assigning 24-character identifiers to each object,
89
+ which is not duplicated here. Because the identifier only is only generated
90
+ once, when an object is created, and is then left unchanged, there is no need
91
+ to attempt to duplicate Xcode's behavior in this area. The generator is free
92
+ to select any identifier, even at random, to refer to the objects it creates,
93
+ and Xcode will retain those identifiers and use them when subsequently
94
+ rewriting the project file. However, the generator would choose new random
95
+ identifiers each time the project files are generated, leading to difficulties
96
+ comparing "used" project files to "pristine" ones produced by this module,
97
+ and causing the appearance of changes as every object identifier is changed
98
+ when updated projects are checked in to a version control repository. To
99
+ mitigate this problem, this module chooses identifiers in a more deterministic
100
+ way, by hashing a description of each object as well as its parent and ancestor
101
+ objects. This strategy should result in minimal "shift" in IDs as successive
102
+ generations of project files are produced.
103
+
104
+ THIS MODULE
105
+
106
+ This module introduces several classes, all derived from the XCObject class.
107
+ Nearly all of the "brains" are built into the XCObject class, which understands
108
+ how to create and modify objects, maintain the proper tree structure, compute
109
+ identifiers, and print objects. For the most part, classes derived from
110
+ XCObject need only provide a _schema class object, a dictionary that
111
+ expresses what properties objects of the class may contain.
112
+
113
+ Given this structure, it's possible to build a minimal project file by creating
114
+ objects of the appropriate types and making the proper connections:
115
+
116
+ config_list = XCConfigurationList()
117
+ group = PBXGroup()
118
+ project = PBXProject({'buildConfigurationList': config_list,
119
+ 'mainGroup': group})
120
+
121
+ With the project object set up, it can be added to an XCProjectFile object.
122
+ XCProjectFile is a pseudo-class in the sense that it is a concrete XCObject
123
+ subclass that does not actually correspond to a class type found in a project
124
+ file. Rather, it is used to represent the project file's root dictionary.
125
+ Printing an XCProjectFile will print the entire project file, including the
126
+ full "objects" dictionary.
127
+
128
+ project_file = XCProjectFile({'rootObject': project})
129
+ project_file.ComputeIDs()
130
+ project_file.Print()
131
+
132
+ Xcode project files are always encoded in UTF-8. This module will accept
133
+ strings of either the str class or the unicode class. Strings of class str
134
+ are assumed to already be encoded in UTF-8. Obviously, if you're just using
135
+ ASCII, you won't encounter difficulties because ASCII is a UTF-8 subset.
136
+ Strings of class unicode are handled properly and encoded in UTF-8 when
137
+ a project file is output.
138
+ """
139
+
140
+ import functools
141
+ import gyp.common
142
+ import posixpath
143
+ import re
144
+ import struct
145
+ import sys
146
+
147
+ # hashlib is supplied as of Python 2.5 as the replacement interface for sha
148
+ # and other secure hashes. In 2.6, sha is deprecated. Import hashlib if
149
+ # available, avoiding a deprecation warning under 2.6. Import sha otherwise,
150
+ # preserving 2.4 compatibility.
151
+ try:
152
+ import hashlib
153
+ _new_sha1 = hashlib.sha1
154
+ except ImportError:
155
+ import sha
156
+ _new_sha1 = sha.new
157
+
158
+ try:
159
+ # basestring was removed in python3.
160
+ basestring
161
+ except NameError:
162
+ basestring = str
163
+
164
+ try:
165
+ # cmp was removed in python3.
166
+ cmp
167
+ except NameError:
168
+ def cmp(a, b):
169
+ return (a > b) - (a < b)
170
+
171
+ # See XCObject._EncodeString. This pattern is used to determine when a string
172
+ # can be printed unquoted. Strings that match this pattern may be printed
173
+ # unquoted. Strings that do not match must be quoted and may be further
174
+ # transformed to be properly encoded. Note that this expression matches the
175
+ # characters listed with "+", for 1 or more occurrences: if a string is empty,
176
+ # it must not match this pattern, because it needs to be encoded as "".
177
+ _unquoted = re.compile('^[A-Za-z0-9$./_]+$')
178
+
179
+ # Strings that match this pattern are quoted regardless of what _unquoted says.
180
+ # Oddly, Xcode will quote any string with a run of three or more underscores.
181
+ _quoted = re.compile('___')
182
+
183
+ # This pattern should match any character that needs to be escaped by
184
+ # XCObject._EncodeString. See that function.
185
+ _escaped = re.compile('[\\\\"]|[\x00-\x1f]')
186
+
187
+
188
+ # Used by SourceTreeAndPathFromPath
189
+ _path_leading_variable = re.compile(r'^\$\((.*?)\)(/(.*))?$')
190
+
191
+ def SourceTreeAndPathFromPath(input_path):
192
+ """Given input_path, returns a tuple with sourceTree and path values.
193
+
194
+ Examples:
195
+ input_path (source_tree, output_path)
196
+ '$(VAR)/path' ('VAR', 'path')
197
+ '$(VAR)' ('VAR', None)
198
+ 'path' (None, 'path')
199
+ """
200
+
201
+ source_group_match = _path_leading_variable.match(input_path)
202
+ if source_group_match:
203
+ source_tree = source_group_match.group(1)
204
+ output_path = source_group_match.group(3) # This may be None.
205
+ else:
206
+ source_tree = None
207
+ output_path = input_path
208
+
209
+ return (source_tree, output_path)
210
+
211
+ def ConvertVariablesToShellSyntax(input_string):
212
+ return re.sub(r'\$\((.*?)\)', '${\\1}', input_string)
213
+
214
+ class XCObject(object):
215
+ """The abstract base of all class types used in Xcode project files.
216
+
217
+ Class variables:
218
+ _schema: A dictionary defining the properties of this class. The keys to
219
+ _schema are string property keys as used in project files. Values
220
+ are a list of four or five elements:
221
+ [ is_list, property_type, is_strong, is_required, default ]
222
+ is_list: True if the property described is a list, as opposed
223
+ to a single element.
224
+ property_type: The type to use as the value of the property,
225
+ or if is_list is True, the type to use for each
226
+ element of the value's list. property_type must
227
+ be an XCObject subclass, or one of the built-in
228
+ types str, int, or dict.
229
+ is_strong: If property_type is an XCObject subclass, is_strong
230
+ is True to assert that this class "owns," or serves
231
+ as parent, to the property value (or, if is_list is
232
+ True, values). is_strong must be False if
233
+ property_type is not an XCObject subclass.
234
+ is_required: True if the property is required for the class.
235
+ Note that is_required being True does not preclude
236
+ an empty string ("", in the case of property_type
237
+ str) or list ([], in the case of is_list True) from
238
+ being set for the property.
239
+ default: Optional. If is_requried is True, default may be set
240
+ to provide a default value for objects that do not supply
241
+ their own value. If is_required is True and default
242
+ is not provided, users of the class must supply their own
243
+ value for the property.
244
+ Note that although the values of the array are expressed in
245
+ boolean terms, subclasses provide values as integers to conserve
246
+ horizontal space.
247
+ _should_print_single_line: False in XCObject. Subclasses whose objects
248
+ should be written to the project file in the
249
+ alternate single-line format, such as
250
+ PBXFileReference and PBXBuildFile, should
251
+ set this to True.
252
+ _encode_transforms: Used by _EncodeString to encode unprintable characters.
253
+ The index into this list is the ordinal of the
254
+ character to transform; each value is a string
255
+ used to represent the character in the output. XCObject
256
+ provides an _encode_transforms list suitable for most
257
+ XCObject subclasses.
258
+ _alternate_encode_transforms: Provided for subclasses that wish to use
259
+ the alternate encoding rules. Xcode seems
260
+ to use these rules when printing objects in
261
+ single-line format. Subclasses that desire
262
+ this behavior should set _encode_transforms
263
+ to _alternate_encode_transforms.
264
+ _hashables: A list of XCObject subclasses that can be hashed by ComputeIDs
265
+ to construct this object's ID. Most classes that need custom
266
+ hashing behavior should do it by overriding Hashables,
267
+ but in some cases an object's parent may wish to push a
268
+ hashable value into its child, and it can do so by appending
269
+ to _hashables.
270
+ Attributes:
271
+ id: The object's identifier, a 24-character uppercase hexadecimal string.
272
+ Usually, objects being created should not set id until the entire
273
+ project file structure is built. At that point, UpdateIDs() should
274
+ be called on the root object to assign deterministic values for id to
275
+ each object in the tree.
276
+ parent: The object's parent. This is set by a parent XCObject when a child
277
+ object is added to it.
278
+ _properties: The object's property dictionary. An object's properties are
279
+ described by its class' _schema variable.
280
+ """
281
+
282
+ _schema = {}
283
+ _should_print_single_line = False
284
+
285
+ # See _EncodeString.
286
+ _encode_transforms = []
287
+ i = 0
288
+ while i < ord(' '):
289
+ _encode_transforms.append('\\U%04x' % i)
290
+ i = i + 1
291
+ _encode_transforms[7] = '\\a'
292
+ _encode_transforms[8] = '\\b'
293
+ _encode_transforms[9] = '\\t'
294
+ _encode_transforms[10] = '\\n'
295
+ _encode_transforms[11] = '\\v'
296
+ _encode_transforms[12] = '\\f'
297
+ _encode_transforms[13] = '\\n'
298
+
299
+ _alternate_encode_transforms = list(_encode_transforms)
300
+ _alternate_encode_transforms[9] = chr(9)
301
+ _alternate_encode_transforms[10] = chr(10)
302
+ _alternate_encode_transforms[11] = chr(11)
303
+
304
+ def __init__(self, properties=None, id=None, parent=None):
305
+ self.id = id
306
+ self.parent = parent
307
+ self._properties = {}
308
+ self._hashables = []
309
+ self._SetDefaultsFromSchema()
310
+ self.UpdateProperties(properties)
311
+
312
+ def __repr__(self):
313
+ try:
314
+ name = self.Name()
315
+ except NotImplementedError:
316
+ return '<%s at 0x%x>' % (self.__class__.__name__, id(self))
317
+ return '<%s %r at 0x%x>' % (self.__class__.__name__, name, id(self))
318
+
319
+ def Copy(self):
320
+ """Make a copy of this object.
321
+
322
+ The new object will have its own copy of lists and dicts. Any XCObject
323
+ objects owned by this object (marked "strong") will be copied in the
324
+ new object, even those found in lists. If this object has any weak
325
+ references to other XCObjects, the same references are added to the new
326
+ object without making a copy.
327
+ """
328
+
329
+ that = self.__class__(id=self.id, parent=self.parent)
330
+ for key, value in self._properties.items():
331
+ is_strong = self._schema[key][2]
332
+
333
+ if isinstance(value, XCObject):
334
+ if is_strong:
335
+ new_value = value.Copy()
336
+ new_value.parent = that
337
+ that._properties[key] = new_value
338
+ else:
339
+ that._properties[key] = value
340
+ elif isinstance(value, basestring) or isinstance(value, int):
341
+ that._properties[key] = value
342
+ elif isinstance(value, list):
343
+ if is_strong:
344
+ # If is_strong is True, each element is an XCObject, so it's safe to
345
+ # call Copy.
346
+ that._properties[key] = []
347
+ for item in value:
348
+ new_item = item.Copy()
349
+ new_item.parent = that
350
+ that._properties[key].append(new_item)
351
+ else:
352
+ that._properties[key] = value[:]
353
+ elif isinstance(value, dict):
354
+ # dicts are never strong.
355
+ if is_strong:
356
+ raise TypeError('Strong dict for key ' + key + ' in ' + \
357
+ self.__class__.__name__)
358
+ else:
359
+ that._properties[key] = value.copy()
360
+ else:
361
+ raise TypeError('Unexpected type ' + value.__class__.__name__ + \
362
+ ' for key ' + key + ' in ' + self.__class__.__name__)
363
+
364
+ return that
365
+
366
+ def Name(self):
367
+ """Return the name corresponding to an object.
368
+
369
+ Not all objects necessarily need to be nameable, and not all that do have
370
+ a "name" property. Override as needed.
371
+ """
372
+
373
+ # If the schema indicates that "name" is required, try to access the
374
+ # property even if it doesn't exist. This will result in a KeyError
375
+ # being raised for the property that should be present, which seems more
376
+ # appropriate than NotImplementedError in this case.
377
+ if 'name' in self._properties or \
378
+ ('name' in self._schema and self._schema['name'][3]):
379
+ return self._properties['name']
380
+
381
+ raise NotImplementedError(self.__class__.__name__ + ' must implement Name')
382
+
383
+ def Comment(self):
384
+ """Return a comment string for the object.
385
+
386
+ Most objects just use their name as the comment, but PBXProject uses
387
+ different values.
388
+
389
+ The returned comment is not escaped and does not have any comment marker
390
+ strings applied to it.
391
+ """
392
+
393
+ return self.Name()
394
+
395
+ def Hashables(self):
396
+ hashables = [self.__class__.__name__]
397
+
398
+ name = self.Name()
399
+ if name != None:
400
+ hashables.append(name)
401
+
402
+ hashables.extend(self._hashables)
403
+
404
+ return hashables
405
+
406
+ def HashablesForChild(self):
407
+ return None
408
+
409
+ def ComputeIDs(self, recursive=True, overwrite=True, seed_hash=None):
410
+ """Set "id" properties deterministically.
411
+
412
+ An object's "id" property is set based on a hash of its class type and
413
+ name, as well as the class type and name of all ancestor objects. As
414
+ such, it is only advisable to call ComputeIDs once an entire project file
415
+ tree is built.
416
+
417
+ If recursive is True, recurse into all descendant objects and update their
418
+ hashes.
419
+
420
+ If overwrite is True, any existing value set in the "id" property will be
421
+ replaced.
422
+ """
423
+
424
+ def _HashUpdate(hash, data):
425
+ """Update hash with data's length and contents.
426
+
427
+ If the hash were updated only with the value of data, it would be
428
+ possible for clowns to induce collisions by manipulating the names of
429
+ their objects. By adding the length, it's exceedingly less likely that
430
+ ID collisions will be encountered, intentionally or not.
431
+ """
432
+
433
+ hash.update(struct.pack('>i', len(data)))
434
+ hash.update(data.encode('utf-8'))
435
+
436
+ if seed_hash is None:
437
+ seed_hash = _new_sha1()
438
+
439
+ hash = seed_hash.copy()
440
+
441
+ hashables = self.Hashables()
442
+ assert len(hashables) > 0
443
+ for hashable in hashables:
444
+ _HashUpdate(hash, hashable)
445
+
446
+ if recursive:
447
+ hashables_for_child = self.HashablesForChild()
448
+ if hashables_for_child is None:
449
+ child_hash = hash
450
+ else:
451
+ assert len(hashables_for_child) > 0
452
+ child_hash = seed_hash.copy()
453
+ for hashable in hashables_for_child:
454
+ _HashUpdate(child_hash, hashable)
455
+
456
+ for child in self.Children():
457
+ child.ComputeIDs(recursive, overwrite, child_hash)
458
+
459
+ if overwrite or self.id is None:
460
+ # Xcode IDs are only 96 bits (24 hex characters), but a SHA-1 digest is
461
+ # is 160 bits. Instead of throwing out 64 bits of the digest, xor them
462
+ # into the portion that gets used.
463
+ assert hash.digest_size % 4 == 0
464
+ digest_int_count = hash.digest_size // 4
465
+ digest_ints = struct.unpack('>' + 'I' * digest_int_count, hash.digest())
466
+ id_ints = [0, 0, 0]
467
+ for index in range(0, digest_int_count):
468
+ id_ints[index % 3] ^= digest_ints[index]
469
+ self.id = '%08X%08X%08X' % tuple(id_ints)
470
+
471
+ def EnsureNoIDCollisions(self):
472
+ """Verifies that no two objects have the same ID. Checks all descendants.
473
+ """
474
+
475
+ ids = {}
476
+ descendants = self.Descendants()
477
+ for descendant in descendants:
478
+ if descendant.id in ids:
479
+ other = ids[descendant.id]
480
+ raise KeyError(
481
+ 'Duplicate ID %s, objects "%s" and "%s" in "%s"' % \
482
+ (descendant.id, str(descendant._properties),
483
+ str(other._properties), self._properties['rootObject'].Name()))
484
+ ids[descendant.id] = descendant
485
+
486
+ def Children(self):
487
+ """Returns a list of all of this object's owned (strong) children."""
488
+
489
+ children = []
490
+ for property, attributes in self._schema.items():
491
+ (is_list, property_type, is_strong) = attributes[0:3]
492
+ if is_strong and property in self._properties:
493
+ if not is_list:
494
+ children.append(self._properties[property])
495
+ else:
496
+ children.extend(self._properties[property])
497
+ return children
498
+
499
+ def Descendants(self):
500
+ """Returns a list of all of this object's descendants, including this
501
+ object.
502
+ """
503
+
504
+ children = self.Children()
505
+ descendants = [self]
506
+ for child in children:
507
+ descendants.extend(child.Descendants())
508
+ return descendants
509
+
510
+ def PBXProjectAncestor(self):
511
+ # The base case for recursion is defined at PBXProject.PBXProjectAncestor.
512
+ if self.parent:
513
+ return self.parent.PBXProjectAncestor()
514
+ return None
515
+
516
+ def _EncodeComment(self, comment):
517
+ """Encodes a comment to be placed in the project file output, mimicing
518
+ Xcode behavior.
519
+ """
520
+
521
+ # This mimics Xcode behavior by wrapping the comment in "/*" and "*/". If
522
+ # the string already contains a "*/", it is turned into "(*)/". This keeps
523
+ # the file writer from outputting something that would be treated as the
524
+ # end of a comment in the middle of something intended to be entirely a
525
+ # comment.
526
+
527
+ return '/* ' + comment.replace('*/', '(*)/') + ' */'
528
+
529
+ def _EncodeTransform(self, match):
530
+ # This function works closely with _EncodeString. It will only be called
531
+ # by re.sub with match.group(0) containing a character matched by the
532
+ # the _escaped expression.
533
+ char = match.group(0)
534
+
535
+ # Backslashes (\) and quotation marks (") are always replaced with a
536
+ # backslash-escaped version of the same. Everything else gets its
537
+ # replacement from the class' _encode_transforms array.
538
+ if char == '\\':
539
+ return '\\\\'
540
+ if char == '"':
541
+ return '\\"'
542
+ return self._encode_transforms[ord(char)]
543
+
544
+ def _EncodeString(self, value):
545
+ """Encodes a string to be placed in the project file output, mimicing
546
+ Xcode behavior.
547
+ """
548
+
549
+ # Use quotation marks when any character outside of the range A-Z, a-z, 0-9,
550
+ # $ (dollar sign), . (period), and _ (underscore) is present. Also use
551
+ # quotation marks to represent empty strings.
552
+ #
553
+ # Escape " (double-quote) and \ (backslash) by preceding them with a
554
+ # backslash.
555
+ #
556
+ # Some characters below the printable ASCII range are encoded specially:
557
+ # 7 ^G BEL is encoded as "\a"
558
+ # 8 ^H BS is encoded as "\b"
559
+ # 11 ^K VT is encoded as "\v"
560
+ # 12 ^L NP is encoded as "\f"
561
+ # 127 ^? DEL is passed through as-is without escaping
562
+ # - In PBXFileReference and PBXBuildFile objects:
563
+ # 9 ^I HT is passed through as-is without escaping
564
+ # 10 ^J NL is passed through as-is without escaping
565
+ # 13 ^M CR is passed through as-is without escaping
566
+ # - In other objects:
567
+ # 9 ^I HT is encoded as "\t"
568
+ # 10 ^J NL is encoded as "\n"
569
+ # 13 ^M CR is encoded as "\n" rendering it indistinguishable from
570
+ # 10 ^J NL
571
+ # All other characters within the ASCII control character range (0 through
572
+ # 31 inclusive) are encoded as "\U001f" referring to the Unicode code point
573
+ # in hexadecimal. For example, character 14 (^N SO) is encoded as "\U000e".
574
+ # Characters above the ASCII range are passed through to the output encoded
575
+ # as UTF-8 without any escaping. These mappings are contained in the
576
+ # class' _encode_transforms list.
577
+
578
+ if _unquoted.search(value) and not _quoted.search(value):
579
+ return value
580
+
581
+ return '"' + _escaped.sub(self._EncodeTransform, value) + '"'
582
+
583
+ def _XCPrint(self, file, tabs, line):
584
+ file.write('\t' * tabs + line)
585
+
586
+ def _XCPrintableValue(self, tabs, value, flatten_list=False):
587
+ """Returns a representation of value that may be printed in a project file,
588
+ mimicing Xcode's behavior.
589
+
590
+ _XCPrintableValue can handle str and int values, XCObjects (which are
591
+ made printable by returning their id property), and list and dict objects
592
+ composed of any of the above types. When printing a list or dict, and
593
+ _should_print_single_line is False, the tabs parameter is used to determine
594
+ how much to indent the lines corresponding to the items in the list or
595
+ dict.
596
+
597
+ If flatten_list is True, single-element lists will be transformed into
598
+ strings.
599
+ """
600
+
601
+ printable = ''
602
+ comment = None
603
+
604
+ if self._should_print_single_line:
605
+ sep = ' '
606
+ element_tabs = ''
607
+ end_tabs = ''
608
+ else:
609
+ sep = '\n'
610
+ element_tabs = '\t' * (tabs + 1)
611
+ end_tabs = '\t' * tabs
612
+
613
+ if isinstance(value, XCObject):
614
+ printable += value.id
615
+ comment = value.Comment()
616
+ elif isinstance(value, str):
617
+ printable += self._EncodeString(value)
618
+ # A python3 compatible way of saying isinstance(value, unicode).
619
+ # basestring is str in python3 so this is equivalent to the above
620
+ # isinstance. Thus if it failed above it will fail here.
621
+ # In python2 we test against str and unicode at this point. str has already
622
+ # failed in the above isinstance so we test against unicode.
623
+ elif isinstance(value, basestring):
624
+ printable += self._EncodeString(value.encode('utf-8'))
625
+ elif isinstance(value, int):
626
+ printable += str(value)
627
+ elif isinstance(value, list):
628
+ if flatten_list and len(value) <= 1:
629
+ if len(value) == 0:
630
+ printable += self._EncodeString('')
631
+ else:
632
+ printable += self._EncodeString(value[0])
633
+ else:
634
+ printable = '(' + sep
635
+ for item in value:
636
+ printable += element_tabs + \
637
+ self._XCPrintableValue(tabs + 1, item, flatten_list) + \
638
+ ',' + sep
639
+ printable += end_tabs + ')'
640
+ elif isinstance(value, dict):
641
+ printable = '{' + sep
642
+ for item_key, item_value in sorted(value.items()):
643
+ printable += element_tabs + \
644
+ self._XCPrintableValue(tabs + 1, item_key, flatten_list) + ' = ' + \
645
+ self._XCPrintableValue(tabs + 1, item_value, flatten_list) + ';' + \
646
+ sep
647
+ printable += end_tabs + '}'
648
+ else:
649
+ raise TypeError("Can't make " + value.__class__.__name__ + ' printable')
650
+
651
+ if comment != None:
652
+ printable += ' ' + self._EncodeComment(comment)
653
+
654
+ return printable
655
+
656
+ def _XCKVPrint(self, file, tabs, key, value):
657
+ """Prints a key and value, members of an XCObject's _properties dictionary,
658
+ to file.
659
+
660
+ tabs is an int identifying the indentation level. If the class'
661
+ _should_print_single_line variable is True, tabs is ignored and the
662
+ key-value pair will be followed by a space insead of a newline.
663
+ """
664
+
665
+ if self._should_print_single_line:
666
+ printable = ''
667
+ after_kv = ' '
668
+ else:
669
+ printable = '\t' * tabs
670
+ after_kv = '\n'
671
+
672
+ # Xcode usually prints remoteGlobalIDString values in PBXContainerItemProxy
673
+ # objects without comments. Sometimes it prints them with comments, but
674
+ # the majority of the time, it doesn't. To avoid unnecessary changes to
675
+ # the project file after Xcode opens it, don't write comments for
676
+ # remoteGlobalIDString. This is a sucky hack and it would certainly be
677
+ # cleaner to extend the schema to indicate whether or not a comment should
678
+ # be printed, but since this is the only case where the problem occurs and
679
+ # Xcode itself can't seem to make up its mind, the hack will suffice.
680
+ #
681
+ # Also see PBXContainerItemProxy._schema['remoteGlobalIDString'].
682
+ if key == 'remoteGlobalIDString' and isinstance(self,
683
+ PBXContainerItemProxy):
684
+ value_to_print = value.id
685
+ else:
686
+ value_to_print = value
687
+
688
+ # PBXBuildFile's settings property is represented in the output as a dict,
689
+ # but a hack here has it represented as a string. Arrange to strip off the
690
+ # quotes so that it shows up in the output as expected.
691
+ if key == 'settings' and isinstance(self, PBXBuildFile):
692
+ strip_value_quotes = True
693
+ else:
694
+ strip_value_quotes = False
695
+
696
+ # In another one-off, let's set flatten_list on buildSettings properties
697
+ # of XCBuildConfiguration objects, because that's how Xcode treats them.
698
+ if key == 'buildSettings' and isinstance(self, XCBuildConfiguration):
699
+ flatten_list = True
700
+ else:
701
+ flatten_list = False
702
+
703
+ try:
704
+ printable_key = self._XCPrintableValue(tabs, key, flatten_list)
705
+ printable_value = self._XCPrintableValue(tabs, value_to_print,
706
+ flatten_list)
707
+ if strip_value_quotes and len(printable_value) > 1 and \
708
+ printable_value[0] == '"' and printable_value[-1] == '"':
709
+ printable_value = printable_value[1:-1]
710
+ printable += printable_key + ' = ' + printable_value + ';' + after_kv
711
+ except TypeError as e:
712
+ gyp.common.ExceptionAppend(e,
713
+ 'while printing key "%s"' % key)
714
+ raise
715
+
716
+ self._XCPrint(file, 0, printable)
717
+
718
+ def Print(self, file=sys.stdout):
719
+ """Prints a reprentation of this object to file, adhering to Xcode output
720
+ formatting.
721
+ """
722
+
723
+ self.VerifyHasRequiredProperties()
724
+
725
+ if self._should_print_single_line:
726
+ # When printing an object in a single line, Xcode doesn't put any space
727
+ # between the beginning of a dictionary (or presumably a list) and the
728
+ # first contained item, so you wind up with snippets like
729
+ # ...CDEF = {isa = PBXFileReference; fileRef = 0123...
730
+ # If it were me, I would have put a space in there after the opening
731
+ # curly, but I guess this is just another one of those inconsistencies
732
+ # between how Xcode prints PBXFileReference and PBXBuildFile objects as
733
+ # compared to other objects. Mimic Xcode's behavior here by using an
734
+ # empty string for sep.
735
+ sep = ''
736
+ end_tabs = 0
737
+ else:
738
+ sep = '\n'
739
+ end_tabs = 2
740
+
741
+ # Start the object. For example, '\t\tPBXProject = {\n'.
742
+ self._XCPrint(file, 2, self._XCPrintableValue(2, self) + ' = {' + sep)
743
+
744
+ # "isa" isn't in the _properties dictionary, it's an intrinsic property
745
+ # of the class which the object belongs to. Xcode always outputs "isa"
746
+ # as the first element of an object dictionary.
747
+ self._XCKVPrint(file, 3, 'isa', self.__class__.__name__)
748
+
749
+ # The remaining elements of an object dictionary are sorted alphabetically.
750
+ for property, value in sorted(self._properties.items()):
751
+ self._XCKVPrint(file, 3, property, value)
752
+
753
+ # End the object.
754
+ self._XCPrint(file, end_tabs, '};\n')
755
+
756
+ def UpdateProperties(self, properties, do_copy=False):
757
+ """Merge the supplied properties into the _properties dictionary.
758
+
759
+ The input properties must adhere to the class schema or a KeyError or
760
+ TypeError exception will be raised. If adding an object of an XCObject
761
+ subclass and the schema indicates a strong relationship, the object's
762
+ parent will be set to this object.
763
+
764
+ If do_copy is True, then lists, dicts, strong-owned XCObjects, and
765
+ strong-owned XCObjects in lists will be copied instead of having their
766
+ references added.
767
+ """
768
+
769
+ if properties is None:
770
+ return
771
+
772
+ for property, value in properties.items():
773
+ # Make sure the property is in the schema.
774
+ if not property in self._schema:
775
+ raise KeyError(property + ' not in ' + self.__class__.__name__)
776
+
777
+ # Make sure the property conforms to the schema.
778
+ (is_list, property_type, is_strong) = self._schema[property][0:3]
779
+ if is_list:
780
+ if value.__class__ != list:
781
+ raise TypeError(
782
+ property + ' of ' + self.__class__.__name__ + \
783
+ ' must be list, not ' + value.__class__.__name__)
784
+ for item in value:
785
+ if not isinstance(item, property_type) and \
786
+ not (isinstance(item, basestring) and property_type == str):
787
+ # Accept unicode where str is specified. str is treated as
788
+ # UTF-8-encoded.
789
+ raise TypeError(
790
+ 'item of ' + property + ' of ' + self.__class__.__name__ + \
791
+ ' must be ' + property_type.__name__ + ', not ' + \
792
+ item.__class__.__name__)
793
+ elif not isinstance(value, property_type) and \
794
+ not (isinstance(value, basestring) and property_type == str):
795
+ # Accept unicode where str is specified. str is treated as
796
+ # UTF-8-encoded.
797
+ raise TypeError(
798
+ property + ' of ' + self.__class__.__name__ + ' must be ' + \
799
+ property_type.__name__ + ', not ' + value.__class__.__name__)
800
+
801
+ # Checks passed, perform the assignment.
802
+ if do_copy:
803
+ if isinstance(value, XCObject):
804
+ if is_strong:
805
+ self._properties[property] = value.Copy()
806
+ else:
807
+ self._properties[property] = value
808
+ elif isinstance(value, basestring) or isinstance(value, int):
809
+ self._properties[property] = value
810
+ elif isinstance(value, list):
811
+ if is_strong:
812
+ # If is_strong is True, each element is an XCObject, so it's safe
813
+ # to call Copy.
814
+ self._properties[property] = []
815
+ for item in value:
816
+ self._properties[property].append(item.Copy())
817
+ else:
818
+ self._properties[property] = value[:]
819
+ elif isinstance(value, dict):
820
+ self._properties[property] = value.copy()
821
+ else:
822
+ raise TypeError("Don't know how to copy a " + \
823
+ value.__class__.__name__ + ' object for ' + \
824
+ property + ' in ' + self.__class__.__name__)
825
+ else:
826
+ self._properties[property] = value
827
+
828
+ # Set up the child's back-reference to this object. Don't use |value|
829
+ # any more because it may not be right if do_copy is true.
830
+ if is_strong:
831
+ if not is_list:
832
+ self._properties[property].parent = self
833
+ else:
834
+ for item in self._properties[property]:
835
+ item.parent = self
836
+
837
+ def HasProperty(self, key):
838
+ return key in self._properties
839
+
840
+ def GetProperty(self, key):
841
+ return self._properties[key]
842
+
843
+ def SetProperty(self, key, value):
844
+ self.UpdateProperties({key: value})
845
+
846
+ def DelProperty(self, key):
847
+ if key in self._properties:
848
+ del self._properties[key]
849
+
850
+ def AppendProperty(self, key, value):
851
+ # TODO(mark): Support ExtendProperty too (and make this call that)?
852
+
853
+ # Schema validation.
854
+ if not key in self._schema:
855
+ raise KeyError(key + ' not in ' + self.__class__.__name__)
856
+
857
+ (is_list, property_type, is_strong) = self._schema[key][0:3]
858
+ if not is_list:
859
+ raise TypeError(key + ' of ' + self.__class__.__name__ + ' must be list')
860
+ if not isinstance(value, property_type):
861
+ raise TypeError('item of ' + key + ' of ' + self.__class__.__name__ + \
862
+ ' must be ' + property_type.__name__ + ', not ' + \
863
+ value.__class__.__name__)
864
+
865
+ # If the property doesn't exist yet, create a new empty list to receive the
866
+ # item.
867
+ if not key in self._properties:
868
+ self._properties[key] = []
869
+
870
+ # Set up the ownership link.
871
+ if is_strong:
872
+ value.parent = self
873
+
874
+ # Store the item.
875
+ self._properties[key].append(value)
876
+
877
+ def VerifyHasRequiredProperties(self):
878
+ """Ensure that all properties identified as required by the schema are
879
+ set.
880
+ """
881
+
882
+ # TODO(mark): A stronger verification mechanism is needed. Some
883
+ # subclasses need to perform validation beyond what the schema can enforce.
884
+ for property, attributes in self._schema.items():
885
+ (is_list, property_type, is_strong, is_required) = attributes[0:4]
886
+ if is_required and not property in self._properties:
887
+ raise KeyError(self.__class__.__name__ + ' requires ' + property)
888
+
889
+ def _SetDefaultsFromSchema(self):
890
+ """Assign object default values according to the schema. This will not
891
+ overwrite properties that have already been set."""
892
+
893
+ defaults = {}
894
+ for property, attributes in self._schema.items():
895
+ (is_list, property_type, is_strong, is_required) = attributes[0:4]
896
+ if is_required and len(attributes) >= 5 and \
897
+ not property in self._properties:
898
+ default = attributes[4]
899
+
900
+ defaults[property] = default
901
+
902
+ if len(defaults) > 0:
903
+ # Use do_copy=True so that each new object gets its own copy of strong
904
+ # objects, lists, and dicts.
905
+ self.UpdateProperties(defaults, do_copy=True)
906
+
907
+
908
+ class XCHierarchicalElement(XCObject):
909
+ """Abstract base for PBXGroup and PBXFileReference. Not represented in a
910
+ project file."""
911
+
912
+ # TODO(mark): Do name and path belong here? Probably so.
913
+ # If path is set and name is not, name may have a default value. Name will
914
+ # be set to the basename of path, if the basename of path is different from
915
+ # the full value of path. If path is already just a leaf name, name will
916
+ # not be set.
917
+ _schema = XCObject._schema.copy()
918
+ _schema.update({
919
+ 'comments': [0, str, 0, 0],
920
+ 'fileEncoding': [0, str, 0, 0],
921
+ 'includeInIndex': [0, int, 0, 0],
922
+ 'indentWidth': [0, int, 0, 0],
923
+ 'lineEnding': [0, int, 0, 0],
924
+ 'sourceTree': [0, str, 0, 1, '<group>'],
925
+ 'tabWidth': [0, int, 0, 0],
926
+ 'usesTabs': [0, int, 0, 0],
927
+ 'wrapsLines': [0, int, 0, 0],
928
+ })
929
+
930
+ def __init__(self, properties=None, id=None, parent=None):
931
+ # super
932
+ XCObject.__init__(self, properties, id, parent)
933
+ if 'path' in self._properties and not 'name' in self._properties:
934
+ path = self._properties['path']
935
+ name = posixpath.basename(path)
936
+ if name != '' and path != name:
937
+ self.SetProperty('name', name)
938
+
939
+ if 'path' in self._properties and \
940
+ (not 'sourceTree' in self._properties or \
941
+ self._properties['sourceTree'] == '<group>'):
942
+ # If the pathname begins with an Xcode variable like "$(SDKROOT)/", take
943
+ # the variable out and make the path be relative to that variable by
944
+ # assigning the variable name as the sourceTree.
945
+ (source_tree, path) = SourceTreeAndPathFromPath(self._properties['path'])
946
+ if source_tree != None:
947
+ self._properties['sourceTree'] = source_tree
948
+ if path != None:
949
+ self._properties['path'] = path
950
+ if source_tree != None and path is None and \
951
+ not 'name' in self._properties:
952
+ # The path was of the form "$(SDKROOT)" with no path following it.
953
+ # This object is now relative to that variable, so it has no path
954
+ # attribute of its own. It does, however, keep a name.
955
+ del self._properties['path']
956
+ self._properties['name'] = source_tree
957
+
958
+ def Name(self):
959
+ if 'name' in self._properties:
960
+ return self._properties['name']
961
+ elif 'path' in self._properties:
962
+ return self._properties['path']
963
+ else:
964
+ # This happens in the case of the root PBXGroup.
965
+ return None
966
+
967
+ def Hashables(self):
968
+ """Custom hashables for XCHierarchicalElements.
969
+
970
+ XCHierarchicalElements are special. Generally, their hashes shouldn't
971
+ change if the paths don't change. The normal XCObject implementation of
972
+ Hashables adds a hashable for each object, which means that if
973
+ the hierarchical structure changes (possibly due to changes caused when
974
+ TakeOverOnlyChild runs and encounters slight changes in the hierarchy),
975
+ the hashes will change. For example, if a project file initially contains
976
+ a/b/f1 and a/b becomes collapsed into a/b, f1 will have a single parent
977
+ a/b. If someone later adds a/f2 to the project file, a/b can no longer be
978
+ collapsed, and f1 winds up with parent b and grandparent a. That would
979
+ be sufficient to change f1's hash.
980
+
981
+ To counteract this problem, hashables for all XCHierarchicalElements except
982
+ for the main group (which has neither a name nor a path) are taken to be
983
+ just the set of path components. Because hashables are inherited from
984
+ parents, this provides assurance that a/b/f1 has the same set of hashables
985
+ whether its parent is b or a/b.
986
+
987
+ The main group is a special case. As it is permitted to have no name or
988
+ path, it is permitted to use the standard XCObject hash mechanism. This
989
+ is not considered a problem because there can be only one main group.
990
+ """
991
+
992
+ if self == self.PBXProjectAncestor()._properties['mainGroup']:
993
+ # super
994
+ return XCObject.Hashables(self)
995
+
996
+ hashables = []
997
+
998
+ # Put the name in first, ensuring that if TakeOverOnlyChild collapses
999
+ # children into a top-level group like "Source", the name always goes
1000
+ # into the list of hashables without interfering with path components.
1001
+ if 'name' in self._properties:
1002
+ # Make it less likely for people to manipulate hashes by following the
1003
+ # pattern of always pushing an object type value onto the list first.
1004
+ hashables.append(self.__class__.__name__ + '.name')
1005
+ hashables.append(self._properties['name'])
1006
+
1007
+ # NOTE: This still has the problem that if an absolute path is encountered,
1008
+ # including paths with a sourceTree, they'll still inherit their parents'
1009
+ # hashables, even though the paths aren't relative to their parents. This
1010
+ # is not expected to be much of a problem in practice.
1011
+ path = self.PathFromSourceTreeAndPath()
1012
+ if path != None:
1013
+ components = path.split(posixpath.sep)
1014
+ for component in components:
1015
+ hashables.append(self.__class__.__name__ + '.path')
1016
+ hashables.append(component)
1017
+
1018
+ hashables.extend(self._hashables)
1019
+
1020
+ return hashables
1021
+
1022
+ def Compare(self, other):
1023
+ # Allow comparison of these types. PBXGroup has the highest sort rank;
1024
+ # PBXVariantGroup is treated as equal to PBXFileReference.
1025
+ valid_class_types = {
1026
+ PBXFileReference: 'file',
1027
+ PBXGroup: 'group',
1028
+ PBXVariantGroup: 'file',
1029
+ }
1030
+ self_type = valid_class_types[self.__class__]
1031
+ other_type = valid_class_types[other.__class__]
1032
+
1033
+ if self_type == other_type:
1034
+ # If the two objects are of the same sort rank, compare their names.
1035
+ return cmp(self.Name(), other.Name())
1036
+
1037
+ # Otherwise, sort groups before everything else.
1038
+ if self_type == 'group':
1039
+ return -1
1040
+ return 1
1041
+
1042
+ def CompareRootGroup(self, other):
1043
+ # This function should be used only to compare direct children of the
1044
+ # containing PBXProject's mainGroup. These groups should appear in the
1045
+ # listed order.
1046
+ # TODO(mark): "Build" is used by gyp.generator.xcode, perhaps the
1047
+ # generator should have a way of influencing this list rather than having
1048
+ # to hardcode for the generator here.
1049
+ order = ['Source', 'Intermediates', 'Projects', 'Frameworks', 'Products',
1050
+ 'Build']
1051
+
1052
+ # If the groups aren't in the listed order, do a name comparison.
1053
+ # Otherwise, groups in the listed order should come before those that
1054
+ # aren't.
1055
+ self_name = self.Name()
1056
+ other_name = other.Name()
1057
+ self_in = isinstance(self, PBXGroup) and self_name in order
1058
+ other_in = isinstance(self, PBXGroup) and other_name in order
1059
+ if not self_in and not other_in:
1060
+ return self.Compare(other)
1061
+ if self_name in order and not other_name in order:
1062
+ return -1
1063
+ if other_name in order and not self_name in order:
1064
+ return 1
1065
+
1066
+ # If both groups are in the listed order, go by the defined order.
1067
+ self_index = order.index(self_name)
1068
+ other_index = order.index(other_name)
1069
+ if self_index < other_index:
1070
+ return -1
1071
+ if self_index > other_index:
1072
+ return 1
1073
+ return 0
1074
+
1075
+ def PathFromSourceTreeAndPath(self):
1076
+ # Turn the object's sourceTree and path properties into a single flat
1077
+ # string of a form comparable to the path parameter. If there's a
1078
+ # sourceTree property other than "<group>", wrap it in $(...) for the
1079
+ # comparison.
1080
+ components = []
1081
+ if self._properties['sourceTree'] != '<group>':
1082
+ components.append('$(' + self._properties['sourceTree'] + ')')
1083
+ if 'path' in self._properties:
1084
+ components.append(self._properties['path'])
1085
+
1086
+ if len(components) > 0:
1087
+ return posixpath.join(*components)
1088
+
1089
+ return None
1090
+
1091
+ def FullPath(self):
1092
+ # Returns a full path to self relative to the project file, or relative
1093
+ # to some other source tree. Start with self, and walk up the chain of
1094
+ # parents prepending their paths, if any, until no more parents are
1095
+ # available (project-relative path) or until a path relative to some
1096
+ # source tree is found.
1097
+ xche = self
1098
+ path = None
1099
+ while isinstance(xche, XCHierarchicalElement) and \
1100
+ (path is None or \
1101
+ (not path.startswith('/') and not path.startswith('$'))):
1102
+ this_path = xche.PathFromSourceTreeAndPath()
1103
+ if this_path != None and path != None:
1104
+ path = posixpath.join(this_path, path)
1105
+ elif this_path != None:
1106
+ path = this_path
1107
+ xche = xche.parent
1108
+
1109
+ return path
1110
+
1111
+
1112
+ class PBXGroup(XCHierarchicalElement):
1113
+ """
1114
+ Attributes:
1115
+ _children_by_path: Maps pathnames of children of this PBXGroup to the
1116
+ actual child XCHierarchicalElement objects.
1117
+ _variant_children_by_name_and_path: Maps (name, path) tuples of
1118
+ PBXVariantGroup children to the actual child PBXVariantGroup objects.
1119
+ """
1120
+
1121
+ _schema = XCHierarchicalElement._schema.copy()
1122
+ _schema.update({
1123
+ 'children': [1, XCHierarchicalElement, 1, 1, []],
1124
+ 'name': [0, str, 0, 0],
1125
+ 'path': [0, str, 0, 0],
1126
+ })
1127
+
1128
+ def __init__(self, properties=None, id=None, parent=None):
1129
+ # super
1130
+ XCHierarchicalElement.__init__(self, properties, id, parent)
1131
+ self._children_by_path = {}
1132
+ self._variant_children_by_name_and_path = {}
1133
+ for child in self._properties.get('children', []):
1134
+ self._AddChildToDicts(child)
1135
+
1136
+ def Hashables(self):
1137
+ # super
1138
+ hashables = XCHierarchicalElement.Hashables(self)
1139
+
1140
+ # It is not sufficient to just rely on name and parent to build a unique
1141
+ # hashable : a node could have two child PBXGroup sharing a common name.
1142
+ # To add entropy the hashable is enhanced with the names of all its
1143
+ # children.
1144
+ for child in self._properties.get('children', []):
1145
+ child_name = child.Name()
1146
+ if child_name != None:
1147
+ hashables.append(child_name)
1148
+
1149
+ return hashables
1150
+
1151
+ def HashablesForChild(self):
1152
+ # To avoid a circular reference the hashables used to compute a child id do
1153
+ # not include the child names.
1154
+ return XCHierarchicalElement.Hashables(self)
1155
+
1156
+ def _AddChildToDicts(self, child):
1157
+ # Sets up this PBXGroup object's dicts to reference the child properly.
1158
+ child_path = child.PathFromSourceTreeAndPath()
1159
+ if child_path:
1160
+ if child_path in self._children_by_path:
1161
+ raise ValueError('Found multiple children with path ' + child_path)
1162
+ self._children_by_path[child_path] = child
1163
+
1164
+ if isinstance(child, PBXVariantGroup):
1165
+ child_name = child._properties.get('name', None)
1166
+ key = (child_name, child_path)
1167
+ if key in self._variant_children_by_name_and_path:
1168
+ raise ValueError('Found multiple PBXVariantGroup children with ' + \
1169
+ 'name ' + str(child_name) + ' and path ' + \
1170
+ str(child_path))
1171
+ self._variant_children_by_name_and_path[key] = child
1172
+
1173
+ def AppendChild(self, child):
1174
+ # Callers should use this instead of calling
1175
+ # AppendProperty('children', child) directly because this function
1176
+ # maintains the group's dicts.
1177
+ self.AppendProperty('children', child)
1178
+ self._AddChildToDicts(child)
1179
+
1180
+ def GetChildByName(self, name):
1181
+ # This is not currently optimized with a dict as GetChildByPath is because
1182
+ # it has few callers. Most callers probably want GetChildByPath. This
1183
+ # function is only useful to get children that have names but no paths,
1184
+ # which is rare. The children of the main group ("Source", "Products",
1185
+ # etc.) is pretty much the only case where this likely to come up.
1186
+ #
1187
+ # TODO(mark): Maybe this should raise an error if more than one child is
1188
+ # present with the same name.
1189
+ if not 'children' in self._properties:
1190
+ return None
1191
+
1192
+ for child in self._properties['children']:
1193
+ if child.Name() == name:
1194
+ return child
1195
+
1196
+ return None
1197
+
1198
+ def GetChildByPath(self, path):
1199
+ if not path:
1200
+ return None
1201
+
1202
+ if path in self._children_by_path:
1203
+ return self._children_by_path[path]
1204
+
1205
+ return None
1206
+
1207
+ def GetChildByRemoteObject(self, remote_object):
1208
+ # This method is a little bit esoteric. Given a remote_object, which
1209
+ # should be a PBXFileReference in another project file, this method will
1210
+ # return this group's PBXReferenceProxy object serving as a local proxy
1211
+ # for the remote PBXFileReference.
1212
+ #
1213
+ # This function might benefit from a dict optimization as GetChildByPath
1214
+ # for some workloads, but profiling shows that it's not currently a
1215
+ # problem.
1216
+ if not 'children' in self._properties:
1217
+ return None
1218
+
1219
+ for child in self._properties['children']:
1220
+ if not isinstance(child, PBXReferenceProxy):
1221
+ continue
1222
+
1223
+ container_proxy = child._properties['remoteRef']
1224
+ if container_proxy._properties['remoteGlobalIDString'] == remote_object:
1225
+ return child
1226
+
1227
+ return None
1228
+
1229
+ def AddOrGetFileByPath(self, path, hierarchical):
1230
+ """Returns an existing or new file reference corresponding to path.
1231
+
1232
+ If hierarchical is True, this method will create or use the necessary
1233
+ hierarchical group structure corresponding to path. Otherwise, it will
1234
+ look in and create an item in the current group only.
1235
+
1236
+ If an existing matching reference is found, it is returned, otherwise, a
1237
+ new one will be created, added to the correct group, and returned.
1238
+
1239
+ If path identifies a directory by virtue of carrying a trailing slash,
1240
+ this method returns a PBXFileReference of "folder" type. If path
1241
+ identifies a variant, by virtue of it identifying a file inside a directory
1242
+ with an ".lproj" extension, this method returns a PBXVariantGroup
1243
+ containing the variant named by path, and possibly other variants. For
1244
+ all other paths, a "normal" PBXFileReference will be returned.
1245
+ """
1246
+
1247
+ # Adding or getting a directory? Directories end with a trailing slash.
1248
+ is_dir = False
1249
+ if path.endswith('/'):
1250
+ is_dir = True
1251
+ path = posixpath.normpath(path)
1252
+ if is_dir:
1253
+ path = path + '/'
1254
+
1255
+ # Adding or getting a variant? Variants are files inside directories
1256
+ # with an ".lproj" extension. Xcode uses variants for localization. For
1257
+ # a variant path/to/Language.lproj/MainMenu.nib, put a variant group named
1258
+ # MainMenu.nib inside path/to, and give it a variant named Language. In
1259
+ # this example, grandparent would be set to path/to and parent_root would
1260
+ # be set to Language.
1261
+ variant_name = None
1262
+ parent = posixpath.dirname(path)
1263
+ grandparent = posixpath.dirname(parent)
1264
+ parent_basename = posixpath.basename(parent)
1265
+ (parent_root, parent_ext) = posixpath.splitext(parent_basename)
1266
+ if parent_ext == '.lproj':
1267
+ variant_name = parent_root
1268
+ if grandparent == '':
1269
+ grandparent = None
1270
+
1271
+ # Putting a directory inside a variant group is not currently supported.
1272
+ assert not is_dir or variant_name is None
1273
+
1274
+ path_split = path.split(posixpath.sep)
1275
+ if len(path_split) == 1 or \
1276
+ ((is_dir or variant_name != None) and len(path_split) == 2) or \
1277
+ not hierarchical:
1278
+ # The PBXFileReference or PBXVariantGroup will be added to or gotten from
1279
+ # this PBXGroup, no recursion necessary.
1280
+ if variant_name is None:
1281
+ # Add or get a PBXFileReference.
1282
+ file_ref = self.GetChildByPath(path)
1283
+ if file_ref != None:
1284
+ assert file_ref.__class__ == PBXFileReference
1285
+ else:
1286
+ file_ref = PBXFileReference({'path': path})
1287
+ self.AppendChild(file_ref)
1288
+ else:
1289
+ # Add or get a PBXVariantGroup. The variant group name is the same
1290
+ # as the basename (MainMenu.nib in the example above). grandparent
1291
+ # specifies the path to the variant group itself, and path_split[-2:]
1292
+ # is the path of the specific variant relative to its group.
1293
+ variant_group_name = posixpath.basename(path)
1294
+ variant_group_ref = self.AddOrGetVariantGroupByNameAndPath(
1295
+ variant_group_name, grandparent)
1296
+ variant_path = posixpath.sep.join(path_split[-2:])
1297
+ variant_ref = variant_group_ref.GetChildByPath(variant_path)
1298
+ if variant_ref != None:
1299
+ assert variant_ref.__class__ == PBXFileReference
1300
+ else:
1301
+ variant_ref = PBXFileReference({'name': variant_name,
1302
+ 'path': variant_path})
1303
+ variant_group_ref.AppendChild(variant_ref)
1304
+ # The caller is interested in the variant group, not the specific
1305
+ # variant file.
1306
+ file_ref = variant_group_ref
1307
+ return file_ref
1308
+ else:
1309
+ # Hierarchical recursion. Add or get a PBXGroup corresponding to the
1310
+ # outermost path component, and then recurse into it, chopping off that
1311
+ # path component.
1312
+ next_dir = path_split[0]
1313
+ group_ref = self.GetChildByPath(next_dir)
1314
+ if group_ref != None:
1315
+ assert group_ref.__class__ == PBXGroup
1316
+ else:
1317
+ group_ref = PBXGroup({'path': next_dir})
1318
+ self.AppendChild(group_ref)
1319
+ return group_ref.AddOrGetFileByPath(posixpath.sep.join(path_split[1:]),
1320
+ hierarchical)
1321
+
1322
+ def AddOrGetVariantGroupByNameAndPath(self, name, path):
1323
+ """Returns an existing or new PBXVariantGroup for name and path.
1324
+
1325
+ If a PBXVariantGroup identified by the name and path arguments is already
1326
+ present as a child of this object, it is returned. Otherwise, a new
1327
+ PBXVariantGroup with the correct properties is created, added as a child,
1328
+ and returned.
1329
+
1330
+ This method will generally be called by AddOrGetFileByPath, which knows
1331
+ when to create a variant group based on the structure of the pathnames
1332
+ passed to it.
1333
+ """
1334
+
1335
+ key = (name, path)
1336
+ if key in self._variant_children_by_name_and_path:
1337
+ variant_group_ref = self._variant_children_by_name_and_path[key]
1338
+ assert variant_group_ref.__class__ == PBXVariantGroup
1339
+ return variant_group_ref
1340
+
1341
+ variant_group_properties = {'name': name}
1342
+ if path != None:
1343
+ variant_group_properties['path'] = path
1344
+ variant_group_ref = PBXVariantGroup(variant_group_properties)
1345
+ self.AppendChild(variant_group_ref)
1346
+
1347
+ return variant_group_ref
1348
+
1349
+ def TakeOverOnlyChild(self, recurse=False):
1350
+ """If this PBXGroup has only one child and it's also a PBXGroup, take
1351
+ it over by making all of its children this object's children.
1352
+
1353
+ This function will continue to take over only children when those children
1354
+ are groups. If there are three PBXGroups representing a, b, and c, with
1355
+ c inside b and b inside a, and a and b have no other children, this will
1356
+ result in a taking over both b and c, forming a PBXGroup for a/b/c.
1357
+
1358
+ If recurse is True, this function will recurse into children and ask them
1359
+ to collapse themselves by taking over only children as well. Assuming
1360
+ an example hierarchy with files at a/b/c/d1, a/b/c/d2, and a/b/c/d3/e/f
1361
+ (d1, d2, and f are files, the rest are groups), recursion will result in
1362
+ a group for a/b/c containing a group for d3/e.
1363
+ """
1364
+
1365
+ # At this stage, check that child class types are PBXGroup exactly,
1366
+ # instead of using isinstance. The only subclass of PBXGroup,
1367
+ # PBXVariantGroup, should not participate in reparenting in the same way:
1368
+ # reparenting by merging different object types would be wrong.
1369
+ while len(self._properties['children']) == 1 and \
1370
+ self._properties['children'][0].__class__ == PBXGroup:
1371
+ # Loop to take over the innermost only-child group possible.
1372
+
1373
+ child = self._properties['children'][0]
1374
+
1375
+ # Assume the child's properties, including its children. Save a copy
1376
+ # of this object's old properties, because they'll still be needed.
1377
+ # This object retains its existing id and parent attributes.
1378
+ old_properties = self._properties
1379
+ self._properties = child._properties
1380
+ self._children_by_path = child._children_by_path
1381
+
1382
+ if not 'sourceTree' in self._properties or \
1383
+ self._properties['sourceTree'] == '<group>':
1384
+ # The child was relative to its parent. Fix up the path. Note that
1385
+ # children with a sourceTree other than "<group>" are not relative to
1386
+ # their parents, so no path fix-up is needed in that case.
1387
+ if 'path' in old_properties:
1388
+ if 'path' in self._properties:
1389
+ # Both the original parent and child have paths set.
1390
+ self._properties['path'] = posixpath.join(old_properties['path'],
1391
+ self._properties['path'])
1392
+ else:
1393
+ # Only the original parent has a path, use it.
1394
+ self._properties['path'] = old_properties['path']
1395
+ if 'sourceTree' in old_properties:
1396
+ # The original parent had a sourceTree set, use it.
1397
+ self._properties['sourceTree'] = old_properties['sourceTree']
1398
+
1399
+ # If the original parent had a name set, keep using it. If the original
1400
+ # parent didn't have a name but the child did, let the child's name
1401
+ # live on. If the name attribute seems unnecessary now, get rid of it.
1402
+ if 'name' in old_properties and old_properties['name'] != None and \
1403
+ old_properties['name'] != self.Name():
1404
+ self._properties['name'] = old_properties['name']
1405
+ if 'name' in self._properties and 'path' in self._properties and \
1406
+ self._properties['name'] == self._properties['path']:
1407
+ del self._properties['name']
1408
+
1409
+ # Notify all children of their new parent.
1410
+ for child in self._properties['children']:
1411
+ child.parent = self
1412
+
1413
+ # If asked to recurse, recurse.
1414
+ if recurse:
1415
+ for child in self._properties['children']:
1416
+ if child.__class__ == PBXGroup:
1417
+ child.TakeOverOnlyChild(recurse)
1418
+
1419
+ def SortGroup(self):
1420
+ self._properties['children'] = \
1421
+ sorted(self._properties['children'],
1422
+ key=functools.cmp_to_key(XCHierarchicalElement.Compare))
1423
+
1424
+ # Recurse.
1425
+ for child in self._properties['children']:
1426
+ if isinstance(child, PBXGroup):
1427
+ child.SortGroup()
1428
+
1429
+
1430
+ class XCFileLikeElement(XCHierarchicalElement):
1431
+ # Abstract base for objects that can be used as the fileRef property of
1432
+ # PBXBuildFile.
1433
+
1434
+ def PathHashables(self):
1435
+ # A PBXBuildFile that refers to this object will call this method to
1436
+ # obtain additional hashables specific to this XCFileLikeElement. Don't
1437
+ # just use this object's hashables, they're not specific and unique enough
1438
+ # on their own (without access to the parent hashables.) Instead, provide
1439
+ # hashables that identify this object by path by getting its hashables as
1440
+ # well as the hashables of ancestor XCHierarchicalElement objects.
1441
+
1442
+ hashables = []
1443
+ xche = self
1444
+ while xche != None and isinstance(xche, XCHierarchicalElement):
1445
+ xche_hashables = xche.Hashables()
1446
+ for index, xche_hashable in enumerate(xche_hashables):
1447
+ hashables.insert(index, xche_hashable)
1448
+ xche = xche.parent
1449
+ return hashables
1450
+
1451
+
1452
+ class XCContainerPortal(XCObject):
1453
+ # Abstract base for objects that can be used as the containerPortal property
1454
+ # of PBXContainerItemProxy.
1455
+ pass
1456
+
1457
+
1458
+ class XCRemoteObject(XCObject):
1459
+ # Abstract base for objects that can be used as the remoteGlobalIDString
1460
+ # property of PBXContainerItemProxy.
1461
+ pass
1462
+
1463
+
1464
+ class PBXFileReference(XCFileLikeElement, XCContainerPortal, XCRemoteObject):
1465
+ _schema = XCFileLikeElement._schema.copy()
1466
+ _schema.update({
1467
+ 'explicitFileType': [0, str, 0, 0],
1468
+ 'lastKnownFileType': [0, str, 0, 0],
1469
+ 'name': [0, str, 0, 0],
1470
+ 'path': [0, str, 0, 1],
1471
+ })
1472
+
1473
+ # Weird output rules for PBXFileReference.
1474
+ _should_print_single_line = True
1475
+ # super
1476
+ _encode_transforms = XCFileLikeElement._alternate_encode_transforms
1477
+
1478
+ def __init__(self, properties=None, id=None, parent=None):
1479
+ # super
1480
+ XCFileLikeElement.__init__(self, properties, id, parent)
1481
+ if 'path' in self._properties and self._properties['path'].endswith('/'):
1482
+ self._properties['path'] = self._properties['path'][:-1]
1483
+ is_dir = True
1484
+ else:
1485
+ is_dir = False
1486
+
1487
+ if 'path' in self._properties and \
1488
+ not 'lastKnownFileType' in self._properties and \
1489
+ not 'explicitFileType' in self._properties:
1490
+ # TODO(mark): This is the replacement for a replacement for a quick hack.
1491
+ # It is no longer incredibly sucky, but this list needs to be extended.
1492
+ extension_map = {
1493
+ 'a': 'archive.ar',
1494
+ 'app': 'wrapper.application',
1495
+ 'bdic': 'file',
1496
+ 'bundle': 'wrapper.cfbundle',
1497
+ 'c': 'sourcecode.c.c',
1498
+ 'cc': 'sourcecode.cpp.cpp',
1499
+ 'cpp': 'sourcecode.cpp.cpp',
1500
+ 'css': 'text.css',
1501
+ 'cxx': 'sourcecode.cpp.cpp',
1502
+ 'dart': 'sourcecode',
1503
+ 'dylib': 'compiled.mach-o.dylib',
1504
+ 'framework': 'wrapper.framework',
1505
+ 'gyp': 'sourcecode',
1506
+ 'gypi': 'sourcecode',
1507
+ 'h': 'sourcecode.c.h',
1508
+ 'hxx': 'sourcecode.cpp.h',
1509
+ 'icns': 'image.icns',
1510
+ 'java': 'sourcecode.java',
1511
+ 'js': 'sourcecode.javascript',
1512
+ 'kext': 'wrapper.kext',
1513
+ 'm': 'sourcecode.c.objc',
1514
+ 'mm': 'sourcecode.cpp.objcpp',
1515
+ 'nib': 'wrapper.nib',
1516
+ 'o': 'compiled.mach-o.objfile',
1517
+ 'pdf': 'image.pdf',
1518
+ 'pl': 'text.script.perl',
1519
+ 'plist': 'text.plist.xml',
1520
+ 'pm': 'text.script.perl',
1521
+ 'png': 'image.png',
1522
+ 'py': 'text.script.python',
1523
+ 'r': 'sourcecode.rez',
1524
+ 'rez': 'sourcecode.rez',
1525
+ 's': 'sourcecode.asm',
1526
+ 'storyboard': 'file.storyboard',
1527
+ 'strings': 'text.plist.strings',
1528
+ 'swift': 'sourcecode.swift',
1529
+ 'ttf': 'file',
1530
+ 'xcassets': 'folder.assetcatalog',
1531
+ 'xcconfig': 'text.xcconfig',
1532
+ 'xcdatamodel': 'wrapper.xcdatamodel',
1533
+ 'xcdatamodeld':'wrapper.xcdatamodeld',
1534
+ 'xib': 'file.xib',
1535
+ 'y': 'sourcecode.yacc',
1536
+ 'tbd': 'sourcecode.text-based-dylib-definition',
1537
+ }
1538
+
1539
+ prop_map = {
1540
+ 'dart': 'explicitFileType',
1541
+ 'gyp': 'explicitFileType',
1542
+ 'gypi': 'explicitFileType',
1543
+ }
1544
+
1545
+ if is_dir:
1546
+ file_type = 'folder'
1547
+ prop_name = 'lastKnownFileType'
1548
+ else:
1549
+ basename = posixpath.basename(self._properties['path'])
1550
+ (root, ext) = posixpath.splitext(basename)
1551
+ # Check the map using a lowercase extension.
1552
+ # TODO(mark): Maybe it should try with the original case first and fall
1553
+ # back to lowercase, in case there are any instances where case
1554
+ # matters. There currently aren't.
1555
+ if ext != '':
1556
+ ext = ext[1:].lower()
1557
+
1558
+ # TODO(mark): "text" is the default value, but "file" is appropriate
1559
+ # for unrecognized files not containing text. Xcode seems to choose
1560
+ # based on content.
1561
+ file_type = extension_map.get(ext, 'text')
1562
+ prop_name = prop_map.get(ext, 'lastKnownFileType')
1563
+
1564
+ self._properties[prop_name] = file_type
1565
+
1566
+
1567
+ class PBXVariantGroup(PBXGroup, XCFileLikeElement):
1568
+ """PBXVariantGroup is used by Xcode to represent localizations."""
1569
+ # No additions to the schema relative to PBXGroup.
1570
+ pass
1571
+
1572
+
1573
+ # PBXReferenceProxy is also an XCFileLikeElement subclass. It is defined below
1574
+ # because it uses PBXContainerItemProxy, defined below.
1575
+
1576
+
1577
+ class XCBuildConfiguration(XCObject):
1578
+ _schema = XCObject._schema.copy()
1579
+ _schema.update({
1580
+ 'baseConfigurationReference': [0, PBXFileReference, 0, 0],
1581
+ 'buildSettings': [0, dict, 0, 1, {}],
1582
+ 'name': [0, str, 0, 1],
1583
+ })
1584
+
1585
+ def HasBuildSetting(self, key):
1586
+ return key in self._properties['buildSettings']
1587
+
1588
+ def GetBuildSetting(self, key):
1589
+ return self._properties['buildSettings'][key]
1590
+
1591
+ def SetBuildSetting(self, key, value):
1592
+ # TODO(mark): If a list, copy?
1593
+ self._properties['buildSettings'][key] = value
1594
+
1595
+ def AppendBuildSetting(self, key, value):
1596
+ if not key in self._properties['buildSettings']:
1597
+ self._properties['buildSettings'][key] = []
1598
+ self._properties['buildSettings'][key].append(value)
1599
+
1600
+ def DelBuildSetting(self, key):
1601
+ if key in self._properties['buildSettings']:
1602
+ del self._properties['buildSettings'][key]
1603
+
1604
+ def SetBaseConfiguration(self, value):
1605
+ self._properties['baseConfigurationReference'] = value
1606
+
1607
+ class XCConfigurationList(XCObject):
1608
+ # _configs is the default list of configurations.
1609
+ _configs = [ XCBuildConfiguration({'name': 'Debug'}),
1610
+ XCBuildConfiguration({'name': 'Release'}) ]
1611
+
1612
+ _schema = XCObject._schema.copy()
1613
+ _schema.update({
1614
+ 'buildConfigurations': [1, XCBuildConfiguration, 1, 1, _configs],
1615
+ 'defaultConfigurationIsVisible': [0, int, 0, 1, 1],
1616
+ 'defaultConfigurationName': [0, str, 0, 1, 'Release'],
1617
+ })
1618
+
1619
+ def Name(self):
1620
+ return 'Build configuration list for ' + \
1621
+ self.parent.__class__.__name__ + ' "' + self.parent.Name() + '"'
1622
+
1623
+ def ConfigurationNamed(self, name):
1624
+ """Convenience accessor to obtain an XCBuildConfiguration by name."""
1625
+ for configuration in self._properties['buildConfigurations']:
1626
+ if configuration._properties['name'] == name:
1627
+ return configuration
1628
+
1629
+ raise KeyError(name)
1630
+
1631
+ def DefaultConfiguration(self):
1632
+ """Convenience accessor to obtain the default XCBuildConfiguration."""
1633
+ return self.ConfigurationNamed(self._properties['defaultConfigurationName'])
1634
+
1635
+ def HasBuildSetting(self, key):
1636
+ """Determines the state of a build setting in all XCBuildConfiguration
1637
+ child objects.
1638
+
1639
+ If all child objects have key in their build settings, and the value is the
1640
+ same in all child objects, returns 1.
1641
+
1642
+ If no child objects have the key in their build settings, returns 0.
1643
+
1644
+ If some, but not all, child objects have the key in their build settings,
1645
+ or if any children have different values for the key, returns -1.
1646
+ """
1647
+
1648
+ has = None
1649
+ value = None
1650
+ for configuration in self._properties['buildConfigurations']:
1651
+ configuration_has = configuration.HasBuildSetting(key)
1652
+ if has is None:
1653
+ has = configuration_has
1654
+ elif has != configuration_has:
1655
+ return -1
1656
+
1657
+ if configuration_has:
1658
+ configuration_value = configuration.GetBuildSetting(key)
1659
+ if value is None:
1660
+ value = configuration_value
1661
+ elif value != configuration_value:
1662
+ return -1
1663
+
1664
+ if not has:
1665
+ return 0
1666
+
1667
+ return 1
1668
+
1669
+ def GetBuildSetting(self, key):
1670
+ """Gets the build setting for key.
1671
+
1672
+ All child XCConfiguration objects must have the same value set for the
1673
+ setting, or a ValueError will be raised.
1674
+ """
1675
+
1676
+ # TODO(mark): This is wrong for build settings that are lists. The list
1677
+ # contents should be compared (and a list copy returned?)
1678
+
1679
+ value = None
1680
+ for configuration in self._properties['buildConfigurations']:
1681
+ configuration_value = configuration.GetBuildSetting(key)
1682
+ if value is None:
1683
+ value = configuration_value
1684
+ else:
1685
+ if value != configuration_value:
1686
+ raise ValueError('Variant values for ' + key)
1687
+
1688
+ return value
1689
+
1690
+ def SetBuildSetting(self, key, value):
1691
+ """Sets the build setting for key to value in all child
1692
+ XCBuildConfiguration objects.
1693
+ """
1694
+
1695
+ for configuration in self._properties['buildConfigurations']:
1696
+ configuration.SetBuildSetting(key, value)
1697
+
1698
+ def AppendBuildSetting(self, key, value):
1699
+ """Appends value to the build setting for key, which is treated as a list,
1700
+ in all child XCBuildConfiguration objects.
1701
+ """
1702
+
1703
+ for configuration in self._properties['buildConfigurations']:
1704
+ configuration.AppendBuildSetting(key, value)
1705
+
1706
+ def DelBuildSetting(self, key):
1707
+ """Deletes the build setting key from all child XCBuildConfiguration
1708
+ objects.
1709
+ """
1710
+
1711
+ for configuration in self._properties['buildConfigurations']:
1712
+ configuration.DelBuildSetting(key)
1713
+
1714
+ def SetBaseConfiguration(self, value):
1715
+ """Sets the build configuration in all child XCBuildConfiguration objects.
1716
+ """
1717
+
1718
+ for configuration in self._properties['buildConfigurations']:
1719
+ configuration.SetBaseConfiguration(value)
1720
+
1721
+
1722
+ class PBXBuildFile(XCObject):
1723
+ _schema = XCObject._schema.copy()
1724
+ _schema.update({
1725
+ 'fileRef': [0, XCFileLikeElement, 0, 1],
1726
+ 'settings': [0, str, 0, 0], # hack, it's a dict
1727
+ })
1728
+
1729
+ # Weird output rules for PBXBuildFile.
1730
+ _should_print_single_line = True
1731
+ _encode_transforms = XCObject._alternate_encode_transforms
1732
+
1733
+ def Name(self):
1734
+ # Example: "main.cc in Sources"
1735
+ return self._properties['fileRef'].Name() + ' in ' + self.parent.Name()
1736
+
1737
+ def Hashables(self):
1738
+ # super
1739
+ hashables = XCObject.Hashables(self)
1740
+
1741
+ # It is not sufficient to just rely on Name() to get the
1742
+ # XCFileLikeElement's name, because that is not a complete pathname.
1743
+ # PathHashables returns hashables unique enough that no two
1744
+ # PBXBuildFiles should wind up with the same set of hashables, unless
1745
+ # someone adds the same file multiple times to the same target. That
1746
+ # would be considered invalid anyway.
1747
+ hashables.extend(self._properties['fileRef'].PathHashables())
1748
+
1749
+ return hashables
1750
+
1751
+
1752
+ class XCBuildPhase(XCObject):
1753
+ """Abstract base for build phase classes. Not represented in a project
1754
+ file.
1755
+
1756
+ Attributes:
1757
+ _files_by_path: A dict mapping each path of a child in the files list by
1758
+ path (keys) to the corresponding PBXBuildFile children (values).
1759
+ _files_by_xcfilelikeelement: A dict mapping each XCFileLikeElement (keys)
1760
+ to the corresponding PBXBuildFile children (values).
1761
+ """
1762
+
1763
+ # TODO(mark): Some build phase types, like PBXShellScriptBuildPhase, don't
1764
+ # actually have a "files" list. XCBuildPhase should not have "files" but
1765
+ # another abstract subclass of it should provide this, and concrete build
1766
+ # phase types that do have "files" lists should be derived from that new
1767
+ # abstract subclass. XCBuildPhase should only provide buildActionMask and
1768
+ # runOnlyForDeploymentPostprocessing, and not files or the various
1769
+ # file-related methods and attributes.
1770
+
1771
+ _schema = XCObject._schema.copy()
1772
+ _schema.update({
1773
+ 'buildActionMask': [0, int, 0, 1, 0x7fffffff],
1774
+ 'files': [1, PBXBuildFile, 1, 1, []],
1775
+ 'runOnlyForDeploymentPostprocessing': [0, int, 0, 1, 0],
1776
+ })
1777
+
1778
+ def __init__(self, properties=None, id=None, parent=None):
1779
+ # super
1780
+ XCObject.__init__(self, properties, id, parent)
1781
+
1782
+ self._files_by_path = {}
1783
+ self._files_by_xcfilelikeelement = {}
1784
+ for pbxbuildfile in self._properties.get('files', []):
1785
+ self._AddBuildFileToDicts(pbxbuildfile)
1786
+
1787
+ def FileGroup(self, path):
1788
+ # Subclasses must override this by returning a two-element tuple. The
1789
+ # first item in the tuple should be the PBXGroup to which "path" should be
1790
+ # added, either as a child or deeper descendant. The second item should
1791
+ # be a boolean indicating whether files should be added into hierarchical
1792
+ # groups or one single flat group.
1793
+ raise NotImplementedError(
1794
+ self.__class__.__name__ + ' must implement FileGroup')
1795
+
1796
+ def _AddPathToDict(self, pbxbuildfile, path):
1797
+ """Adds path to the dict tracking paths belonging to this build phase.
1798
+
1799
+ If the path is already a member of this build phase, raises an exception.
1800
+ """
1801
+
1802
+ if path in self._files_by_path:
1803
+ raise ValueError('Found multiple build files with path ' + path)
1804
+ self._files_by_path[path] = pbxbuildfile
1805
+
1806
+ def _AddBuildFileToDicts(self, pbxbuildfile, path=None):
1807
+ """Maintains the _files_by_path and _files_by_xcfilelikeelement dicts.
1808
+
1809
+ If path is specified, then it is the path that is being added to the
1810
+ phase, and pbxbuildfile must contain either a PBXFileReference directly
1811
+ referencing that path, or it must contain a PBXVariantGroup that itself
1812
+ contains a PBXFileReference referencing the path.
1813
+
1814
+ If path is not specified, either the PBXFileReference's path or the paths
1815
+ of all children of the PBXVariantGroup are taken as being added to the
1816
+ phase.
1817
+
1818
+ If the path is already present in the phase, raises an exception.
1819
+
1820
+ If the PBXFileReference or PBXVariantGroup referenced by pbxbuildfile
1821
+ are already present in the phase, referenced by a different PBXBuildFile
1822
+ object, raises an exception. This does not raise an exception when
1823
+ a PBXFileReference or PBXVariantGroup reappear and are referenced by the
1824
+ same PBXBuildFile that has already introduced them, because in the case
1825
+ of PBXVariantGroup objects, they may correspond to multiple paths that are
1826
+ not all added simultaneously. When this situation occurs, the path needs
1827
+ to be added to _files_by_path, but nothing needs to change in
1828
+ _files_by_xcfilelikeelement, and the caller should have avoided adding
1829
+ the PBXBuildFile if it is already present in the list of children.
1830
+ """
1831
+
1832
+ xcfilelikeelement = pbxbuildfile._properties['fileRef']
1833
+
1834
+ paths = []
1835
+ if path != None:
1836
+ # It's best when the caller provides the path.
1837
+ if isinstance(xcfilelikeelement, PBXVariantGroup):
1838
+ paths.append(path)
1839
+ else:
1840
+ # If the caller didn't provide a path, there can be either multiple
1841
+ # paths (PBXVariantGroup) or one.
1842
+ if isinstance(xcfilelikeelement, PBXVariantGroup):
1843
+ for variant in xcfilelikeelement._properties['children']:
1844
+ paths.append(variant.FullPath())
1845
+ else:
1846
+ paths.append(xcfilelikeelement.FullPath())
1847
+
1848
+ # Add the paths first, because if something's going to raise, the
1849
+ # messages provided by _AddPathToDict are more useful owing to its
1850
+ # having access to a real pathname and not just an object's Name().
1851
+ for a_path in paths:
1852
+ self._AddPathToDict(pbxbuildfile, a_path)
1853
+
1854
+ # If another PBXBuildFile references this XCFileLikeElement, there's a
1855
+ # problem.
1856
+ if xcfilelikeelement in self._files_by_xcfilelikeelement and \
1857
+ self._files_by_xcfilelikeelement[xcfilelikeelement] != pbxbuildfile:
1858
+ raise ValueError('Found multiple build files for ' + \
1859
+ xcfilelikeelement.Name())
1860
+ self._files_by_xcfilelikeelement[xcfilelikeelement] = pbxbuildfile
1861
+
1862
+ def AppendBuildFile(self, pbxbuildfile, path=None):
1863
+ # Callers should use this instead of calling
1864
+ # AppendProperty('files', pbxbuildfile) directly because this function
1865
+ # maintains the object's dicts. Better yet, callers can just call AddFile
1866
+ # with a pathname and not worry about building their own PBXBuildFile
1867
+ # objects.
1868
+ self.AppendProperty('files', pbxbuildfile)
1869
+ self._AddBuildFileToDicts(pbxbuildfile, path)
1870
+
1871
+ def AddFile(self, path, settings=None):
1872
+ (file_group, hierarchical) = self.FileGroup(path)
1873
+ file_ref = file_group.AddOrGetFileByPath(path, hierarchical)
1874
+
1875
+ if file_ref in self._files_by_xcfilelikeelement and \
1876
+ isinstance(file_ref, PBXVariantGroup):
1877
+ # There's already a PBXBuildFile in this phase corresponding to the
1878
+ # PBXVariantGroup. path just provides a new variant that belongs to
1879
+ # the group. Add the path to the dict.
1880
+ pbxbuildfile = self._files_by_xcfilelikeelement[file_ref]
1881
+ self._AddBuildFileToDicts(pbxbuildfile, path)
1882
+ else:
1883
+ # Add a new PBXBuildFile to get file_ref into the phase.
1884
+ if settings is None:
1885
+ pbxbuildfile = PBXBuildFile({'fileRef': file_ref})
1886
+ else:
1887
+ pbxbuildfile = PBXBuildFile({'fileRef': file_ref, 'settings': settings})
1888
+ self.AppendBuildFile(pbxbuildfile, path)
1889
+
1890
+
1891
+ class PBXHeadersBuildPhase(XCBuildPhase):
1892
+ # No additions to the schema relative to XCBuildPhase.
1893
+
1894
+ def Name(self):
1895
+ return 'Headers'
1896
+
1897
+ def FileGroup(self, path):
1898
+ return self.PBXProjectAncestor().RootGroupForPath(path)
1899
+
1900
+
1901
+ class PBXResourcesBuildPhase(XCBuildPhase):
1902
+ # No additions to the schema relative to XCBuildPhase.
1903
+
1904
+ def Name(self):
1905
+ return 'Resources'
1906
+
1907
+ def FileGroup(self, path):
1908
+ return self.PBXProjectAncestor().RootGroupForPath(path)
1909
+
1910
+
1911
+ class PBXSourcesBuildPhase(XCBuildPhase):
1912
+ # No additions to the schema relative to XCBuildPhase.
1913
+
1914
+ def Name(self):
1915
+ return 'Sources'
1916
+
1917
+ def FileGroup(self, path):
1918
+ return self.PBXProjectAncestor().RootGroupForPath(path)
1919
+
1920
+
1921
+ class PBXFrameworksBuildPhase(XCBuildPhase):
1922
+ # No additions to the schema relative to XCBuildPhase.
1923
+
1924
+ def Name(self):
1925
+ return 'Frameworks'
1926
+
1927
+ def FileGroup(self, path):
1928
+ (root, ext) = posixpath.splitext(path)
1929
+ if ext != '':
1930
+ ext = ext[1:].lower()
1931
+ if ext == 'o':
1932
+ # .o files are added to Xcode Frameworks phases, but conceptually aren't
1933
+ # frameworks, they're more like sources or intermediates. Redirect them
1934
+ # to show up in one of those other groups.
1935
+ return self.PBXProjectAncestor().RootGroupForPath(path)
1936
+ else:
1937
+ return (self.PBXProjectAncestor().FrameworksGroup(), False)
1938
+
1939
+
1940
+ class PBXShellScriptBuildPhase(XCBuildPhase):
1941
+ _schema = XCBuildPhase._schema.copy()
1942
+ _schema.update({
1943
+ 'inputPaths': [1, str, 0, 1, []],
1944
+ 'name': [0, str, 0, 0],
1945
+ 'outputPaths': [1, str, 0, 1, []],
1946
+ 'shellPath': [0, str, 0, 1, '/bin/sh'],
1947
+ 'shellScript': [0, str, 0, 1],
1948
+ 'showEnvVarsInLog': [0, int, 0, 0],
1949
+ })
1950
+
1951
+ def Name(self):
1952
+ if 'name' in self._properties:
1953
+ return self._properties['name']
1954
+
1955
+ return 'ShellScript'
1956
+
1957
+
1958
+ class PBXCopyFilesBuildPhase(XCBuildPhase):
1959
+ _schema = XCBuildPhase._schema.copy()
1960
+ _schema.update({
1961
+ 'dstPath': [0, str, 0, 1],
1962
+ 'dstSubfolderSpec': [0, int, 0, 1],
1963
+ 'name': [0, str, 0, 0],
1964
+ })
1965
+
1966
+ # path_tree_re matches "$(DIR)/path", "$(DIR)/$(DIR2)/path" or just "$(DIR)".
1967
+ # Match group 1 is "DIR", group 3 is "path" or "$(DIR2") or "$(DIR2)/path"
1968
+ # or None. If group 3 is "path", group 4 will be None otherwise group 4 is
1969
+ # "DIR2" and group 6 is "path".
1970
+ path_tree_re = re.compile(r'^\$\((.*?)\)(/(\$\((.*?)\)(/(.*)|)|(.*)|)|)$')
1971
+
1972
+ # path_tree_{first,second}_to_subfolder map names of Xcode variables to the
1973
+ # associated dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase
1974
+ # object.
1975
+ path_tree_first_to_subfolder = {
1976
+ # Types that can be chosen via the Xcode UI.
1977
+ 'BUILT_PRODUCTS_DIR': 16, # Products Directory
1978
+ 'BUILT_FRAMEWORKS_DIR': 10, # Not an official Xcode macro.
1979
+ # Existed before support for the
1980
+ # names below was added. Maps to
1981
+ # "Frameworks".
1982
+ }
1983
+
1984
+ path_tree_second_to_subfolder = {
1985
+ 'WRAPPER_NAME': 1, # Wrapper
1986
+ # Although Xcode's friendly name is "Executables", the destination
1987
+ # is demonstrably the value of the build setting
1988
+ # EXECUTABLE_FOLDER_PATH not EXECUTABLES_FOLDER_PATH.
1989
+ 'EXECUTABLE_FOLDER_PATH': 6, # Executables.
1990
+ 'UNLOCALIZED_RESOURCES_FOLDER_PATH': 7, # Resources
1991
+ 'JAVA_FOLDER_PATH': 15, # Java Resources
1992
+ 'FRAMEWORKS_FOLDER_PATH': 10, # Frameworks
1993
+ 'SHARED_FRAMEWORKS_FOLDER_PATH': 11, # Shared Frameworks
1994
+ 'SHARED_SUPPORT_FOLDER_PATH': 12, # Shared Support
1995
+ 'PLUGINS_FOLDER_PATH': 13, # PlugIns
1996
+ # For XPC Services, Xcode sets both dstPath and dstSubfolderSpec.
1997
+ # Note that it re-uses the BUILT_PRODUCTS_DIR value for
1998
+ # dstSubfolderSpec. dstPath is set below.
1999
+ 'XPCSERVICES_FOLDER_PATH': 16, # XPC Services.
2000
+ }
2001
+
2002
+ def Name(self):
2003
+ if 'name' in self._properties:
2004
+ return self._properties['name']
2005
+
2006
+ return 'CopyFiles'
2007
+
2008
+ def FileGroup(self, path):
2009
+ return self.PBXProjectAncestor().RootGroupForPath(path)
2010
+
2011
+ def SetDestination(self, path):
2012
+ """Set the dstSubfolderSpec and dstPath properties from path.
2013
+
2014
+ path may be specified in the same notation used for XCHierarchicalElements,
2015
+ specifically, "$(DIR)/path".
2016
+ """
2017
+
2018
+ path_tree_match = self.path_tree_re.search(path)
2019
+ if path_tree_match:
2020
+ path_tree = path_tree_match.group(1);
2021
+ if path_tree in self.path_tree_first_to_subfolder:
2022
+ subfolder = self.path_tree_first_to_subfolder[path_tree]
2023
+ relative_path = path_tree_match.group(3)
2024
+ if relative_path is None:
2025
+ relative_path = ''
2026
+
2027
+ if subfolder == 16 and path_tree_match.group(4) is not None:
2028
+ # BUILT_PRODUCTS_DIR (16) is the first element in a path whose
2029
+ # second element is possibly one of the variable names in
2030
+ # path_tree_second_to_subfolder. Xcode sets the values of all these
2031
+ # variables to relative paths so .gyp files must prefix them with
2032
+ # BUILT_PRODUCTS_DIR, e.g.
2033
+ # $(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH). Then
2034
+ # xcode_emulation.py can export these variables with the same values
2035
+ # as Xcode yet make & ninja files can determine the absolute path
2036
+ # to the target. Xcode uses the dstSubfolderSpec value set here
2037
+ # to determine the full path.
2038
+ #
2039
+ # An alternative of xcode_emulation.py setting the values to absolute
2040
+ # paths when exporting these variables has been ruled out because
2041
+ # then the values would be different depending on the build tool.
2042
+ #
2043
+ # Another alternative is to invent new names for the variables used
2044
+ # to match to the subfolder indices in the second table. .gyp files
2045
+ # then will not need to prepend $(BUILT_PRODUCTS_DIR) because
2046
+ # xcode_emulation.py can set the values of those variables to
2047
+ # the absolute paths when exporting. This is possibly the thinking
2048
+ # behind BUILT_FRAMEWORKS_DIR which is used in exactly this manner.
2049
+ #
2050
+ # Requiring prepending BUILT_PRODUCTS_DIR has been chosen because
2051
+ # this same way could be used to specify destinations in .gyp files
2052
+ # that pre-date this addition to GYP. However they would only work
2053
+ # with the Xcode generator. The previous version of xcode_emulation.py
2054
+ # does not export these variables. Such files will get the benefit
2055
+ # of the Xcode UI showing the proper destination name simply by
2056
+ # regenerating the projects with this version of GYP.
2057
+ path_tree = path_tree_match.group(4)
2058
+ relative_path = path_tree_match.group(6)
2059
+ separator = '/'
2060
+
2061
+ if path_tree in self.path_tree_second_to_subfolder:
2062
+ subfolder = self.path_tree_second_to_subfolder[path_tree]
2063
+ if relative_path is None:
2064
+ relative_path = ''
2065
+ separator = ''
2066
+ if path_tree == 'XPCSERVICES_FOLDER_PATH':
2067
+ relative_path = '$(CONTENTS_FOLDER_PATH)/XPCServices' \
2068
+ + separator + relative_path
2069
+ else:
2070
+ # subfolder = 16 from above
2071
+ # The second element of the path is an unrecognized variable.
2072
+ # Include it and any remaining elements in relative_path.
2073
+ relative_path = path_tree_match.group(3);
2074
+
2075
+ else:
2076
+ # The path starts with an unrecognized Xcode variable
2077
+ # name like $(SRCROOT). Xcode will still handle this
2078
+ # as an "absolute path" that starts with the variable.
2079
+ subfolder = 0
2080
+ relative_path = path
2081
+ elif path.startswith('/'):
2082
+ # Special case. Absolute paths are in dstSubfolderSpec 0.
2083
+ subfolder = 0
2084
+ relative_path = path[1:]
2085
+ else:
2086
+ raise ValueError('Can\'t use path %s in a %s' % \
2087
+ (path, self.__class__.__name__))
2088
+
2089
+ self._properties['dstPath'] = relative_path
2090
+ self._properties['dstSubfolderSpec'] = subfolder
2091
+
2092
+
2093
+ class PBXBuildRule(XCObject):
2094
+ _schema = XCObject._schema.copy()
2095
+ _schema.update({
2096
+ 'compilerSpec': [0, str, 0, 1],
2097
+ 'filePatterns': [0, str, 0, 0],
2098
+ 'fileType': [0, str, 0, 1],
2099
+ 'isEditable': [0, int, 0, 1, 1],
2100
+ 'outputFiles': [1, str, 0, 1, []],
2101
+ 'script': [0, str, 0, 0],
2102
+ })
2103
+
2104
+ def Name(self):
2105
+ # Not very inspired, but it's what Xcode uses.
2106
+ return self.__class__.__name__
2107
+
2108
+ def Hashables(self):
2109
+ # super
2110
+ hashables = XCObject.Hashables(self)
2111
+
2112
+ # Use the hashables of the weak objects that this object refers to.
2113
+ hashables.append(self._properties['fileType'])
2114
+ if 'filePatterns' in self._properties:
2115
+ hashables.append(self._properties['filePatterns'])
2116
+ return hashables
2117
+
2118
+
2119
+ class PBXContainerItemProxy(XCObject):
2120
+ # When referencing an item in this project file, containerPortal is the
2121
+ # PBXProject root object of this project file. When referencing an item in
2122
+ # another project file, containerPortal is a PBXFileReference identifying
2123
+ # the other project file.
2124
+ #
2125
+ # When serving as a proxy to an XCTarget (in this project file or another),
2126
+ # proxyType is 1. When serving as a proxy to a PBXFileReference (in another
2127
+ # project file), proxyType is 2. Type 2 is used for references to the
2128
+ # producs of the other project file's targets.
2129
+ #
2130
+ # Xcode is weird about remoteGlobalIDString. Usually, it's printed without
2131
+ # a comment, indicating that it's tracked internally simply as a string, but
2132
+ # sometimes it's printed with a comment (usually when the object is initially
2133
+ # created), indicating that it's tracked as a project file object at least
2134
+ # sometimes. This module always tracks it as an object, but contains a hack
2135
+ # to prevent it from printing the comment in the project file output. See
2136
+ # _XCKVPrint.
2137
+ _schema = XCObject._schema.copy()
2138
+ _schema.update({
2139
+ 'containerPortal': [0, XCContainerPortal, 0, 1],
2140
+ 'proxyType': [0, int, 0, 1],
2141
+ 'remoteGlobalIDString': [0, XCRemoteObject, 0, 1],
2142
+ 'remoteInfo': [0, str, 0, 1],
2143
+ })
2144
+
2145
+ def __repr__(self):
2146
+ props = self._properties
2147
+ name = '%s.gyp:%s' % (props['containerPortal'].Name(), props['remoteInfo'])
2148
+ return '<%s %r at 0x%x>' % (self.__class__.__name__, name, id(self))
2149
+
2150
+ def Name(self):
2151
+ # Admittedly not the best name, but it's what Xcode uses.
2152
+ return self.__class__.__name__
2153
+
2154
+ def Hashables(self):
2155
+ # super
2156
+ hashables = XCObject.Hashables(self)
2157
+
2158
+ # Use the hashables of the weak objects that this object refers to.
2159
+ hashables.extend(self._properties['containerPortal'].Hashables())
2160
+ hashables.extend(self._properties['remoteGlobalIDString'].Hashables())
2161
+ return hashables
2162
+
2163
+
2164
+ class PBXTargetDependency(XCObject):
2165
+ # The "target" property accepts an XCTarget object, and obviously not
2166
+ # NoneType. But XCTarget is defined below, so it can't be put into the
2167
+ # schema yet. The definition of PBXTargetDependency can't be moved below
2168
+ # XCTarget because XCTarget's own schema references PBXTargetDependency.
2169
+ # Python doesn't deal well with this circular relationship, and doesn't have
2170
+ # a real way to do forward declarations. To work around, the type of
2171
+ # the "target" property is reset below, after XCTarget is defined.
2172
+ #
2173
+ # At least one of "name" and "target" is required.
2174
+ _schema = XCObject._schema.copy()
2175
+ _schema.update({
2176
+ 'name': [0, str, 0, 0],
2177
+ 'target': [0, None.__class__, 0, 0],
2178
+ 'targetProxy': [0, PBXContainerItemProxy, 1, 1],
2179
+ })
2180
+
2181
+ def __repr__(self):
2182
+ name = self._properties.get('name') or self._properties['target'].Name()
2183
+ return '<%s %r at 0x%x>' % (self.__class__.__name__, name, id(self))
2184
+
2185
+ def Name(self):
2186
+ # Admittedly not the best name, but it's what Xcode uses.
2187
+ return self.__class__.__name__
2188
+
2189
+ def Hashables(self):
2190
+ # super
2191
+ hashables = XCObject.Hashables(self)
2192
+
2193
+ # Use the hashables of the weak objects that this object refers to.
2194
+ hashables.extend(self._properties['targetProxy'].Hashables())
2195
+ return hashables
2196
+
2197
+
2198
+ class PBXReferenceProxy(XCFileLikeElement):
2199
+ _schema = XCFileLikeElement._schema.copy()
2200
+ _schema.update({
2201
+ 'fileType': [0, str, 0, 1],
2202
+ 'path': [0, str, 0, 1],
2203
+ 'remoteRef': [0, PBXContainerItemProxy, 1, 1],
2204
+ })
2205
+
2206
+
2207
+ class XCTarget(XCRemoteObject):
2208
+ # An XCTarget is really just an XCObject, the XCRemoteObject thing is just
2209
+ # to allow PBXProject to be used in the remoteGlobalIDString property of
2210
+ # PBXContainerItemProxy.
2211
+ #
2212
+ # Setting a "name" property at instantiation may also affect "productName",
2213
+ # which may in turn affect the "PRODUCT_NAME" build setting in children of
2214
+ # "buildConfigurationList". See __init__ below.
2215
+ _schema = XCRemoteObject._schema.copy()
2216
+ _schema.update({
2217
+ 'buildConfigurationList': [0, XCConfigurationList, 1, 1,
2218
+ XCConfigurationList()],
2219
+ 'buildPhases': [1, XCBuildPhase, 1, 1, []],
2220
+ 'dependencies': [1, PBXTargetDependency, 1, 1, []],
2221
+ 'name': [0, str, 0, 1],
2222
+ 'productName': [0, str, 0, 1],
2223
+ })
2224
+
2225
+ def __init__(self, properties=None, id=None, parent=None,
2226
+ force_outdir=None, force_prefix=None, force_extension=None):
2227
+ # super
2228
+ XCRemoteObject.__init__(self, properties, id, parent)
2229
+
2230
+ # Set up additional defaults not expressed in the schema. If a "name"
2231
+ # property was supplied, set "productName" if it is not present. Also set
2232
+ # the "PRODUCT_NAME" build setting in each configuration, but only if
2233
+ # the setting is not present in any build configuration.
2234
+ if 'name' in self._properties:
2235
+ if not 'productName' in self._properties:
2236
+ self.SetProperty('productName', self._properties['name'])
2237
+
2238
+ if 'productName' in self._properties:
2239
+ if 'buildConfigurationList' in self._properties:
2240
+ configs = self._properties['buildConfigurationList']
2241
+ if configs.HasBuildSetting('PRODUCT_NAME') == 0:
2242
+ configs.SetBuildSetting('PRODUCT_NAME',
2243
+ self._properties['productName'])
2244
+
2245
+ def AddDependency(self, other):
2246
+ pbxproject = self.PBXProjectAncestor()
2247
+ other_pbxproject = other.PBXProjectAncestor()
2248
+ if pbxproject == other_pbxproject:
2249
+ # Add a dependency to another target in the same project file.
2250
+ container = PBXContainerItemProxy({'containerPortal': pbxproject,
2251
+ 'proxyType': 1,
2252
+ 'remoteGlobalIDString': other,
2253
+ 'remoteInfo': other.Name()})
2254
+ dependency = PBXTargetDependency({'target': other,
2255
+ 'targetProxy': container})
2256
+ self.AppendProperty('dependencies', dependency)
2257
+ else:
2258
+ # Add a dependency to a target in a different project file.
2259
+ other_project_ref = \
2260
+ pbxproject.AddOrGetProjectReference(other_pbxproject)[1]
2261
+ container = PBXContainerItemProxy({
2262
+ 'containerPortal': other_project_ref,
2263
+ 'proxyType': 1,
2264
+ 'remoteGlobalIDString': other,
2265
+ 'remoteInfo': other.Name(),
2266
+ })
2267
+ dependency = PBXTargetDependency({'name': other.Name(),
2268
+ 'targetProxy': container})
2269
+ self.AppendProperty('dependencies', dependency)
2270
+
2271
+ # Proxy all of these through to the build configuration list.
2272
+
2273
+ def ConfigurationNamed(self, name):
2274
+ return self._properties['buildConfigurationList'].ConfigurationNamed(name)
2275
+
2276
+ def DefaultConfiguration(self):
2277
+ return self._properties['buildConfigurationList'].DefaultConfiguration()
2278
+
2279
+ def HasBuildSetting(self, key):
2280
+ return self._properties['buildConfigurationList'].HasBuildSetting(key)
2281
+
2282
+ def GetBuildSetting(self, key):
2283
+ return self._properties['buildConfigurationList'].GetBuildSetting(key)
2284
+
2285
+ def SetBuildSetting(self, key, value):
2286
+ return self._properties['buildConfigurationList'].SetBuildSetting(key, \
2287
+ value)
2288
+
2289
+ def AppendBuildSetting(self, key, value):
2290
+ return self._properties['buildConfigurationList'].AppendBuildSetting(key, \
2291
+ value)
2292
+
2293
+ def DelBuildSetting(self, key):
2294
+ return self._properties['buildConfigurationList'].DelBuildSetting(key)
2295
+
2296
+
2297
+ # Redefine the type of the "target" property. See PBXTargetDependency._schema
2298
+ # above.
2299
+ PBXTargetDependency._schema['target'][1] = XCTarget
2300
+
2301
+
2302
+ class PBXNativeTarget(XCTarget):
2303
+ # buildPhases is overridden in the schema to be able to set defaults.
2304
+ #
2305
+ # NOTE: Contrary to most objects, it is advisable to set parent when
2306
+ # constructing PBXNativeTarget. A parent of an XCTarget must be a PBXProject
2307
+ # object. A parent reference is required for a PBXNativeTarget during
2308
+ # construction to be able to set up the target defaults for productReference,
2309
+ # because a PBXBuildFile object must be created for the target and it must
2310
+ # be added to the PBXProject's mainGroup hierarchy.
2311
+ _schema = XCTarget._schema.copy()
2312
+ _schema.update({
2313
+ 'buildPhases': [1, XCBuildPhase, 1, 1,
2314
+ [PBXSourcesBuildPhase(), PBXFrameworksBuildPhase()]],
2315
+ 'buildRules': [1, PBXBuildRule, 1, 1, []],
2316
+ 'productReference': [0, PBXFileReference, 0, 1],
2317
+ 'productType': [0, str, 0, 1],
2318
+ })
2319
+
2320
+ # Mapping from Xcode product-types to settings. The settings are:
2321
+ # filetype : used for explicitFileType in the project file
2322
+ # prefix : the prefix for the file name
2323
+ # suffix : the suffix for the file name
2324
+ _product_filetypes = {
2325
+ 'com.apple.product-type.application': ['wrapper.application',
2326
+ '', '.app'],
2327
+ 'com.apple.product-type.application.watchapp': ['wrapper.application',
2328
+ '', '.app'],
2329
+ 'com.apple.product-type.watchkit-extension': ['wrapper.app-extension',
2330
+ '', '.appex'],
2331
+ 'com.apple.product-type.app-extension': ['wrapper.app-extension',
2332
+ '', '.appex'],
2333
+ 'com.apple.product-type.bundle': ['wrapper.cfbundle',
2334
+ '', '.bundle'],
2335
+ 'com.apple.product-type.framework': ['wrapper.framework',
2336
+ '', '.framework'],
2337
+ 'com.apple.product-type.library.dynamic': ['compiled.mach-o.dylib',
2338
+ 'lib', '.dylib'],
2339
+ 'com.apple.product-type.library.static': ['archive.ar',
2340
+ 'lib', '.a'],
2341
+ 'com.apple.product-type.tool': ['compiled.mach-o.executable',
2342
+ '', ''],
2343
+ 'com.apple.product-type.bundle.unit-test': ['wrapper.cfbundle',
2344
+ '', '.xctest'],
2345
+ 'com.apple.product-type.bundle.ui-testing': ['wrapper.cfbundle',
2346
+ '', '.xctest'],
2347
+ 'com.googlecode.gyp.xcode.bundle': ['compiled.mach-o.dylib',
2348
+ '', '.so'],
2349
+ 'com.apple.product-type.kernel-extension': ['wrapper.kext',
2350
+ '', '.kext'],
2351
+ }
2352
+
2353
+ def __init__(self, properties=None, id=None, parent=None,
2354
+ force_outdir=None, force_prefix=None, force_extension=None):
2355
+ # super
2356
+ XCTarget.__init__(self, properties, id, parent)
2357
+
2358
+ if 'productName' in self._properties and \
2359
+ 'productType' in self._properties and \
2360
+ not 'productReference' in self._properties and \
2361
+ self._properties['productType'] in self._product_filetypes:
2362
+ products_group = None
2363
+ pbxproject = self.PBXProjectAncestor()
2364
+ if pbxproject != None:
2365
+ products_group = pbxproject.ProductsGroup()
2366
+
2367
+ if products_group != None:
2368
+ (filetype, prefix, suffix) = \
2369
+ self._product_filetypes[self._properties['productType']]
2370
+ # Xcode does not have a distinct type for loadable modules that are
2371
+ # pure BSD targets (not in a bundle wrapper). GYP allows such modules
2372
+ # to be specified by setting a target type to loadable_module without
2373
+ # having mac_bundle set. These are mapped to the pseudo-product type
2374
+ # com.googlecode.gyp.xcode.bundle.
2375
+ #
2376
+ # By picking up this special type and converting it to a dynamic
2377
+ # library (com.apple.product-type.library.dynamic) with fix-ups,
2378
+ # single-file loadable modules can be produced.
2379
+ #
2380
+ # MACH_O_TYPE is changed to mh_bundle to produce the proper file type
2381
+ # (as opposed to mh_dylib). In order for linking to succeed,
2382
+ # DYLIB_CURRENT_VERSION and DYLIB_COMPATIBILITY_VERSION must be
2383
+ # cleared. They are meaningless for type mh_bundle.
2384
+ #
2385
+ # Finally, the .so extension is forcibly applied over the default
2386
+ # (.dylib), unless another forced extension is already selected.
2387
+ # .dylib is plainly wrong, and .bundle is used by loadable_modules in
2388
+ # bundle wrappers (com.apple.product-type.bundle). .so seems an odd
2389
+ # choice because it's used as the extension on many other systems that
2390
+ # don't distinguish between linkable shared libraries and non-linkable
2391
+ # loadable modules, but there's precedent: Python loadable modules on
2392
+ # Mac OS X use an .so extension.
2393
+ if self._properties['productType'] == 'com.googlecode.gyp.xcode.bundle':
2394
+ self._properties['productType'] = \
2395
+ 'com.apple.product-type.library.dynamic'
2396
+ self.SetBuildSetting('MACH_O_TYPE', 'mh_bundle')
2397
+ self.SetBuildSetting('DYLIB_CURRENT_VERSION', '')
2398
+ self.SetBuildSetting('DYLIB_COMPATIBILITY_VERSION', '')
2399
+ if force_extension is None:
2400
+ force_extension = suffix[1:]
2401
+
2402
+ if self._properties['productType'] == \
2403
+ 'com.apple.product-type-bundle.unit.test' or \
2404
+ self._properties['productType'] == \
2405
+ 'com.apple.product-type-bundle.ui-testing':
2406
+ if force_extension is None:
2407
+ force_extension = suffix[1:]
2408
+
2409
+ if force_extension is not None:
2410
+ # If it's a wrapper (bundle), set WRAPPER_EXTENSION.
2411
+ # Extension override.
2412
+ suffix = '.' + force_extension
2413
+ if filetype.startswith('wrapper.'):
2414
+ self.SetBuildSetting('WRAPPER_EXTENSION', force_extension)
2415
+ else:
2416
+ self.SetBuildSetting('EXECUTABLE_EXTENSION', force_extension)
2417
+
2418
+ if filetype.startswith('compiled.mach-o.executable'):
2419
+ product_name = self._properties['productName']
2420
+ product_name += suffix
2421
+ suffix = ''
2422
+ self.SetProperty('productName', product_name)
2423
+ self.SetBuildSetting('PRODUCT_NAME', product_name)
2424
+
2425
+ # Xcode handles most prefixes based on the target type, however there
2426
+ # are exceptions. If a "BSD Dynamic Library" target is added in the
2427
+ # Xcode UI, Xcode sets EXECUTABLE_PREFIX. This check duplicates that
2428
+ # behavior.
2429
+ if force_prefix is not None:
2430
+ prefix = force_prefix
2431
+ if filetype.startswith('wrapper.'):
2432
+ self.SetBuildSetting('WRAPPER_PREFIX', prefix)
2433
+ else:
2434
+ self.SetBuildSetting('EXECUTABLE_PREFIX', prefix)
2435
+
2436
+ if force_outdir is not None:
2437
+ self.SetBuildSetting('TARGET_BUILD_DIR', force_outdir)
2438
+
2439
+ # TODO(tvl): Remove the below hack.
2440
+ # http://code.google.com/p/gyp/issues/detail?id=122
2441
+
2442
+ # Some targets include the prefix in the target_name. These targets
2443
+ # really should just add a product_name setting that doesn't include
2444
+ # the prefix. For example:
2445
+ # target_name = 'libevent', product_name = 'event'
2446
+ # This check cleans up for them.
2447
+ product_name = self._properties['productName']
2448
+ prefix_len = len(prefix)
2449
+ if prefix_len and (product_name[:prefix_len] == prefix):
2450
+ product_name = product_name[prefix_len:]
2451
+ self.SetProperty('productName', product_name)
2452
+ self.SetBuildSetting('PRODUCT_NAME', product_name)
2453
+
2454
+ ref_props = {
2455
+ 'explicitFileType': filetype,
2456
+ 'includeInIndex': 0,
2457
+ 'path': prefix + product_name + suffix,
2458
+ 'sourceTree': 'BUILT_PRODUCTS_DIR',
2459
+ }
2460
+ file_ref = PBXFileReference(ref_props)
2461
+ products_group.AppendChild(file_ref)
2462
+ self.SetProperty('productReference', file_ref)
2463
+
2464
+ def GetBuildPhaseByType(self, type):
2465
+ if not 'buildPhases' in self._properties:
2466
+ return None
2467
+
2468
+ the_phase = None
2469
+ for phase in self._properties['buildPhases']:
2470
+ if isinstance(phase, type):
2471
+ # Some phases may be present in multiples in a well-formed project file,
2472
+ # but phases like PBXSourcesBuildPhase may only be present singly, and
2473
+ # this function is intended as an aid to GetBuildPhaseByType. Loop
2474
+ # over the entire list of phases and assert if more than one of the
2475
+ # desired type is found.
2476
+ assert the_phase is None
2477
+ the_phase = phase
2478
+
2479
+ return the_phase
2480
+
2481
+ def HeadersPhase(self):
2482
+ headers_phase = self.GetBuildPhaseByType(PBXHeadersBuildPhase)
2483
+ if headers_phase is None:
2484
+ headers_phase = PBXHeadersBuildPhase()
2485
+
2486
+ # The headers phase should come before the resources, sources, and
2487
+ # frameworks phases, if any.
2488
+ insert_at = len(self._properties['buildPhases'])
2489
+ for index, phase in enumerate(self._properties['buildPhases']):
2490
+ if isinstance(phase, PBXResourcesBuildPhase) or \
2491
+ isinstance(phase, PBXSourcesBuildPhase) or \
2492
+ isinstance(phase, PBXFrameworksBuildPhase):
2493
+ insert_at = index
2494
+ break
2495
+
2496
+ self._properties['buildPhases'].insert(insert_at, headers_phase)
2497
+ headers_phase.parent = self
2498
+
2499
+ return headers_phase
2500
+
2501
+ def ResourcesPhase(self):
2502
+ resources_phase = self.GetBuildPhaseByType(PBXResourcesBuildPhase)
2503
+ if resources_phase is None:
2504
+ resources_phase = PBXResourcesBuildPhase()
2505
+
2506
+ # The resources phase should come before the sources and frameworks
2507
+ # phases, if any.
2508
+ insert_at = len(self._properties['buildPhases'])
2509
+ for index, phase in enumerate(self._properties['buildPhases']):
2510
+ if isinstance(phase, PBXSourcesBuildPhase) or \
2511
+ isinstance(phase, PBXFrameworksBuildPhase):
2512
+ insert_at = index
2513
+ break
2514
+
2515
+ self._properties['buildPhases'].insert(insert_at, resources_phase)
2516
+ resources_phase.parent = self
2517
+
2518
+ return resources_phase
2519
+
2520
+ def SourcesPhase(self):
2521
+ sources_phase = self.GetBuildPhaseByType(PBXSourcesBuildPhase)
2522
+ if sources_phase is None:
2523
+ sources_phase = PBXSourcesBuildPhase()
2524
+ self.AppendProperty('buildPhases', sources_phase)
2525
+
2526
+ return sources_phase
2527
+
2528
+ def FrameworksPhase(self):
2529
+ frameworks_phase = self.GetBuildPhaseByType(PBXFrameworksBuildPhase)
2530
+ if frameworks_phase is None:
2531
+ frameworks_phase = PBXFrameworksBuildPhase()
2532
+ self.AppendProperty('buildPhases', frameworks_phase)
2533
+
2534
+ return frameworks_phase
2535
+
2536
+ def AddDependency(self, other):
2537
+ # super
2538
+ XCTarget.AddDependency(self, other)
2539
+
2540
+ static_library_type = 'com.apple.product-type.library.static'
2541
+ shared_library_type = 'com.apple.product-type.library.dynamic'
2542
+ framework_type = 'com.apple.product-type.framework'
2543
+ if isinstance(other, PBXNativeTarget) and \
2544
+ 'productType' in self._properties and \
2545
+ self._properties['productType'] != static_library_type and \
2546
+ 'productType' in other._properties and \
2547
+ (other._properties['productType'] == static_library_type or \
2548
+ ((other._properties['productType'] == shared_library_type or \
2549
+ other._properties['productType'] == framework_type) and \
2550
+ ((not other.HasBuildSetting('MACH_O_TYPE')) or
2551
+ other.GetBuildSetting('MACH_O_TYPE') != 'mh_bundle'))):
2552
+
2553
+ file_ref = other.GetProperty('productReference')
2554
+
2555
+ pbxproject = self.PBXProjectAncestor()
2556
+ other_pbxproject = other.PBXProjectAncestor()
2557
+ if pbxproject != other_pbxproject:
2558
+ other_project_product_group = \
2559
+ pbxproject.AddOrGetProjectReference(other_pbxproject)[0]
2560
+ file_ref = other_project_product_group.GetChildByRemoteObject(file_ref)
2561
+
2562
+ self.FrameworksPhase().AppendProperty('files',
2563
+ PBXBuildFile({'fileRef': file_ref}))
2564
+
2565
+
2566
+ class PBXAggregateTarget(XCTarget):
2567
+ pass
2568
+
2569
+
2570
+ class PBXProject(XCContainerPortal):
2571
+ # A PBXProject is really just an XCObject, the XCContainerPortal thing is
2572
+ # just to allow PBXProject to be used in the containerPortal property of
2573
+ # PBXContainerItemProxy.
2574
+ """
2575
+
2576
+ Attributes:
2577
+ path: "sample.xcodeproj". TODO(mark) Document me!
2578
+ _other_pbxprojects: A dictionary, keyed by other PBXProject objects. Each
2579
+ value is a reference to the dict in the
2580
+ projectReferences list associated with the keyed
2581
+ PBXProject.
2582
+ """
2583
+
2584
+ _schema = XCContainerPortal._schema.copy()
2585
+ _schema.update({
2586
+ 'attributes': [0, dict, 0, 0],
2587
+ 'buildConfigurationList': [0, XCConfigurationList, 1, 1,
2588
+ XCConfigurationList()],
2589
+ 'compatibilityVersion': [0, str, 0, 1, 'Xcode 3.2'],
2590
+ 'hasScannedForEncodings': [0, int, 0, 1, 1],
2591
+ 'mainGroup': [0, PBXGroup, 1, 1, PBXGroup()],
2592
+ 'projectDirPath': [0, str, 0, 1, ''],
2593
+ 'projectReferences': [1, dict, 0, 0],
2594
+ 'projectRoot': [0, str, 0, 1, ''],
2595
+ 'targets': [1, XCTarget, 1, 1, []],
2596
+ })
2597
+
2598
+ def __init__(self, properties=None, id=None, parent=None, path=None):
2599
+ self.path = path
2600
+ self._other_pbxprojects = {}
2601
+ # super
2602
+ return XCContainerPortal.__init__(self, properties, id, parent)
2603
+
2604
+ def Name(self):
2605
+ name = self.path
2606
+ if name[-10:] == '.xcodeproj':
2607
+ name = name[:-10]
2608
+ return posixpath.basename(name)
2609
+
2610
+ def Path(self):
2611
+ return self.path
2612
+
2613
+ def Comment(self):
2614
+ return 'Project object'
2615
+
2616
+ def Children(self):
2617
+ # super
2618
+ children = XCContainerPortal.Children(self)
2619
+
2620
+ # Add children that the schema doesn't know about. Maybe there's a more
2621
+ # elegant way around this, but this is the only case where we need to own
2622
+ # objects in a dictionary (that is itself in a list), and three lines for
2623
+ # a one-off isn't that big a deal.
2624
+ if 'projectReferences' in self._properties:
2625
+ for reference in self._properties['projectReferences']:
2626
+ children.append(reference['ProductGroup'])
2627
+
2628
+ return children
2629
+
2630
+ def PBXProjectAncestor(self):
2631
+ return self
2632
+
2633
+ def _GroupByName(self, name):
2634
+ if not 'mainGroup' in self._properties:
2635
+ self.SetProperty('mainGroup', PBXGroup())
2636
+
2637
+ main_group = self._properties['mainGroup']
2638
+ group = main_group.GetChildByName(name)
2639
+ if group is None:
2640
+ group = PBXGroup({'name': name})
2641
+ main_group.AppendChild(group)
2642
+
2643
+ return group
2644
+
2645
+ # SourceGroup and ProductsGroup are created by default in Xcode's own
2646
+ # templates.
2647
+ def SourceGroup(self):
2648
+ return self._GroupByName('Source')
2649
+
2650
+ def ProductsGroup(self):
2651
+ return self._GroupByName('Products')
2652
+
2653
+ # IntermediatesGroup is used to collect source-like files that are generated
2654
+ # by rules or script phases and are placed in intermediate directories such
2655
+ # as DerivedSources.
2656
+ def IntermediatesGroup(self):
2657
+ return self._GroupByName('Intermediates')
2658
+
2659
+ # FrameworksGroup and ProjectsGroup are top-level groups used to collect
2660
+ # frameworks and projects.
2661
+ def FrameworksGroup(self):
2662
+ return self._GroupByName('Frameworks')
2663
+
2664
+ def ProjectsGroup(self):
2665
+ return self._GroupByName('Projects')
2666
+
2667
+ def RootGroupForPath(self, path):
2668
+ """Returns a PBXGroup child of this object to which path should be added.
2669
+
2670
+ This method is intended to choose between SourceGroup and
2671
+ IntermediatesGroup on the basis of whether path is present in a source
2672
+ directory or an intermediates directory. For the purposes of this
2673
+ determination, any path located within a derived file directory such as
2674
+ PROJECT_DERIVED_FILE_DIR is treated as being in an intermediates
2675
+ directory.
2676
+
2677
+ The returned value is a two-element tuple. The first element is the
2678
+ PBXGroup, and the second element specifies whether that group should be
2679
+ organized hierarchically (True) or as a single flat list (False).
2680
+ """
2681
+
2682
+ # TODO(mark): make this a class variable and bind to self on call?
2683
+ # Also, this list is nowhere near exhaustive.
2684
+ # INTERMEDIATE_DIR and SHARED_INTERMEDIATE_DIR are used by
2685
+ # gyp.generator.xcode. There should probably be some way for that module
2686
+ # to push the names in, rather than having to hard-code them here.
2687
+ source_tree_groups = {
2688
+ 'DERIVED_FILE_DIR': (self.IntermediatesGroup, True),
2689
+ 'INTERMEDIATE_DIR': (self.IntermediatesGroup, True),
2690
+ 'PROJECT_DERIVED_FILE_DIR': (self.IntermediatesGroup, True),
2691
+ 'SHARED_INTERMEDIATE_DIR': (self.IntermediatesGroup, True),
2692
+ }
2693
+
2694
+ (source_tree, path) = SourceTreeAndPathFromPath(path)
2695
+ if source_tree != None and source_tree in source_tree_groups:
2696
+ (group_func, hierarchical) = source_tree_groups[source_tree]
2697
+ group = group_func()
2698
+ return (group, hierarchical)
2699
+
2700
+ # TODO(mark): make additional choices based on file extension.
2701
+
2702
+ return (self.SourceGroup(), True)
2703
+
2704
+ def AddOrGetFileInRootGroup(self, path):
2705
+ """Returns a PBXFileReference corresponding to path in the correct group
2706
+ according to RootGroupForPath's heuristics.
2707
+
2708
+ If an existing PBXFileReference for path exists, it will be returned.
2709
+ Otherwise, one will be created and returned.
2710
+ """
2711
+
2712
+ (group, hierarchical) = self.RootGroupForPath(path)
2713
+ return group.AddOrGetFileByPath(path, hierarchical)
2714
+
2715
+ def RootGroupsTakeOverOnlyChildren(self, recurse=False):
2716
+ """Calls TakeOverOnlyChild for all groups in the main group."""
2717
+
2718
+ for group in self._properties['mainGroup']._properties['children']:
2719
+ if isinstance(group, PBXGroup):
2720
+ group.TakeOverOnlyChild(recurse)
2721
+
2722
+ def SortGroups(self):
2723
+ # Sort the children of the mainGroup (like "Source" and "Products")
2724
+ # according to their defined order.
2725
+ self._properties['mainGroup']._properties['children'] = \
2726
+ sorted(self._properties['mainGroup']._properties['children'],
2727
+ key=functools.cmp_to_key(XCHierarchicalElement.CompareRootGroup))
2728
+
2729
+ # Sort everything else by putting group before files, and going
2730
+ # alphabetically by name within sections of groups and files. SortGroup
2731
+ # is recursive.
2732
+ for group in self._properties['mainGroup']._properties['children']:
2733
+ if not isinstance(group, PBXGroup):
2734
+ continue
2735
+
2736
+ if group.Name() == 'Products':
2737
+ # The Products group is a special case. Instead of sorting
2738
+ # alphabetically, sort things in the order of the targets that
2739
+ # produce the products. To do this, just build up a new list of
2740
+ # products based on the targets.
2741
+ products = []
2742
+ for target in self._properties['targets']:
2743
+ if not isinstance(target, PBXNativeTarget):
2744
+ continue
2745
+ product = target._properties['productReference']
2746
+ # Make sure that the product is already in the products group.
2747
+ assert product in group._properties['children']
2748
+ products.append(product)
2749
+
2750
+ # Make sure that this process doesn't miss anything that was already
2751
+ # in the products group.
2752
+ assert len(products) == len(group._properties['children'])
2753
+ group._properties['children'] = products
2754
+ else:
2755
+ group.SortGroup()
2756
+
2757
+ def AddOrGetProjectReference(self, other_pbxproject):
2758
+ """Add a reference to another project file (via PBXProject object) to this
2759
+ one.
2760
+
2761
+ Returns [ProductGroup, ProjectRef]. ProductGroup is a PBXGroup object in
2762
+ this project file that contains a PBXReferenceProxy object for each
2763
+ product of each PBXNativeTarget in the other project file. ProjectRef is
2764
+ a PBXFileReference to the other project file.
2765
+
2766
+ If this project file already references the other project file, the
2767
+ existing ProductGroup and ProjectRef are returned. The ProductGroup will
2768
+ still be updated if necessary.
2769
+ """
2770
+
2771
+ if not 'projectReferences' in self._properties:
2772
+ self._properties['projectReferences'] = []
2773
+
2774
+ product_group = None
2775
+ project_ref = None
2776
+
2777
+ if not other_pbxproject in self._other_pbxprojects:
2778
+ # This project file isn't yet linked to the other one. Establish the
2779
+ # link.
2780
+ product_group = PBXGroup({'name': 'Products'})
2781
+
2782
+ # ProductGroup is strong.
2783
+ product_group.parent = self
2784
+
2785
+ # There's nothing unique about this PBXGroup, and if left alone, it will
2786
+ # wind up with the same set of hashables as all other PBXGroup objects
2787
+ # owned by the projectReferences list. Add the hashables of the
2788
+ # remote PBXProject that it's related to.
2789
+ product_group._hashables.extend(other_pbxproject.Hashables())
2790
+
2791
+ # The other project reports its path as relative to the same directory
2792
+ # that this project's path is relative to. The other project's path
2793
+ # is not necessarily already relative to this project. Figure out the
2794
+ # pathname that this project needs to use to refer to the other one.
2795
+ this_path = posixpath.dirname(self.Path())
2796
+ projectDirPath = self.GetProperty('projectDirPath')
2797
+ if projectDirPath:
2798
+ if posixpath.isabs(projectDirPath[0]):
2799
+ this_path = projectDirPath
2800
+ else:
2801
+ this_path = posixpath.join(this_path, projectDirPath)
2802
+ other_path = gyp.common.RelativePath(other_pbxproject.Path(), this_path)
2803
+
2804
+ # ProjectRef is weak (it's owned by the mainGroup hierarchy).
2805
+ project_ref = PBXFileReference({
2806
+ 'lastKnownFileType': 'wrapper.pb-project',
2807
+ 'path': other_path,
2808
+ 'sourceTree': 'SOURCE_ROOT',
2809
+ })
2810
+ self.ProjectsGroup().AppendChild(project_ref)
2811
+
2812
+ ref_dict = {'ProductGroup': product_group, 'ProjectRef': project_ref}
2813
+ self._other_pbxprojects[other_pbxproject] = ref_dict
2814
+ self.AppendProperty('projectReferences', ref_dict)
2815
+
2816
+ # Xcode seems to sort this list case-insensitively
2817
+ self._properties['projectReferences'] = \
2818
+ sorted(self._properties['projectReferences'],
2819
+ key=lambda x: x['ProjectRef'].Name().lower())
2820
+ else:
2821
+ # The link already exists. Pull out the relevnt data.
2822
+ project_ref_dict = self._other_pbxprojects[other_pbxproject]
2823
+ product_group = project_ref_dict['ProductGroup']
2824
+ project_ref = project_ref_dict['ProjectRef']
2825
+
2826
+ self._SetUpProductReferences(other_pbxproject, product_group, project_ref)
2827
+
2828
+ inherit_unique_symroot = self._AllSymrootsUnique(other_pbxproject, False)
2829
+ targets = other_pbxproject.GetProperty('targets')
2830
+ if all(self._AllSymrootsUnique(t, inherit_unique_symroot) for t in targets):
2831
+ dir_path = project_ref._properties['path']
2832
+ product_group._hashables.extend(dir_path)
2833
+
2834
+ return [product_group, project_ref]
2835
+
2836
+ def _AllSymrootsUnique(self, target, inherit_unique_symroot):
2837
+ # Returns True if all configurations have a unique 'SYMROOT' attribute.
2838
+ # The value of inherit_unique_symroot decides, if a configuration is assumed
2839
+ # to inherit a unique 'SYMROOT' attribute from its parent, if it doesn't
2840
+ # define an explicit value for 'SYMROOT'.
2841
+ symroots = self._DefinedSymroots(target)
2842
+ for s in self._DefinedSymroots(target):
2843
+ if (s is not None and not self._IsUniqueSymrootForTarget(s) or
2844
+ s is None and not inherit_unique_symroot):
2845
+ return False
2846
+ return True if symroots else inherit_unique_symroot
2847
+
2848
+ def _DefinedSymroots(self, target):
2849
+ # Returns all values for the 'SYMROOT' attribute defined in all
2850
+ # configurations for this target. If any configuration doesn't define the
2851
+ # 'SYMROOT' attribute, None is added to the returned set. If all
2852
+ # configurations don't define the 'SYMROOT' attribute, an empty set is
2853
+ # returned.
2854
+ config_list = target.GetProperty('buildConfigurationList')
2855
+ symroots = set()
2856
+ for config in config_list.GetProperty('buildConfigurations'):
2857
+ setting = config.GetProperty('buildSettings')
2858
+ if 'SYMROOT' in setting:
2859
+ symroots.add(setting['SYMROOT'])
2860
+ else:
2861
+ symroots.add(None)
2862
+ if len(symroots) == 1 and None in symroots:
2863
+ return set()
2864
+ return symroots
2865
+
2866
+ def _IsUniqueSymrootForTarget(self, symroot):
2867
+ # This method returns True if all configurations in target contain a
2868
+ # 'SYMROOT' attribute that is unique for the given target. A value is
2869
+ # unique, if the Xcode macro '$SRCROOT' appears in it in any form.
2870
+ uniquifier = ['$SRCROOT', '$(SRCROOT)']
2871
+ if any(x in symroot for x in uniquifier):
2872
+ return True
2873
+ return False
2874
+
2875
+ def _SetUpProductReferences(self, other_pbxproject, product_group,
2876
+ project_ref):
2877
+ # TODO(mark): This only adds references to products in other_pbxproject
2878
+ # when they don't exist in this pbxproject. Perhaps it should also
2879
+ # remove references from this pbxproject that are no longer present in
2880
+ # other_pbxproject. Perhaps it should update various properties if they
2881
+ # change.
2882
+ for target in other_pbxproject._properties['targets']:
2883
+ if not isinstance(target, PBXNativeTarget):
2884
+ continue
2885
+
2886
+ other_fileref = target._properties['productReference']
2887
+ if product_group.GetChildByRemoteObject(other_fileref) is None:
2888
+ # Xcode sets remoteInfo to the name of the target and not the name
2889
+ # of its product, despite this proxy being a reference to the product.
2890
+ container_item = PBXContainerItemProxy({
2891
+ 'containerPortal': project_ref,
2892
+ 'proxyType': 2,
2893
+ 'remoteGlobalIDString': other_fileref,
2894
+ 'remoteInfo': target.Name()
2895
+ })
2896
+ # TODO(mark): Does sourceTree get copied straight over from the other
2897
+ # project? Can the other project ever have lastKnownFileType here
2898
+ # instead of explicitFileType? (Use it if so?) Can path ever be
2899
+ # unset? (I don't think so.) Can other_fileref have name set, and
2900
+ # does it impact the PBXReferenceProxy if so? These are the questions
2901
+ # that perhaps will be answered one day.
2902
+ reference_proxy = PBXReferenceProxy({
2903
+ 'fileType': other_fileref._properties['explicitFileType'],
2904
+ 'path': other_fileref._properties['path'],
2905
+ 'sourceTree': other_fileref._properties['sourceTree'],
2906
+ 'remoteRef': container_item,
2907
+ })
2908
+
2909
+ product_group.AppendChild(reference_proxy)
2910
+
2911
+ def SortRemoteProductReferences(self):
2912
+ # For each remote project file, sort the associated ProductGroup in the
2913
+ # same order that the targets are sorted in the remote project file. This
2914
+ # is the sort order used by Xcode.
2915
+
2916
+ for other_pbxproject, ref_dict in self._other_pbxprojects.items():
2917
+ # Build up a list of products in the remote project file, ordered the
2918
+ # same as the targets that produce them.
2919
+ remote_products = []
2920
+ for target in other_pbxproject._properties['targets']:
2921
+ if not isinstance(target, PBXNativeTarget):
2922
+ continue
2923
+ remote_products.append(target._properties['productReference'])
2924
+
2925
+ # Sort the PBXReferenceProxy children according to the list of remote
2926
+ # products.
2927
+ product_group = ref_dict['ProductGroup']
2928
+ product_group._properties['children'] = sorted(
2929
+ product_group._properties['children'],
2930
+ key=lambda x: remote_products.index(x._properties['remoteRef']._properties['remoteGlobalIDString']))
2931
+
2932
+
2933
+ class XCProjectFile(XCObject):
2934
+ _schema = XCObject._schema.copy()
2935
+ _schema.update({
2936
+ 'archiveVersion': [0, int, 0, 1, 1],
2937
+ 'classes': [0, dict, 0, 1, {}],
2938
+ 'objectVersion': [0, int, 0, 1, 46],
2939
+ 'rootObject': [0, PBXProject, 1, 1],
2940
+ })
2941
+
2942
+ def ComputeIDs(self, recursive=True, overwrite=True, hash=None):
2943
+ # Although XCProjectFile is implemented here as an XCObject, it's not a
2944
+ # proper object in the Xcode sense, and it certainly doesn't have its own
2945
+ # ID. Pass through an attempt to update IDs to the real root object.
2946
+ if recursive:
2947
+ self._properties['rootObject'].ComputeIDs(recursive, overwrite, hash)
2948
+
2949
+ def Print(self, file=sys.stdout):
2950
+ self.VerifyHasRequiredProperties()
2951
+
2952
+ # Add the special "objects" property, which will be caught and handled
2953
+ # separately during printing. This structure allows a fairly standard
2954
+ # loop do the normal printing.
2955
+ self._properties['objects'] = {}
2956
+ self._XCPrint(file, 0, '// !$*UTF8*$!\n')
2957
+ if self._should_print_single_line:
2958
+ self._XCPrint(file, 0, '{ ')
2959
+ else:
2960
+ self._XCPrint(file, 0, '{\n')
2961
+ for property, value in sorted(self._properties.items()):
2962
+ if property == 'objects':
2963
+ self._PrintObjects(file)
2964
+ else:
2965
+ self._XCKVPrint(file, 1, property, value)
2966
+ self._XCPrint(file, 0, '}\n')
2967
+ del self._properties['objects']
2968
+
2969
+ def _PrintObjects(self, file):
2970
+ if self._should_print_single_line:
2971
+ self._XCPrint(file, 0, 'objects = {')
2972
+ else:
2973
+ self._XCPrint(file, 1, 'objects = {\n')
2974
+
2975
+ objects_by_class = {}
2976
+ for object in self.Descendants():
2977
+ if object == self:
2978
+ continue
2979
+ class_name = object.__class__.__name__
2980
+ if not class_name in objects_by_class:
2981
+ objects_by_class[class_name] = []
2982
+ objects_by_class[class_name].append(object)
2983
+
2984
+ for class_name in sorted(objects_by_class):
2985
+ self._XCPrint(file, 0, '\n')
2986
+ self._XCPrint(file, 0, '/* Begin ' + class_name + ' section */\n')
2987
+ for object in sorted(objects_by_class[class_name],
2988
+ key=lambda x: x.id):
2989
+ object.Print(file)
2990
+ self._XCPrint(file, 0, '/* End ' + class_name + ' section */\n')
2991
+
2992
+ if self._should_print_single_line:
2993
+ self._XCPrint(file, 0, '}; ')
2994
+ else:
2995
+ self._XCPrint(file, 1, '};\n')