redsnow 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +34 -0
  3. data/.gitmodules +3 -0
  4. data/.travis.yml +20 -0
  5. data/CHANGELOG.md +4 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE +21 -0
  8. data/README.md +62 -0
  9. data/Rakefile +36 -0
  10. data/Vagrantfile +20 -0
  11. data/ext/snowcrash/Makefile +64 -0
  12. data/ext/snowcrash/Vagrantfile +20 -0
  13. data/ext/snowcrash/bin/snowcrash +0 -0
  14. data/ext/snowcrash/common.gypi +163 -0
  15. data/ext/snowcrash/config.gypi +10 -0
  16. data/ext/snowcrash/config.mk +5 -0
  17. data/ext/snowcrash/configure +213 -0
  18. data/ext/snowcrash/provisioning.sh +15 -0
  19. data/ext/snowcrash/snowcrash.gyp +141 -0
  20. data/ext/snowcrash/src/ActionParser.h +503 -0
  21. data/ext/snowcrash/src/AssetParser.h +215 -0
  22. data/ext/snowcrash/src/BlockUtility.h +186 -0
  23. data/ext/snowcrash/src/Blueprint.h +283 -0
  24. data/ext/snowcrash/src/BlueprintParser.h +347 -0
  25. data/ext/snowcrash/src/BlueprintParserCore.h +190 -0
  26. data/ext/snowcrash/src/BlueprintSection.h +140 -0
  27. data/ext/snowcrash/src/BlueprintUtility.h +126 -0
  28. data/ext/snowcrash/src/CBlueprint.cc +600 -0
  29. data/ext/snowcrash/src/CBlueprint.h +354 -0
  30. data/ext/snowcrash/src/CSourceAnnotation.cc +140 -0
  31. data/ext/snowcrash/src/CSourceAnnotation.h +106 -0
  32. data/ext/snowcrash/src/CodeBlockUtility.h +189 -0
  33. data/ext/snowcrash/src/DescriptionSectionUtility.h +156 -0
  34. data/ext/snowcrash/src/HTTP.cc +46 -0
  35. data/ext/snowcrash/src/HTTP.h +105 -0
  36. data/ext/snowcrash/src/HeaderParser.h +289 -0
  37. data/ext/snowcrash/src/ListBlockUtility.h +273 -0
  38. data/ext/snowcrash/src/ListUtility.h +95 -0
  39. data/ext/snowcrash/src/MarkdownBlock.cc +176 -0
  40. data/ext/snowcrash/src/MarkdownBlock.h +93 -0
  41. data/ext/snowcrash/src/MarkdownParser.cc +266 -0
  42. data/ext/snowcrash/src/MarkdownParser.h +88 -0
  43. data/ext/snowcrash/src/ParameterDefinitonParser.h +570 -0
  44. data/ext/snowcrash/src/ParametersParser.h +252 -0
  45. data/ext/snowcrash/src/Parser.cc +71 -0
  46. data/ext/snowcrash/src/Parser.h +29 -0
  47. data/ext/snowcrash/src/ParserCore.cc +120 -0
  48. data/ext/snowcrash/src/ParserCore.h +82 -0
  49. data/ext/snowcrash/src/PayloadParser.h +672 -0
  50. data/ext/snowcrash/src/Platform.h +54 -0
  51. data/ext/snowcrash/src/RegexMatch.h +32 -0
  52. data/ext/snowcrash/src/ResourceGroupParser.h +195 -0
  53. data/ext/snowcrash/src/ResourceParser.h +584 -0
  54. data/ext/snowcrash/src/SectionUtility.h +142 -0
  55. data/ext/snowcrash/src/Serialize.cc +52 -0
  56. data/ext/snowcrash/src/Serialize.h +69 -0
  57. data/ext/snowcrash/src/SerializeJSON.cc +601 -0
  58. data/ext/snowcrash/src/SerializeJSON.h +21 -0
  59. data/ext/snowcrash/src/SerializeYAML.cc +336 -0
  60. data/ext/snowcrash/src/SerializeYAML.h +21 -0
  61. data/ext/snowcrash/src/SourceAnnotation.h +177 -0
  62. data/ext/snowcrash/src/StringUtility.h +109 -0
  63. data/ext/snowcrash/src/SymbolTable.h +83 -0
  64. data/ext/snowcrash/src/UriTemplateParser.cc +195 -0
  65. data/ext/snowcrash/src/UriTemplateParser.h +243 -0
  66. data/ext/snowcrash/src/Version.h +39 -0
  67. data/ext/snowcrash/src/csnowcrash.cc +23 -0
  68. data/ext/snowcrash/src/csnowcrash.h +38 -0
  69. data/ext/snowcrash/src/posix/RegexMatch.cc +99 -0
  70. data/ext/snowcrash/src/snowcrash.cc +18 -0
  71. data/ext/snowcrash/src/snowcrash.h +41 -0
  72. data/ext/snowcrash/src/snowcrash/snowcrash.cc +170 -0
  73. data/ext/snowcrash/src/win/RegexMatch.cc +78 -0
  74. data/ext/snowcrash/sundown/CONTRIBUTING.md +10 -0
  75. data/ext/snowcrash/sundown/Makefile +83 -0
  76. data/ext/snowcrash/sundown/Makefile.win +33 -0
  77. data/ext/snowcrash/sundown/examples/smartypants.c +72 -0
  78. data/ext/snowcrash/sundown/examples/sundown.c +80 -0
  79. data/ext/snowcrash/sundown/html/houdini.h +37 -0
  80. data/ext/snowcrash/sundown/html/houdini_href_e.c +108 -0
  81. data/ext/snowcrash/sundown/html/houdini_html_e.c +84 -0
  82. data/ext/snowcrash/sundown/html/html.c +647 -0
  83. data/ext/snowcrash/sundown/html/html.h +77 -0
  84. data/ext/snowcrash/sundown/html/html_smartypants.c +389 -0
  85. data/ext/snowcrash/sundown/html_block_names.txt +25 -0
  86. data/ext/snowcrash/sundown/src/autolink.c +297 -0
  87. data/ext/snowcrash/sundown/src/autolink.h +51 -0
  88. data/ext/snowcrash/sundown/src/buffer.c +225 -0
  89. data/ext/snowcrash/sundown/src/buffer.h +96 -0
  90. data/ext/snowcrash/sundown/src/html_blocks.h +206 -0
  91. data/ext/snowcrash/sundown/src/markdown.c +2701 -0
  92. data/ext/snowcrash/sundown/src/markdown.h +147 -0
  93. data/ext/snowcrash/sundown/src/src_map.c +200 -0
  94. data/ext/snowcrash/sundown/src/src_map.h +58 -0
  95. data/ext/snowcrash/sundown/src/stack.c +81 -0
  96. data/ext/snowcrash/sundown/src/stack.h +29 -0
  97. data/ext/snowcrash/sundown/sundown.def +20 -0
  98. data/ext/snowcrash/tools/gyp/AUTHORS +11 -0
  99. data/ext/snowcrash/tools/gyp/DEPS +24 -0
  100. data/ext/snowcrash/tools/gyp/OWNERS +1 -0
  101. data/ext/snowcrash/tools/gyp/PRESUBMIT.py +120 -0
  102. data/ext/snowcrash/tools/gyp/buildbot/buildbot_run.py +190 -0
  103. data/ext/snowcrash/tools/gyp/codereview.settings +10 -0
  104. data/ext/snowcrash/tools/gyp/data/win/large-pdb-shim.cc +12 -0
  105. data/ext/snowcrash/tools/gyp/gyp +8 -0
  106. data/ext/snowcrash/tools/gyp/gyp.bat +5 -0
  107. data/ext/snowcrash/tools/gyp/gyp_main.py +18 -0
  108. data/ext/snowcrash/tools/gyp/pylib/gyp/MSVSNew.py +340 -0
  109. data/ext/snowcrash/tools/gyp/pylib/gyp/MSVSProject.py +208 -0
  110. data/ext/snowcrash/tools/gyp/pylib/gyp/MSVSSettings.py +1063 -0
  111. data/ext/snowcrash/tools/gyp/pylib/gyp/MSVSToolFile.py +58 -0
  112. data/ext/snowcrash/tools/gyp/pylib/gyp/MSVSUserFile.py +147 -0
  113. data/ext/snowcrash/tools/gyp/pylib/gyp/MSVSUtil.py +267 -0
  114. data/ext/snowcrash/tools/gyp/pylib/gyp/MSVSVersion.py +409 -0
  115. data/ext/snowcrash/tools/gyp/pylib/gyp/__init__.py +537 -0
  116. data/ext/snowcrash/tools/gyp/pylib/gyp/__init__.pyc +0 -0
  117. data/ext/snowcrash/tools/gyp/pylib/gyp/common.py +521 -0
  118. data/ext/snowcrash/tools/gyp/pylib/gyp/common.pyc +0 -0
  119. data/ext/snowcrash/tools/gyp/pylib/gyp/easy_xml.py +157 -0
  120. data/ext/snowcrash/tools/gyp/pylib/gyp/flock_tool.py +49 -0
  121. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.py +0 -0
  122. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/__init__.pyc +0 -0
  123. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/android.py +1069 -0
  124. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/cmake.py +1143 -0
  125. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/dump_dependency_json.py +81 -0
  126. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/eclipse.py +335 -0
  127. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/gypd.py +87 -0
  128. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/gypsh.py +56 -0
  129. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/make.py +2181 -0
  130. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyc +0 -0
  131. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/msvs.py +3335 -0
  132. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/ninja.py +2156 -0
  133. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.py +1224 -0
  134. data/ext/snowcrash/tools/gyp/pylib/gyp/generator/xcode.pyc +0 -0
  135. data/ext/snowcrash/tools/gyp/pylib/gyp/input.py +2809 -0
  136. data/ext/snowcrash/tools/gyp/pylib/gyp/input.pyc +0 -0
  137. data/ext/snowcrash/tools/gyp/pylib/gyp/mac_tool.py +510 -0
  138. data/ext/snowcrash/tools/gyp/pylib/gyp/msvs_emulation.py +972 -0
  139. data/ext/snowcrash/tools/gyp/pylib/gyp/ninja_syntax.py +160 -0
  140. data/ext/snowcrash/tools/gyp/pylib/gyp/ordered_dict.py +289 -0
  141. data/ext/snowcrash/tools/gyp/pylib/gyp/win_tool.py +292 -0
  142. data/ext/snowcrash/tools/gyp/pylib/gyp/xcode_emulation.py +1440 -0
  143. data/ext/snowcrash/tools/gyp/pylib/gyp/xcode_emulation.pyc +0 -0
  144. data/ext/snowcrash/tools/gyp/pylib/gyp/xcodeproj_file.py +2889 -0
  145. data/ext/snowcrash/tools/gyp/pylib/gyp/xcodeproj_file.pyc +0 -0
  146. data/ext/snowcrash/tools/gyp/pylib/gyp/xml_fix.py +69 -0
  147. data/ext/snowcrash/tools/gyp/pylintrc +307 -0
  148. data/ext/snowcrash/tools/gyp/samples/samples +81 -0
  149. data/ext/snowcrash/tools/gyp/samples/samples.bat +5 -0
  150. data/ext/snowcrash/tools/gyp/setup.py +19 -0
  151. data/ext/snowcrash/tools/gyp/tools/Xcode/Specifications/gyp.pbfilespec +27 -0
  152. data/ext/snowcrash/tools/gyp/tools/Xcode/Specifications/gyp.xclangspec +226 -0
  153. data/ext/snowcrash/tools/gyp/tools/emacs/gyp.el +252 -0
  154. data/ext/snowcrash/tools/gyp/tools/graphviz.py +100 -0
  155. data/ext/snowcrash/tools/gyp/tools/pretty_gyp.py +155 -0
  156. data/ext/snowcrash/tools/gyp/tools/pretty_sln.py +168 -0
  157. data/ext/snowcrash/tools/gyp/tools/pretty_vcproj.py +329 -0
  158. data/ext/snowcrash/tools/homebrew/snowcrash.rb +11 -0
  159. data/ext/snowcrash/vcbuild.bat +184 -0
  160. data/lib/redsnow.rb +31 -0
  161. data/lib/redsnow/binding.rb +132 -0
  162. data/lib/redsnow/blueprint.rb +365 -0
  163. data/lib/redsnow/object.rb +18 -0
  164. data/lib/redsnow/parseresult.rb +107 -0
  165. data/lib/redsnow/version.rb +4 -0
  166. data/provisioning.sh +20 -0
  167. data/redsnow.gemspec +35 -0
  168. data/test/_helper.rb +15 -0
  169. data/test/fixtures/sample-api-ast.json +97 -0
  170. data/test/fixtures/sample-api.apib +20 -0
  171. data/test/redsnow_binding_test.rb +35 -0
  172. data/test/redsnow_parseresult_test.rb +50 -0
  173. data/test/redsnow_test.rb +285 -0
  174. metadata +358 -0
@@ -0,0 +1,29 @@
1
+ #ifndef STACK_H__
2
+ #define STACK_H__
3
+
4
+ #include <stdlib.h>
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ struct stack {
11
+ void **item;
12
+ size_t size;
13
+ size_t asize;
14
+ };
15
+
16
+ void stack_free(struct stack *);
17
+ int stack_grow(struct stack *, size_t);
18
+ int stack_init(struct stack *, size_t);
19
+
20
+ int stack_push(struct stack *, void *);
21
+
22
+ void *stack_pop(struct stack *);
23
+ void *stack_top(struct stack *);
24
+
25
+ #ifdef __cplusplus
26
+ }
27
+ #endif
28
+
29
+ #endif
@@ -0,0 +1,20 @@
1
+ LIBRARY SUNDOWN
2
+ EXPORTS
3
+ sdhtml_renderer
4
+ sdhtml_toc_renderer
5
+ sdhtml_smartypants
6
+ bufgrow
7
+ bufnew
8
+ bufcstr
9
+ bufprefix
10
+ bufput
11
+ bufputs
12
+ bufputc
13
+ bufrelease
14
+ bufreset
15
+ bufslurp
16
+ bufprintf
17
+ sd_markdown_new
18
+ sd_markdown_render
19
+ sd_markdown_free
20
+ sd_version
@@ -0,0 +1,11 @@
1
+ # Names should be added to this file like so:
2
+ # Name or Organization <email address>
3
+
4
+ Google Inc.
5
+ Bloomberg Finance L.P.
6
+ Yandex LLC
7
+
8
+ Steven Knight <knight@baldmt.com>
9
+ Ryan Norton <rnorton10@gmail.com>
10
+ David J. Sankel <david@sankelsoftware.com>
11
+ Eric N. Vander Weele <ericvw@gmail.com>
@@ -0,0 +1,24 @@
1
+ # DEPS file for gclient use in buildbot execution of gyp tests.
2
+ #
3
+ # (You don't need to use gclient for normal GYP development work.)
4
+
5
+ vars = {
6
+ "chrome_trunk": "http://src.chromium.org/svn/trunk",
7
+ "googlecode_url": "http://%s.googlecode.com/svn",
8
+ }
9
+
10
+ deps = {
11
+ }
12
+
13
+ deps_os = {
14
+ "win": {
15
+ "third_party/cygwin":
16
+ Var("chrome_trunk") + "/deps/third_party/cygwin@66844",
17
+
18
+ "third_party/python_26":
19
+ Var("chrome_trunk") + "/tools/third_party/python_26@89111",
20
+
21
+ "src/third_party/pefile":
22
+ (Var("googlecode_url") % "pefile") + "/trunk@63",
23
+ },
24
+ }
@@ -0,0 +1,120 @@
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
+
6
+ """Top-level presubmit script for GYP.
7
+
8
+ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
9
+ for more details about the presubmit API built into gcl.
10
+ """
11
+
12
+
13
+ PYLINT_BLACKLIST = [
14
+ # TODO: fix me.
15
+ # From SCons, not done in google style.
16
+ 'test/lib/TestCmd.py',
17
+ 'test/lib/TestCommon.py',
18
+ 'test/lib/TestGyp.py',
19
+ # Needs style fix.
20
+ 'pylib/gyp/generator/xcode.py',
21
+ ]
22
+
23
+
24
+ PYLINT_DISABLED_WARNINGS = [
25
+ # TODO: fix me.
26
+ # Many tests include modules they don't use.
27
+ 'W0611',
28
+ # Include order doesn't properly include local files?
29
+ 'F0401',
30
+ # Some use of built-in names.
31
+ 'W0622',
32
+ # Some unused variables.
33
+ 'W0612',
34
+ # Operator not preceded/followed by space.
35
+ 'C0323',
36
+ 'C0322',
37
+ # Unnecessary semicolon.
38
+ 'W0301',
39
+ # Unused argument.
40
+ 'W0613',
41
+ # String has no effect (docstring in wrong place).
42
+ 'W0105',
43
+ # Comma not followed by space.
44
+ 'C0324',
45
+ # Access to a protected member.
46
+ 'W0212',
47
+ # Bad indent.
48
+ 'W0311',
49
+ # Line too long.
50
+ 'C0301',
51
+ # Undefined variable.
52
+ 'E0602',
53
+ # Not exception type specified.
54
+ 'W0702',
55
+ # No member of that name.
56
+ 'E1101',
57
+ # Dangerous default {}.
58
+ 'W0102',
59
+ # Others, too many to sort.
60
+ 'W0201', 'W0232', 'E1103', 'W0621', 'W0108', 'W0223', 'W0231',
61
+ 'R0201', 'E0101', 'C0321',
62
+ # ************* Module copy
63
+ # W0104:427,12:_test.odict.__setitem__: Statement seems to have no effect
64
+ 'W0104',
65
+ ]
66
+
67
+
68
+ def CheckChangeOnUpload(input_api, output_api):
69
+ report = []
70
+ report.extend(input_api.canned_checks.PanProjectChecks(
71
+ input_api, output_api))
72
+ return report
73
+
74
+
75
+ def CheckChangeOnCommit(input_api, output_api):
76
+ report = []
77
+
78
+ # Accept any year number from 2009 to the current year.
79
+ current_year = int(input_api.time.strftime('%Y'))
80
+ allowed_years = (str(s) for s in reversed(xrange(2009, current_year + 1)))
81
+ years_re = '(' + '|'.join(allowed_years) + ')'
82
+
83
+ # The (c) is deprecated, but tolerate it until it's removed from all files.
84
+ license = (
85
+ r'.*? Copyright (\(c\) )?%(year)s Google Inc\. All rights reserved\.\n'
86
+ r'.*? Use of this source code is governed by a BSD-style license that '
87
+ r'can be\n'
88
+ r'.*? found in the LICENSE file\.\n'
89
+ ) % {
90
+ 'year': years_re,
91
+ }
92
+
93
+ report.extend(input_api.canned_checks.PanProjectChecks(
94
+ input_api, output_api, license_header=license))
95
+ report.extend(input_api.canned_checks.CheckTreeIsOpen(
96
+ input_api, output_api,
97
+ 'http://gyp-status.appspot.com/status',
98
+ 'http://gyp-status.appspot.com/current'))
99
+
100
+ import os
101
+ import sys
102
+ old_sys_path = sys.path
103
+ try:
104
+ sys.path = ['pylib', 'test/lib'] + sys.path
105
+ blacklist = PYLINT_BLACKLIST
106
+ if sys.platform == 'win32':
107
+ blacklist = [os.path.normpath(x).replace('\\', '\\\\')
108
+ for x in PYLINT_BLACKLIST]
109
+ report.extend(input_api.canned_checks.RunPylint(
110
+ input_api,
111
+ output_api,
112
+ black_list=blacklist,
113
+ disabled_warnings=PYLINT_DISABLED_WARNINGS))
114
+ finally:
115
+ sys.path = old_sys_path
116
+ return report
117
+
118
+
119
+ def GetPreferredTrySlaves():
120
+ return ['gyp-win32', 'gyp-win64', 'gyp-linux', 'gyp-mac', 'gyp-android']
@@ -0,0 +1,190 @@
1
+ #!/usr/bin/env python
2
+ # Copyright (c) 2012 Google Inc. All rights reserved.
3
+ # Use of this source code is governed by a BSD-style license that can be
4
+ # found in the LICENSE file.
5
+
6
+
7
+ """Argument-less script to select what to run on the buildbots."""
8
+
9
+
10
+ import os
11
+ import shutil
12
+ import subprocess
13
+ import sys
14
+
15
+
16
+ if sys.platform in ['win32', 'cygwin']:
17
+ EXE_SUFFIX = '.exe'
18
+ else:
19
+ EXE_SUFFIX = ''
20
+
21
+
22
+ BUILDBOT_DIR = os.path.dirname(os.path.abspath(__file__))
23
+ TRUNK_DIR = os.path.dirname(BUILDBOT_DIR)
24
+ ROOT_DIR = os.path.dirname(TRUNK_DIR)
25
+ ANDROID_DIR = os.path.join(ROOT_DIR, 'android')
26
+ CMAKE_DIR = os.path.join(ROOT_DIR, 'cmake')
27
+ CMAKE_BIN_DIR = os.path.join(CMAKE_DIR, 'bin')
28
+ OUT_DIR = os.path.join(TRUNK_DIR, 'out')
29
+
30
+
31
+ def CallSubProcess(*args, **kwargs):
32
+ """Wrapper around subprocess.call which treats errors as build exceptions."""
33
+ retcode = subprocess.call(*args, **kwargs)
34
+ if retcode != 0:
35
+ print '@@@STEP_EXCEPTION@@@'
36
+ sys.exit(1)
37
+
38
+
39
+ def PrepareCmake():
40
+ """Build CMake 2.8.8 since the version in Precise is 2.8.7."""
41
+ if os.environ['BUILDBOT_CLOBBER'] == '1':
42
+ print '@@@BUILD_STEP Clobber CMake checkout@@@'
43
+ shutil.rmtree(CMAKE_DIR)
44
+
45
+ # We always build CMake 2.8.8, so no need to do anything
46
+ # if the directory already exists.
47
+ if os.path.isdir(CMAKE_DIR):
48
+ return
49
+
50
+ print '@@@BUILD_STEP Initialize CMake checkout@@@'
51
+ os.mkdir(CMAKE_DIR)
52
+ CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot'])
53
+ CallSubProcess(['git', 'config', '--global',
54
+ 'user.email', 'chrome-bot@google.com'])
55
+ CallSubProcess(['git', 'config', '--global', 'color.ui', 'false'])
56
+
57
+ print '@@@BUILD_STEP Sync CMake@@@'
58
+ CallSubProcess(
59
+ ['git', 'clone',
60
+ '--depth', '1',
61
+ '--single-branch',
62
+ '--branch', 'v2.8.8',
63
+ '--',
64
+ 'git://cmake.org/cmake.git',
65
+ CMAKE_DIR],
66
+ cwd=CMAKE_DIR)
67
+
68
+ print '@@@BUILD_STEP Build CMake@@@'
69
+ CallSubProcess(
70
+ ['/bin/bash', 'bootstrap', '--prefix=%s' % CMAKE_DIR],
71
+ cwd=CMAKE_DIR)
72
+
73
+ CallSubProcess( ['make', 'cmake'], cwd=CMAKE_DIR)
74
+
75
+
76
+ def PrepareAndroidTree():
77
+ """Prepare an Android tree to run 'android' format tests."""
78
+ if os.environ['BUILDBOT_CLOBBER'] == '1':
79
+ print '@@@BUILD_STEP Clobber Android checkout@@@'
80
+ shutil.rmtree(ANDROID_DIR)
81
+
82
+ # The release of Android we use is static, so there's no need to do anything
83
+ # if the directory already exists.
84
+ if os.path.isdir(ANDROID_DIR):
85
+ return
86
+
87
+ print '@@@BUILD_STEP Initialize Android checkout@@@'
88
+ os.mkdir(ANDROID_DIR)
89
+ CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot'])
90
+ CallSubProcess(['git', 'config', '--global',
91
+ 'user.email', 'chrome-bot@google.com'])
92
+ CallSubProcess(['git', 'config', '--global', 'color.ui', 'false'])
93
+ CallSubProcess(
94
+ ['repo', 'init',
95
+ '-u', 'https://android.googlesource.com/platform/manifest',
96
+ '-b', 'android-4.2.1_r1',
97
+ '-g', 'all,-notdefault,-device,-darwin,-mips,-x86'],
98
+ cwd=ANDROID_DIR)
99
+
100
+ print '@@@BUILD_STEP Sync Android@@@'
101
+ CallSubProcess(['repo', 'sync', '-j4'], cwd=ANDROID_DIR)
102
+
103
+ print '@@@BUILD_STEP Build Android@@@'
104
+ CallSubProcess(
105
+ ['/bin/bash',
106
+ '-c', 'source build/envsetup.sh && lunch full-eng && make -j4'],
107
+ cwd=ANDROID_DIR)
108
+
109
+
110
+ def GypTestFormat(title, format=None, msvs_version=None):
111
+ """Run the gyp tests for a given format, emitting annotator tags.
112
+
113
+ See annotator docs at:
114
+ https://sites.google.com/a/chromium.org/dev/developers/testing/chromium-build-infrastructure/buildbot-annotations
115
+ Args:
116
+ format: gyp format to test.
117
+ Returns:
118
+ 0 for sucesss, 1 for failure.
119
+ """
120
+ if not format:
121
+ format = title
122
+
123
+ print '@@@BUILD_STEP ' + title + '@@@'
124
+ sys.stdout.flush()
125
+ env = os.environ.copy()
126
+ if msvs_version:
127
+ env['GYP_MSVS_VERSION'] = msvs_version
128
+ command = ' '.join(
129
+ [sys.executable, 'trunk/gyptest.py',
130
+ '--all',
131
+ '--passed',
132
+ '--format', format,
133
+ '--path', CMAKE_BIN_DIR,
134
+ '--chdir', 'trunk'])
135
+ if format == 'android':
136
+ # gyptest needs the environment setup from envsetup/lunch in order to build
137
+ # using the 'android' backend, so this is done in a single shell.
138
+ retcode = subprocess.call(
139
+ ['/bin/bash',
140
+ '-c', 'source build/envsetup.sh && lunch full-eng && cd %s && %s'
141
+ % (ROOT_DIR, command)],
142
+ cwd=ANDROID_DIR, env=env)
143
+ else:
144
+ retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
145
+ if retcode:
146
+ # Emit failure tag, and keep going.
147
+ print '@@@STEP_FAILURE@@@'
148
+ return 1
149
+ return 0
150
+
151
+
152
+ def GypBuild():
153
+ # Dump out/ directory.
154
+ print '@@@BUILD_STEP cleanup@@@'
155
+ print 'Removing %s...' % OUT_DIR
156
+ shutil.rmtree(OUT_DIR, ignore_errors=True)
157
+ print 'Done.'
158
+
159
+ retcode = 0
160
+ # The Android gyp bot runs on linux so this must be tested first.
161
+ if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-android':
162
+ PrepareAndroidTree()
163
+ retcode += GypTestFormat('android')
164
+ elif sys.platform.startswith('linux'):
165
+ retcode += GypTestFormat('ninja')
166
+ retcode += GypTestFormat('make')
167
+ PrepareCmake()
168
+ retcode += GypTestFormat('cmake')
169
+ elif sys.platform == 'darwin':
170
+ retcode += GypTestFormat('ninja')
171
+ retcode += GypTestFormat('xcode')
172
+ retcode += GypTestFormat('make')
173
+ elif sys.platform == 'win32':
174
+ retcode += GypTestFormat('ninja')
175
+ if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-win64':
176
+ retcode += GypTestFormat('msvs-2010', format='msvs', msvs_version='2010')
177
+ retcode += GypTestFormat('msvs-2012', format='msvs', msvs_version='2012')
178
+ else:
179
+ raise Exception('Unknown platform')
180
+ if retcode:
181
+ # TODO(bradnelson): once the annotator supports a postscript (section for
182
+ # after the build proper that could be used for cumulative failures),
183
+ # use that instead of this. This isolates the final return value so
184
+ # that it isn't misattributed to the last stage.
185
+ print '@@@BUILD_STEP failures@@@'
186
+ sys.exit(retcode)
187
+
188
+
189
+ if __name__ == '__main__':
190
+ GypBuild()
@@ -0,0 +1,10 @@
1
+ # This file is used by gcl to get repository specific information.
2
+ CODE_REVIEW_SERVER: codereview.chromium.org
3
+ CC_LIST: gyp-developer@googlegroups.com
4
+ VIEW_VC: http://code.google.com/p/gyp/source/detail?r=
5
+ TRY_ON_UPLOAD: True
6
+ TRYSERVER_PROJECT: gyp
7
+ TRYSERVER_PATCHLEVEL: 0
8
+ TRYSERVER_ROOT: trunk
9
+ TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try-nacl
10
+
@@ -0,0 +1,12 @@
1
+ // Copyright (c) 2013 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
+ // This file is used to generate an empty .pdb -- with a 4KB pagesize -- that is
6
+ // then used during the final link for modules that have large PDBs. Otherwise,
7
+ // the linker will generate a pdb with a page size of 1KB, which imposes a limit
8
+ // of 1GB on the .pdb. By generating an initial empty .pdb with the compiler
9
+ // (rather than the linker), this limit is avoided. With this in place PDBs may
10
+ // grow to 2GB.
11
+ //
12
+ // This file is referenced by the msvs_large_pdb mechanism in MSVSUtil.py.
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+ # Copyright 2013 The Chromium Authors. All rights reserved.
3
+ # Use of this source code is governed by a BSD-style license that can be
4
+ # found in the LICENSE file.
5
+
6
+ set -e
7
+ base=$(dirname "$0")
8
+ exec python "${base}/gyp_main.py" "$@"
@@ -0,0 +1,5 @@
1
+ @rem Copyright (c) 2009 Google Inc. All rights reserved.
2
+ @rem Use of this source code is governed by a BSD-style license that can be
3
+ @rem found in the LICENSE file.
4
+
5
+ @python "%~dp0gyp_main.py" %*
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env python
2
+
3
+ # Copyright (c) 2009 Google Inc. All rights reserved.
4
+ # Use of this source code is governed by a BSD-style license that can be
5
+ # found in the LICENSE file.
6
+
7
+ import sys
8
+
9
+ # TODO(mark): sys.path manipulation is some temporary testing stuff.
10
+ try:
11
+ import gyp
12
+ except ImportError, e:
13
+ import os.path
14
+ sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
15
+ import gyp
16
+
17
+ if __name__ == '__main__':
18
+ sys.exit(gyp.script_main())