Browse files

shuffle things around

  • Loading branch information...
1 parent 81a8b43 commit 8506efe0973a9e6aaba68ce848f93731bdf83c99 @rhysbrettbowen committed Apr 4, 2012
Showing with 0 additions and 19,647 deletions.
  1. 0 all_tests.html → .svn/text-base/all_tests.html.svn-base
  2. 0 alltests.js → .svn/text-base/alltests.js.svn-base
  3. 0 collection_test.html → .svn/text-base/collection_test.html.svn-base
  4. 0 collection_test.js → .svn/text-base/collection_test.js.svn-base
  5. 0 control_test.html → .svn/text-base/control_test.html.svn-base
  6. 0 control_test.js → .svn/text-base/control_test.js.svn-base
  7. 0 mediator_test.html → .svn/text-base/mediator_test.html.svn-base
  8. 0 mediator_test.js → .svn/text-base/mediator_test.js.svn-base
  9. 0 model_test.html → .svn/text-base/model_test.html.svn-base
  10. 0 model_test.js → .svn/text-base/model_test.js.svn-base
  11. 0 router_test.html → .svn/text-base/router_test.html.svn-base
  12. 0 router_test.js → .svn/text-base/router_test.js.svn-base
  13. 0 store_test.html → .svn/text-base/store_test.html.svn-base
  14. 0 store_test.js → .svn/text-base/store_test.js.svn-base
  15. 0 test_deps.js → .svn/text-base/test_deps.js.svn-base
  16. BIN closure-library/.DS_Store
  17. +0 −17 closure-library/.svn/all-wcprops
  18. +0 −99 closure-library/.svn/entries
  19. +0 −5 closure-library/.svn/prop-base/closure-library.tar.gz.svn-base
  20. BIN closure-library/.svn/text-base/closure-library.tar.gz.svn-base
  21. +0 −11 closure-library/.svn/text-base/update.sh.svn-base
  22. +0 −14 closure-library/AUTHORS
  23. +0 −176 closure-library/LICENSE
  24. +0 −6 closure-library/README
  25. +0 −16 closure-library/alltests.js
  26. +0 −256 closure-library/closure/bin/build/closurebuilder.py
  27. +0 −186 closure-library/closure/bin/build/depstree.py
  28. +0 −127 closure-library/closure/bin/build/depstree_test.py
  29. +0 −206 closure-library/closure/bin/build/depswriter.py
  30. +0 −71 closure-library/closure/bin/build/jscompiler.py
  31. +0 −100 closure-library/closure/bin/build/source.py
  32. +0 −82 closure-library/closure/bin/build/source_test.py
  33. +0 −78 closure-library/closure/bin/build/treescan.py
  34. +0 −570 closure-library/closure/bin/calcdeps.py
  35. +0 −211 closure-library/closure/bin/scopify.py
  36. +0 −82 closure-library/closure/css/inlay/g-base.css
  37. +0 −173 closure-library/closure/css/inlay/g-fixed.css
  38. +0 −253 closure-library/closure/css/inlay/g-ratio.css
  39. +0 −1,348 closure-library/closure/goog/array/array.js
  40. +0 −1,542 closure-library/closure/goog/array/array_test.html
  41. +0 −277 closure-library/closure/goog/asserts/asserts.js
  42. +0 −163 closure-library/closure/goog/asserts/asserts_test.html
  43. +0 −235 closure-library/closure/goog/async/conditionaldelay.js
  44. +0 −227 closure-library/closure/goog/async/conditionaldelay_test.html
  45. +0 −176 closure-library/closure/goog/async/delay.js
  46. +0 −148 closure-library/closure/goog/async/delay_test.html
  47. +0 −189 closure-library/closure/goog/async/throttle.js
  48. +0 −102 closure-library/closure/goog/async/throttle_test.html
  49. +0 −1,523 closure-library/closure/goog/base.js
  50. +0 −1,235 closure-library/closure/goog/base_test.html
  51. +0 −37 closure-library/closure/goog/bootstrap/webworkers.js
  52. +0 −467 closure-library/closure/goog/color/alpha.js
  53. +0 −301 closure-library/closure/goog/color/alpha_test.html
  54. +0 −771 closure-library/closure/goog/color/color.js
  55. +0 −661 closure-library/closure/goog/color/color_test.html
  56. +0 −176 closure-library/closure/goog/color/names.js
  57. +0 −162 closure-library/closure/goog/crypt/arc4.js
  58. +0 −63 closure-library/closure/goog/crypt/arc4_test.html
  59. +0 −270 closure-library/closure/goog/crypt/base64.js
  60. +0 −117 closure-library/closure/goog/crypt/base64_test.html
  61. +0 −242 closure-library/closure/goog/crypt/basen.js
  62. +0 −167 closure-library/closure/goog/crypt/basen_test.html
  63. +0 −229 closure-library/closure/goog/crypt/blobhasher.js
  64. +0 −239 closure-library/closure/goog/crypt/blobhasher_test.html
  65. +0 −119 closure-library/closure/goog/crypt/crypt.js
  66. +0 −85 closure-library/closure/goog/crypt/crypt_perf.html
  67. +0 −68 closure-library/closure/goog/crypt/crypt_test.html
  68. +0 −54 closure-library/closure/goog/crypt/hash.js
  69. +0 −184 closure-library/closure/goog/crypt/hash32.js
  70. +0 −287 closure-library/closure/goog/crypt/hash32_test.html
  71. +0 −83 closure-library/closure/goog/crypt/hash_test.js
  72. +0 −163 closure-library/closure/goog/crypt/hmac.js
  73. +0 −113 closure-library/closure/goog/crypt/hmac_test.html
  74. +0 −428 closure-library/closure/goog/crypt/md5.js
  75. +0 −64 closure-library/closure/goog/crypt/md5_perf.html
  76. +0 −204 closure-library/closure/goog/crypt/md5_test.html
  77. +0 −232 closure-library/closure/goog/crypt/sha1.js
  78. +0 −62 closure-library/closure/goog/crypt/sha1_perf.html
  79. +0 −81 closure-library/closure/goog/crypt/sha1_test.html
  80. +0 −43 closure-library/closure/goog/css/autocomplete.css
  81. +0 −84 closure-library/closure/goog/css/bubble.css
  82. +0 −38 closure-library/closure/goog/css/button.css
  83. +0 −201 closure-library/closure/goog/css/charpicker.css
  84. +0 −38 closure-library/closure/goog/css/checkbox.css
  85. +0 −25 closure-library/closure/goog/css/colormenubutton.css
  86. +0 −54 closure-library/closure/goog/css/colorpalette.css
  87. +0 −50 closure-library/closure/goog/css/colorpicker-simplegrid.css
  88. +0 −54 closure-library/closure/goog/css/combobox.css
  89. +0 −41 closure-library/closure/goog/css/common.css
  90. +0 −77 closure-library/closure/goog/css/css3button.css
  91. +0 −23 closure-library/closure/goog/css/css3menubutton.css
  92. +0 −164 closure-library/closure/goog/css/custombutton.css
  93. +0 −148 closure-library/closure/goog/css/datepicker.css
  94. +0 −72 closure-library/closure/goog/css/dialog.css
  95. +0 −47 closure-library/closure/goog/css/dimensionpicker.css
  96. +0 −48 closure-library/closure/goog/css/dragdropdetector.css
  97. +0 −73 closure-library/closure/goog/css/editor/bubble.css
  98. +0 −66 closure-library/closure/goog/css/editor/dialog.css
  99. +0 −113 closure-library/closure/goog/css/editor/equationeditor.css
  100. +0 −36 closure-library/closure/goog/css/editor/linkdialog.css
  101. +0 −225 closure-library/closure/goog/css/editortoolbar.css
  102. +0 −30 closure-library/closure/goog/css/filteredmenu.css
  103. +0 −25 closure-library/closure/goog/css/filterobservingmenuitem.css
  104. +0 −65 closure-library/closure/goog/css/flatbutton.css
  105. +0 −63 closure-library/closure/goog/css/flatmenubutton.css
  106. +0 −51 closure-library/closure/goog/css/hovercard.css
  107. +0 −231 closure-library/closure/goog/css/hsvapalette.css
  108. +0 −179 closure-library/closure/goog/css/hsvpalette.css
  109. +0 −160 closure-library/closure/goog/css/imagelessbutton.css
  110. +0 −23 closure-library/closure/goog/css/imagelessmenubutton.css
  111. +0 −12 closure-library/closure/goog/css/inputdatepicker.css
  112. +0 −26 closure-library/closure/goog/css/linkbutton.css
  113. +0 −27 closure-library/closure/goog/css/menu.css
  114. +0 −169 closure-library/closure/goog/css/menubutton.css
  115. +0 −107 closure-library/closure/goog/css/menuitem.css
  116. +0 −19 closure-library/closure/goog/css/menuseparator.css
  117. +0 −121 closure-library/closure/goog/css/multitestrunner.css
  118. +0 −147 closure-library/closure/goog/css/offline.css
  119. +0 −36 closure-library/closure/goog/css/palette.css
  120. +0 −17 closure-library/closure/goog/css/popupdatepicker.css
  121. +0 −29 closure-library/closure/goog/css/roundedpanel.css
  122. +0 −158 closure-library/closure/goog/css/roundedtab.css
  123. +0 −28 closure-library/closure/goog/css/submenu.css
  124. +0 −105 closure-library/closure/goog/css/tab.css
  125. +0 −52 closure-library/closure/goog/css/tabbar.css
  126. +0 −14 closure-library/closure/goog/css/tablesorter.css
Sorry, we could not display the entire diff because too many files (1,682) changed.
View
0 all_tests.html → .svn/text-base/all_tests.html.svn-base
File renamed without changes.
View
0 alltests.js → .svn/text-base/alltests.js.svn-base
File renamed without changes.
View
0 collection_test.html → .svn/text-base/collection_test.html.svn-base
File renamed without changes.
View
0 collection_test.js → .svn/text-base/collection_test.js.svn-base
File renamed without changes.
View
0 control_test.html → .svn/text-base/control_test.html.svn-base
File renamed without changes.
View
0 control_test.js → .svn/text-base/control_test.js.svn-base
File renamed without changes.
View
0 mediator_test.html → .svn/text-base/mediator_test.html.svn-base
File renamed without changes.
View
0 mediator_test.js → .svn/text-base/mediator_test.js.svn-base
File renamed without changes.
View
0 model_test.html → .svn/text-base/model_test.html.svn-base
File renamed without changes.
View
0 model_test.js → .svn/text-base/model_test.js.svn-base
File renamed without changes.
View
0 router_test.html → .svn/text-base/router_test.html.svn-base
File renamed without changes.
View
0 router_test.js → .svn/text-base/router_test.js.svn-base
File renamed without changes.
View
0 store_test.html → .svn/text-base/store_test.html.svn-base
File renamed without changes.
View
0 store_test.js → .svn/text-base/store_test.js.svn-base
File renamed without changes.
View
0 test_deps.js → .svn/text-base/test_deps.js.svn-base
File renamed without changes.
View
BIN closure-library/.DS_Store
Binary file not shown.
View
17 closure-library/.svn/all-wcprops
@@ -1,17 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 51
-/svn/!svn/ver/16018/webclient/trunk/closure-library
-END
-closure-library.tar.gz
-K 25
-svn:wc:ra_dav:version-url
-V 74
-/svn/!svn/ver/16018/webclient/trunk/closure-library/closure-library.tar.gz
-END
-update.sh
-K 25
-svn:wc:ra_dav:version-url
-V 61
-/svn/!svn/ver/15323/webclient/trunk/closure-library/update.sh
-END
View
99 closure-library/.svn/entries
@@ -1,99 +0,0 @@
-10
-
-dir
-17294
-https://svn.catch.com/svn/webclient/trunk/closure-library
-https://svn.catch.com/svn
-
-
-
-2011-12-20T00:14:20.896502Z
-16018
-rhys
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-47c71b91-0550-41b2-9d14-58eae63b76b1
-
-closure-library.tar.gz
-file
-
-
-
-
-2011-12-19T19:41:43.000000Z
-770a9238b27126a223f1218eb7fe9668
-2011-12-20T00:14:20.896502Z
-16018
-rhys
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3177248
-
-update.sh
-file
-
-
-
-
-2011-11-29T01:49:33.000000Z
-599e1e2bd53208cc55b3cf2e5be1365b
-2011-11-29T01:25:16.167428Z
-15323
-kientzle
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-214
-
-closure
-dir
-
View
5 closure-library/.svn/prop-base/closure-library.tar.gz.svn-base
@@ -1,5 +0,0 @@
-K 13
-svn:mime-type
-V 24
-application/octet-stream
-END
View
BIN closure-library/.svn/text-base/closure-library.tar.gz.svn-base
Binary file not shown.
View
11 closure-library/.svn/text-base/update.sh.svn-base
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-rm -rf closure-library.tar.gz
-rm -rf closure-library
-
-svn export http://closure-library.googlecode.com/svn/trunk/ closure-library
-
-tar czf closure-library.tar.gz closure-library
-rm -rf closure-library
-
-
View
14 closure-library/AUTHORS
@@ -1,14 +0,0 @@
-# This is a list of contributors to the Closure Library.
-
-# Names should be added to this file like so:
-# Name or Organization <email address>
-
-Google Inc.
-Mohamed Mansour <hello@mohamedmansour.com>
-Bjorn Tipling <bjorn.tipling@gmail.com>
-SameGoal LLC <help@samegoal.com>
-Guido Tapia <guido.tapia@gmail.com>
-Andrew Mattie <amattie@gmail.com>
-Ilia Mirkin <ibmirkin@gmail.com>
-Ivan Kozik <ivan.kozik@gmail.com>
-Rich Dougherty <rich@rd.gen.nz>
View
176 closure-library/LICENSE
@@ -1,176 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
View
6 closure-library/README
@@ -1,6 +0,0 @@
-Closure Library is a powerful, low level JavaScript library designed
-for building complex and scalable web applications. It is used by many
-major Google web applications, such as Gmail and Google Docs.
-
-For more information about Closure Library, visit:
-http://code.google.com/closure/library
View
0 closure-library/all_tests.html
Sorry, we could not display the changes to this file because there were too many other changes to display.
View
16 closure-library/alltests.js
@@ -1,16 +0,0 @@
-// Copyright 2009 The Closure Library Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS-IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-var _allTests = [
-"closure/goog/array/array_test.html","closure/goog/asserts/asserts_test.html","closure/goog/async/conditionaldelay_test.html","closure/goog/async/delay_test.html","closure/goog/async/throttle_test.html","closure/goog/base_test.html","closure/goog/color/alpha_test.html","closure/goog/color/color_test.html","closure/goog/crypt/arc4_test.html","closure/goog/crypt/base64_test.html","closure/goog/crypt/basen_test.html","closure/goog/crypt/blobhasher_test.html","closure/goog/crypt/crypt_test.html","closure/goog/crypt/hash32_test.html","closure/goog/crypt/hmac_test.html","closure/goog/crypt/md5_test.html","closure/goog/crypt/sha1_test.html","closure/goog/cssom/cssom_test.html","closure/goog/cssom/iframe/style_test.html","closure/goog/datasource/datasource_test.html","closure/goog/datasource/expr_test.html","closure/goog/datasource/fastdatanode_test.html","closure/goog/datasource/jsxmlhttpdatasource_test.html","closure/goog/date/daterange_test.html","closure/goog/date/date_test.html","closure/goog/date/relative_test.html","closure/goog/date/utcdatetime_test.html","closure/goog/db/db_test.html","closure/goog/debug/console_test.html","closure/goog/debug/debug_test.html","closure/goog/debug/devcss/devcss_test.html","closure/goog/debug/enhanceerror_test.html","closure/goog/debug/entrypointregistry_test.html","closure/goog/debug/errorhandler_async_test.html","closure/goog/debug/errorhandler_test.html","closure/goog/debug/errorreporter_test.html","closure/goog/debug/error_test.html","closure/goog/debug/fpsdisplay_test.html","closure/goog/debug/logbuffer_test.html","closure/goog/debug/logger_test.html","closure/goog/debug/logrecordserializer_test.html","closure/goog/debug/reflect_test.html","closure/goog/debug/tracer_test.html","closure/goog/disposable/disposable_test.html","closure/goog/dom/a11y_test.html","closure/goog/dom/abstractrange_test.html","closure/goog/dom/annotate_test.html","closure/goog/dom/browserrange/browserrange_test.html","closure/goog/dom/classes_test.html","closure/goog/dom/controlrange_test.html","closure/goog/dom/dataset_test.html","closure/goog/dom/dom_quirks_test.html","closure/goog/dom/dom_test.html","closure/goog/dom/fontsizemonitor_test.html","closure/goog/dom/forms_test.html","closure/goog/dom/iframe_test.html","closure/goog/dom/iter_test.html","closure/goog/dom/multirange_test.html","closure/goog/dom/nodeiterator_test.html","closure/goog/dom/nodeoffset_test.html","closure/goog/dom/pattern/matcher_test.html","closure/goog/dom/pattern/pattern_test.html","closure/goog/dom/range_test.html","closure/goog/dom/savedcaretrange_test.html","closure/goog/dom/savedrange_test.html","closure/goog/dom/selection_test.html","closure/goog/dom/tagiterator_test.html","closure/goog/dom/tagname_test.html","closure/goog/dom/textrangeiterator_test.html","closure/goog/dom/textrange_test.html","closure/goog/dom/viewportsizemonitor_test.html","closure/goog/dom/xml_test.html","closure/goog/editor/clicktoeditwrapper_test.html","closure/goog/editor/field_test.html","closure/goog/editor/focus_test.html","closure/goog/editor/icontent_test.html","closure/goog/editor/link_test.html","closure/goog/editor/node_test.html","closure/goog/editor/plugins/abstractbubbleplugin_test.html","closure/goog/editor/plugins/abstractdialogplugin_test.html","closure/goog/editor/plugins/abstracttabhandler_test.html","closure/goog/editor/plugins/basictextformatter_test.html","closure/goog/editor/plugins/blockquote_test.html","closure/goog/editor/plugins/emoticons_test.html","closure/goog/editor/plugins/enterhandler_test.html","closure/goog/editor/plugins/equationeditorplugin_test.html","closure/goog/editor/plugins/headerformatter_test.html","closure/goog/editor/plugins/linkbubble_test.html","closure/goog/editor/plugins/linkdialogplugin_test.html","closure/goog/editor/plugins/linkshortcutplugin_test.html","closure/goog/editor/plugins/listtabhandler_test.html","closure/goog/editor/plugins/loremipsum_test.html","closure/goog/editor/plugins/removeformatting_test.html","closure/goog/editor/plugins/spacestabhandler_test.html","closure/goog/editor/plugins/tableeditor_test.html","closure/goog/editor/plugins/tagonenterhandler_test.html","closure/goog/editor/plugins/undoredomanager_test.html","closure/goog/editor/plugins/undoredostate_test.html","closure/goog/editor/plugins/undoredo_test.html","closure/goog/editor/plugin_test.html","closure/goog/editor/range_test.html","closure/goog/editor/seamlessfield_quirks_test.html","closure/goog/editor/seamlessfield_test.html","closure/goog/editor/style_test.html","closure/goog/editor/table_test.html","closure/goog/events/actioneventwrapper_test.html","closure/goog/events/actionhandler_test.html","closure/goog/events/browserevent_test.html","closure/goog/events/eventhandler_test.html","closure/goog/events/events_test.html","closure/goog/events/eventtarget_test.html","closure/goog/events/event_test.html","closure/goog/events/filedrophandler_test.html","closure/goog/events/imehandler_test.html","closure/goog/events/keycodes_test.html","closure/goog/events/keyhandler_test.html","closure/goog/events/mousewheelhandler_test.html","closure/goog/events/onlinelistener_test.html","closure/goog/events/pastehandler_test.html","closure/goog/format/emailaddress_test.html","closure/goog/format/format_test.html","closure/goog/format/htmlprettyprinter_test.html","closure/goog/format/jsonprettyprinter_test.html","closure/goog/fs/fs_test.html","closure/goog/functions/functions_test.html","closure/goog/fx/abstractdragdrop_test.html","closure/goog/fx/anim/anim_test.html","closure/goog/fx/animationqueue_test.html","closure/goog/fx/animation_test.html","closure/goog/fx/css3/transition_test.html","closure/goog/fx/cssspriteanimation_test.html","closure/goog/fx/dragdropgroup_test.html","closure/goog/fx/dragger_test.html","closure/goog/fx/draglistgroup_test.html","closure/goog/fx/dragscrollsupport_test.html","closure/goog/fx/fx_test.html","closure/goog/gears/basestore_test.html","closure/goog/gears/database_test.html","closure/goog/gears/fakeworkerpool_test.html","closure/goog/gears/gears_test.html","closure/goog/gears/loggerclient_test.html","closure/goog/gears/loggerserver_test.html","closure/goog/gears/logstore_test.html","closure/goog/gears/managedresourcestore_test.html","closure/goog/gears/multipartformdata_test.html","closure/goog/gears/urlcapture_test.html","closure/goog/gears/workerchannel_test.html","closure/goog/gears/workerpool_test.html","closure/goog/graphics/affinetransform_test.html","closure/goog/graphics/ext/coordinates_test.html","closure/goog/graphics/ext/element_test.html","closure/goog/graphics/ext/path_test.html","closure/goog/graphics/paths_test.html","closure/goog/graphics/path_test.html","closure/goog/history/html5history_test.html","closure/goog/i18n/bidiformatter_test.html","closure/goog/i18n/bidi_test.html","closure/goog/i18n/charlistdecompressor_test.html","closure/goog/i18n/currency_test.html","closure/goog/i18n/datetimeformat_test.html","closure/goog/i18n/datetimeparse_test.html","closure/goog/i18n/graphemebreak_test.html","closure/goog/i18n/messageformat_test.html","closure/goog/i18n/mime_test.html","closure/goog/i18n/numberformat_test.html","closure/goog/i18n/timezone_test.html","closure/goog/i18n/uchar_test.html","closure/goog/iter/iter_test.html","closure/goog/jsaction/dispatcher_test.html","closure/goog/jsaction/eventcontract_test.html","closure/goog/jsaction/jsprops_test.html","closure/goog/json/json_test.html","closure/goog/labs/net/xhr_test.html","closure/goog/locale/countrylanguagenames_test.html","closure/goog/locale/genericfontnames_test.html","closure/goog/locale/timezonedetection_test.html","closure/goog/locale/timezonelist_test.html","closure/goog/math/bezier_test.html","closure/goog/math/box_test.html","closure/goog/math/coordinate3_test.html","closure/goog/math/coordinate_test.html","closure/goog/math/exponentialbackoff_test.html","closure/goog/math/integer_test.html","closure/goog/math/line_test.html","closure/goog/math/long_test.html","closure/goog/math/math_test.html","closure/goog/math/matrix_test.html","closure/goog/math/rangeset_test.html","closure/goog/math/range_test.html","closure/goog/math/rect_test.html","closure/goog/math/size_test.html","closure/goog/math/vec2_test.html","closure/goog/math/vec3_test.html","closure/goog/memoize/memoize_test.html","closure/goog/messaging/abstractchannel_test.html","closure/goog/messaging/bufferedchannel_test.html","closure/goog/messaging/deferredchannel_test.html","closure/goog/messaging/loggerclient_test.html","closure/goog/messaging/loggerserver_test.html","closure/goog/messaging/messaging_test.html","closure/goog/messaging/multichannel_test.html","closure/goog/messaging/portcaller_test.html","closure/goog/messaging/portchannel_test.html","closure/goog/messaging/portnetwork_test.html","closure/goog/messaging/portoperator_test.html","closure/goog/module/moduleinfo_test.html","closure/goog/module/moduleloadcallback_test.html","closure/goog/module/moduleloader_test.html","closure/goog/module/modulemanager_test.html","closure/goog/net/browserchannel_test.html","closure/goog/net/bulkloader_test.html","closure/goog/net/channelrequest_test.html","closure/goog/net/cookies_test.html","closure/goog/net/crossdomainrpc_test.html","closure/goog/net/filedownloader_test.html","closure/goog/net/iframeio_different_base_test.html","closure/goog/net/iframeio_test.html","closure/goog/net/iframeloadmonitor_test.html","closure/goog/net/iframe_xhr_test.html","closure/goog/net/imageloader_test.html","closure/goog/net/ipaddress_test.html","closure/goog/net/jsloader_test.html","closure/goog/net/jsonp_test.html","closure/goog/net/mockxhrlite_test.html","closure/goog/net/multiiframeloadmonitor_test.html","closure/goog/net/networktester_test.html","closure/goog/net/websocket_test.html","closure/goog/net/xhrio_test.html","closure/goog/net/xhrlite_test.html","closure/goog/net/xpc/crosspagechannel_test.html","closure/goog/net/xpc/nativemessagingtransport_test.html","closure/goog/object/object_test.html","closure/goog/positioning/anchoredviewportposition_test.html","closure/goog/positioning/menuanchoredposition_test.html","closure/goog/positioning/positioning_test.html","closure/goog/positioning/viewportclientposition_test.html","closure/goog/proto2/descriptor_test.html","closure/goog/proto2/fielddescriptor_test.html","closure/goog/proto2/message_test.html","closure/goog/proto2/objectserializer_test.html","closure/goog/proto2/pbliteserializer_test.html","closure/goog/proto2/proto_test.html","closure/goog/proto2/textformatserializer_test.html","closure/goog/proto/serializer_test.html","closure/goog/pubsub/pubsub_test.html","closure/goog/soy/renderer_test.html","closure/goog/soy/soy_test.html","closure/goog/spell/spellcheck_test.html","closure/goog/stats/basicstat_test.html","closure/goog/storage/collectablestorage_test.html","closure/goog/storage/encryptedstorage_test.html","closure/goog/storage/expiringstorage_test.html","closure/goog/storage/mechanism/html5localstorage_test.html","closure/goog/storage/mechanism/ieuserdata_test.html","closure/goog/storage/mechanism/mechanismfactory_test.html","closure/goog/storage/mechanism/prefixedmechanism_test.html","closure/goog/storage/richstorage_test.html","closure/goog/storage/storage_test.html","closure/goog/string/linkify_test.html","closure/goog/string/path_test.html","closure/goog/string/stringbuffer_test.html","closure/goog/string/stringformat_test.html","closure/goog/string/string_test.html","closure/goog/structs/avltree_test.html","closure/goog/structs/circularbuffer_test.html","closure/goog/structs/collection_test.html","closure/goog/structs/heap_test.html","closure/goog/structs/inversionmap_test.html","closure/goog/structs/linkedmap_test.html","closure/goog/structs/map_test.html","closure/goog/structs/pool_test.html","closure/goog/structs/prioritypool_test.html","closure/goog/structs/priorityqueue_test.html","closure/goog/structs/quadtree_test.html","closure/goog/structs/queue_test.html","closure/goog/structs/set_test.html","closure/goog/structs/stringset_test.html","closure/goog/structs/structs_test.html","closure/goog/structs/treenode_test.html","closure/goog/structs/trie_test.html","closure/goog/style/cursor_test.html","closure/goog/style/style_quirks_test.html","closure/goog/style/style_test.html","closure/goog/style/style_webkit_scrollbars_test.html","closure/goog/style/transition_test.html","closure/goog/testing/asserts_test.html","closure/goog/testing/async/mockcontrol_test.html","closure/goog/testing/asynctestcase_async_test.html","closure/goog/testing/asynctestcase_noasync_test.html","closure/goog/testing/asynctestcase_test.html","closure/goog/testing/benchmarks/jsbinarysizebutton_test.html","closure/goog/testing/benchmarks/jsbinarysizetoolbar_test.html","closure/goog/testing/continuationtestcase_test.html","closure/goog/testing/deferredtestcase_test.html","closure/goog/testing/dom_test.html","closure/goog/testing/editor/dom_test.html","closure/goog/testing/editor/testhelper_test.html","closure/goog/testing/events/eventobserver_test.html","closure/goog/testing/events/events_test.html","closure/goog/testing/events/matchers_test.html","closure/goog/testing/expectedfailures_test.html","closure/goog/testing/fs/blob_test.html","closure/goog/testing/fs/directoryentry_test.html","closure/goog/testing/fs/entry_test.html","closure/goog/testing/fs/fileentry_test.html","closure/goog/testing/fs/filereader_test.html","closure/goog/testing/fs/filewriter_test.html","closure/goog/testing/fs/fs_test.html","closure/goog/testing/fs/integration_test.html","closure/goog/testing/functionmock_test.html","closure/goog/testing/loosemock_test.html","closure/goog/testing/mockclassfactory_test.html","closure/goog/testing/mockclock_test.html","closure/goog/testing/mockcontrol_test.html","closure/goog/testing/mockmatchers_test.html","closure/goog/testing/mockrandom_test.html","closure/goog/testing/mockrange_test.html","closure/goog/testing/mockstorage_test.html","closure/goog/testing/mock_test.html","closure/goog/testing/mockuseragent_test.html","closure/goog/testing/net/xhrio_test.html","closure/goog/testing/performancetimer_test.html","closure/goog/testing/propertyreplacer_test.html","closure/goog/testing/pseudorandom_test.html","closure/goog/testing/recordfunction_test.html","closure/goog/testing/shardingtestcase_test.html","closure/goog/testing/singleton_test.html","closure/goog/testing/stacktrace_test.html","closure/goog/testing/strictmock_test.html","closure/goog/testing/style/layoutasserts_test.html","closure/goog/testing/style/style_test.html","closure/goog/testing/ui/rendererasserts_test.html","closure/goog/testing/ui/style_test.html","closure/goog/timer/timer_test.html","closure/goog/tweak/entries_test.html","closure/goog/tweak/registry_test.html","closure/goog/tweak/tweakui_test.html","closure/goog/ui/activitymonitor_test.html","closure/goog/ui/advancedtooltip_test.html","closure/goog/ui/animatedzippy_test.html","closure/goog/ui/autocomplete/arraymatcher_test.html","closure/goog/ui/autocomplete/autocomplete_test.html","closure/goog/ui/autocomplete/basic_test.html","closure/goog/ui/autocomplete/inputhandler_test.html","closure/goog/ui/autocomplete/remotearraymatcher_test.html","closure/goog/ui/autocomplete/renderer_test.html","closure/goog/ui/buttonrenderer_test.html","closure/goog/ui/button_test.html","closure/goog/ui/checkbox_test.html","closure/goog/ui/colorbutton_test.html","closure/goog/ui/colormenubuttonrenderer_test.html","closure/goog/ui/colorpalette_test.html","closure/goog/ui/combobox_test.html","closure/goog/ui/component_test.html","closure/goog/ui/containerrenderer_test.html","closure/goog/ui/containerscroller_test.html","closure/goog/ui/container_test.html","closure/goog/ui/controlrenderer_test.html","closure/goog/ui/control_test.html","closure/goog/ui/cookieeditor_test.html","closure/goog/ui/customcolorpalette_test.html","closure/goog/ui/datepicker_test.html","closure/goog/ui/decorate_test.html","closure/goog/ui/dialog_test.html","closure/goog/ui/dimensionpicker_test.html","closure/goog/ui/drilldownrow_test.html","closure/goog/ui/editor/abstractdialog_test.html","closure/goog/ui/editor/bubble_test.html","closure/goog/ui/editor/linkdialog_test.html","closure/goog/ui/editor/toolbarfactory_test.html","closure/goog/ui/emoji/emojipicker_test.html","closure/goog/ui/emoji/popupemojipicker_test.html","closure/goog/ui/emoji/spriteinfo_test.html","closure/goog/ui/filteredmenu_test.html","closure/goog/ui/formpost_test.html","closure/goog/ui/hovercard_test.html","closure/goog/ui/hsvapalette_test.html","closure/goog/ui/hsvpalette_test.html","closure/goog/ui/idletimer_test.html","closure/goog/ui/iframemask_test.html","closure/goog/ui/inputdatepicker_test.html","closure/goog/ui/keyboardshortcuthandler_test.html","closure/goog/ui/labelinput_test.html","closure/goog/ui/media/flashobject_test.html","closure/goog/ui/media/flickr_test.html","closure/goog/ui/media/googlevideo_test.html","closure/goog/ui/media/mediamodel_test.html","closure/goog/ui/media/media_test.html","closure/goog/ui/media/mp3_test.html","closure/goog/ui/media/photo_test.html","closure/goog/ui/media/picasa_test.html","closure/goog/ui/media/vimeo_test.html","closure/goog/ui/media/youtube_test.html","closure/goog/ui/menubuttonrenderer_test.html","closure/goog/ui/menubutton_test.html","closure/goog/ui/menuitemrenderer_test.html","closure/goog/ui/menuitem_test.html","closure/goog/ui/menuseparatorrenderer_test.html","closure/goog/ui/menu_test.html","closure/goog/ui/modalpopup_test.html","closure/goog/ui/nativebuttonrenderer_test.html","closure/goog/ui/plaintextspellchecker_test.html","closure/goog/ui/popupbase_test.html","closure/goog/ui/popupcolorpicker_test.html","closure/goog/ui/popupmenu_test.html","closure/goog/ui/popup_test.html","closure/goog/ui/prompt_test.html","closure/goog/ui/rangemodel_test.html","closure/goog/ui/registry_test.html","closure/goog/ui/richtextspellchecker_test.html","closure/goog/ui/roundedpanel_test.html","closure/goog/ui/scrollfloater_test.html","closure/goog/ui/selectionmenubutton_test.html","closure/goog/ui/selectionmodel_test.html","closure/goog/ui/select_test.html","closure/goog/ui/serverchart_test.html","closure/goog/ui/sliderbase_test.html","closure/goog/ui/splitbehavior_test.html","closure/goog/ui/splitpane_test.html","closure/goog/ui/style/app/buttonrenderer_test.html","closure/goog/ui/style/app/menubuttonrenderer_test.html","closure/goog/ui/style/app/primaryactionbuttonrenderer_test.html","closure/goog/ui/submenu_test.html","closure/goog/ui/tabbarrenderer_test.html","closure/goog/ui/tabbar_test.html","closure/goog/ui/tablesorter_test.html","closure/goog/ui/tabpane_test.html","closure/goog/ui/tabrenderer_test.html","closure/goog/ui/tab_test.html","closure/goog/ui/textarea_test.html","closure/goog/ui/toolbarcolormenubuttonrenderer_test.html","closure/goog/ui/tree/basenode_test.html","closure/goog/ui/tree/treecontrol_test.html","closure/goog/ui/tree/typeahead_test.html","closure/goog/ui/zippy_test.html","closure/goog/uri/uri_test.html","closure/goog/uri/utils_test.html","closure/goog/useragent/adobereader_test.html","closure/goog/useragent/flash_test.html","closure/goog/useragent/jscript_test.html","closure/goog/useragent/platform_test.html","closure/goog/useragent/product_test.html","closure/goog/useragent/useragent_test.html","closure/goog/vec/float32array_test.html","closure/goog/vec/mat3_test.html","closure/goog/vec/mat4_test.html","closure/goog/vec/matrix3_test.html","closure/goog/vec/matrix4_test.html","closure/goog/vec/quaternion_test.html","closure/goog/vec/ray_test.html","closure/goog/vec/vec3_test.html","closure/goog/vec/vec4_test.html","closure/goog/window/window_test.html","third_party/closure/goog/dojo/dom/query_test.html","third_party/closure/goog/loremipsum/text/loremipsum_test.html","third_party/closure/goog/mochikit/async/deferredlist_test.html","third_party/closure/goog/mochikit/async/deferred_test.html"];
View
256 closure-library/closure/bin/build/closurebuilder.py
@@ -1,256 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009 The Closure Library Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS-IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Utility for Closure Library dependency calculation.
-
-ClosureBuilder scans source files to build dependency info. From the
-dependencies, the script can produce a deps.js file, a manifest in dependency
-order, a concatenated script, or compiled output from the Closure Compiler.
-
-Paths to files can be expressed as individual arguments to the tool (intended
-for use with find and xargs). As a convenience, --root can be used to specify
-all JS files below a directory.
-
-usage: %prog [options] [file1.js file2.js ...]
-"""
-
-
-
-
-import logging
-import optparse
-import os
-import sys
-
-import depstree
-import jscompiler
-import source
-import treescan
-
-
-def _GetOptionsParser():
- """Get the options parser."""
-
- parser = optparse.OptionParser(__doc__)
- parser.add_option('-i',
- '--input',
- dest='inputs',
- action='append',
- default=[],
- help='One or more input files to calculate dependencies '
- 'for. The namespaces in this file will be combined with '
- 'those given with the -n flag to form the set of '
- 'namespaces to find dependencies for.')
- parser.add_option('-n',
- '--namespace',
- dest='namespaces',
- action='append',
- default=[],
- help='One or more namespaces to calculate dependencies '
- 'for. These namespaces will be combined with those given '
- 'with the -i flag to form the set of namespaces to find '
- 'dependencies for. A Closure namespace is a '
- 'dot-delimited path expression declared with a call to '
- 'goog.provide() (e.g. "goog.array" or "foo.bar").')
- parser.add_option('--root',
- dest='roots',
- action='append',
- default=[],
- help='The paths that should be traversed to build the '
- 'dependencies.')
- parser.add_option('-o',
- '--output_mode',
- dest='output_mode',
- type='choice',
- action='store',
- choices=['list', 'script', 'compiled'],
- default='list',
- help='The type of output to generate from this script. '
- 'Options are "list" for a list of filenames, "script" '
- 'for a single script containing the contents of all the '
- 'files, or "compiled" to produce compiled output with '
- 'the Closure Compiler. Default is "list".')
- parser.add_option('-c',
- '--compiler_jar',
- dest='compiler_jar',
- action='store',
- help='The location of the Closure compiler .jar file.')
- parser.add_option('-f',
- '--compiler_flags',
- dest='compiler_flags',
- default=[],
- action='append',
- help='Additional flags to pass to the Closure compiler. '
- 'To pass multiple flags, --compiler_flags has to be '
- 'specified multiple times.')
- parser.add_option('--output_file',
- dest='output_file',
- action='store',
- help=('If specified, write output to this path instead of '
- 'writing to standard output.'))
-
- return parser
-
-
-def _GetInputByPath(path, sources):
- """Get the source identified by a path.
-
- Args:
- path: str, A path to a file that identifies a source.
- sources: An iterable collection of source objects.
-
- Returns:
- The source from sources identified by path, if found. Converts to
- absolute paths for comparison.
- """
- for js_source in sources:
- # Convert both to absolute paths for comparison.
- if os.path.abspath(path) == os.path.abspath(js_source.GetPath()):
- return js_source
-
-
-def _GetClosureBaseFile(sources):
- """Given a set of sources, returns the one base.js file.
-
- Note that if zero or two or more base.js files are found, an error message
- will be written and the program will be exited.
-
- Args:
- sources: An iterable of _PathSource objects.
-
- Returns:
- The _PathSource representing the base Closure file.
- """
- base_files = [
- js_source for js_source in sources if _IsClosureBaseFile(js_source)]
-
- if not base_files:
- logging.error('No Closure base.js file found.')
- sys.exit(1)
- if len(base_files) > 1:
- logging.error('More than one Closure base.js files found at these paths:')
- for base_file in base_files:
- logging.error(base_file.GetPath())
- sys.exit(1)
- return base_files[0]
-
-
-def _IsClosureBaseFile(js_source):
- """Returns true if the given _PathSource is the Closure base.js source."""
- return (os.path.basename(js_source.GetPath()) == 'base.js' and
- js_source.provides == set(['goog']))
-
-
-class _PathSource(source.Source):
- """Source file subclass that remembers its file path."""
-
- def __init__(self, path):
- """Initialize a source.
-
- Args:
- path: str, Path to a JavaScript file. The source string will be read
- from this file.
- """
- super(_PathSource, self).__init__(source.GetFileContents(path))
-
- self._path = path
-
- def GetPath(self):
- """Returns the path."""
- return self._path
-
-
-def main():
- logging.basicConfig(format=(sys.argv[0] + ': %(message)s'),
- level=logging.INFO)
- options, args = _GetOptionsParser().parse_args()
-
- # Make our output pipe.
- if options.output_file:
- out = open(options.output_file, 'w')
- else:
- out = sys.stdout
-
- sources = set()
-
- logging.info('Scanning paths...')
- for path in options.roots:
- for js_path in treescan.ScanTreeForJsFiles(path):
- sources.add(_PathSource(js_path))
-
- # Add scripts specified on the command line.
- for js_path in args:
- sources.add(_PathSource(js_path))
-
- logging.info('%s sources scanned.', len(sources))
-
- # Though deps output doesn't need to query the tree, we still build it
- # to validate dependencies.
- logging.info('Building dependency tree..')
- tree = depstree.DepsTree(sources)
-
- input_namespaces = set()
- inputs = options.inputs or []
- for input_path in inputs:
- js_input = _GetInputByPath(input_path, sources)
- if not js_input:
- logging.error('No source matched input %s', input_path)
- sys.exit(1)
- input_namespaces.update(js_input.provides)
-
- input_namespaces.update(options.namespaces)
-
- if not input_namespaces:
- logging.error('No namespaces found. At least one namespace must be '
- 'specified with the --namespace or --input flags.')
- sys.exit(2)
-
- # The Closure Library base file must go first.
- base = _GetClosureBaseFile(sources)
- deps = [base] + tree.GetDependencies(input_namespaces)
-
- output_mode = options.output_mode
- if output_mode == 'list':
- out.writelines([js_source.GetPath() + '\n' for js_source in deps])
- elif output_mode == 'script':
- out.writelines([js_source.GetSource() for js_source in deps])
- elif output_mode == 'compiled':
-
- # Make sure a .jar is specified.
- if not options.compiler_jar:
- logging.error('--compiler_jar flag must be specified if --output is '
- '"compiled"')
- sys.exit(2)
-
- compiled_source = jscompiler.Compile(
- options.compiler_jar,
- [js_source.GetPath() for js_source in deps],
- options.compiler_flags)
-
- if compiled_source is None:
- logging.error('JavaScript compilation failed.')
- sys.exit(1)
- else:
- logging.info('JavaScript compilation succeeded.')
- out.write(compiled_source)
-
- else:
- logging.error('Invalid value for --output flag.')
- sys.exit(2)
-
-
-if __name__ == '__main__':
- main()
View
186 closure-library/closure/bin/build/depstree.py
@@ -1,186 +0,0 @@
-# Copyright 2009 The Closure Library Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS-IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-"""Class to represent a full Closure Library dependency tree.
-
-Offers a queryable tree of dependencies of a given set of sources. The tree
-will also do logical validation to prevent duplicate provides and circular
-dependencies.
-"""
-
-
-
-
-class DepsTree(object):
- """Represents the set of dependencies between source files."""
-
- def __init__(self, sources):
- """Initializes the tree with a set of sources.
-
- Args:
- sources: A set of JavaScript sources.
-
- Raises:
- MultipleProvideError: A namespace is provided by muplitple sources.
- NamespaceNotFoundError: A namespace is required but never provided.
- """
-
- self._sources = sources
- self._provides_map = dict()
-
- # Ensure nothing was provided twice.
- for source in sources:
- for provide in source.provides:
- if provide in self._provides_map:
- raise MultipleProvideError(
- provide, [self._provides_map[provide], source])
-
- self._provides_map[provide] = source
-
- # Check that all required namespaces are provided.
- for source in sources:
- for require in source.requires:
- if require not in self._provides_map:
- raise NamespaceNotFoundError(require, source)
-
- def GetDependencies(self, required_namespaces):
- """Get source dependencies, in order, for the given namespaces.
-
- Args:
- required_namespaces: A string (for one) or list (for one or more) of
- namespaces.
-
- Returns:
- A list of source objects that provide those namespaces and all
- requirements, in dependency order.
-
- Raises:
- NamespaceNotFoundError: A namespace is requested but doesn't exist.
- CircularDependencyError: A cycle is detected in the dependency tree.
- """
- if type(required_namespaces) is str:
- required_namespaces = [required_namespaces]
-
- deps_sources = []
-
- for namespace in required_namespaces:
- for source in DepsTree._ResolveDependencies(
- namespace, [], self._provides_map, []):
- if source not in deps_sources:
- deps_sources.append(source)
-
- return deps_sources
-
- @staticmethod
- def _ResolveDependencies(required_namespace, deps_list, provides_map,
- traversal_path):
- """Resolve dependencies for Closure source files.
-
- Follows the dependency tree down and builds a list of sources in dependency
- order. This function will recursively call itself to fill all dependencies
- below the requested namespaces, and then append its sources at the end of
- the list.
-
- Args:
- required_namespace: String of required namespace.
- deps_list: List of sources in dependency order. This function will append
- the required source once all of its dependencies are satisfied.
- provides_map: Map from namespace to source that provides it.
- traversal_path: List of namespaces of our path from the root down the
- dependency/recursion tree. Used to identify cyclical dependencies.
- This is a list used as a stack -- when the function is entered, the
- current namespace is pushed and popped right before returning.
- Each recursive call will check that the current namespace does not
- appear in the list, throwing a CircularDependencyError if it does.
-
- Returns:
- The given deps_list object filled with sources in dependency order.
-
- Raises:
- NamespaceNotFoundError: A namespace is requested but doesn't exist.
- CircularDependencyError: A cycle is detected in the dependency tree.
- """
-
- source = provides_map.get(required_namespace)
- if not source:
- raise NamespaceNotFoundError(required_namespace)
-
- if required_namespace in traversal_path:
- traversal_path.append(required_namespace) # do this *after* the test
-
- # This must be a cycle.
- raise CircularDependencyError(traversal_path)
-
- traversal_path.append(required_namespace)
-
- for require in source.requires:
-
- # Append all other dependencies before we append our own.
- DepsTree._ResolveDependencies(require, deps_list, provides_map,
- traversal_path)
- deps_list.append(source)
-
- traversal_path.pop()
-
- return deps_list
-
-
-class BaseDepsTreeError(Exception):
- """Base DepsTree error."""
-
- def __init__(self):
- Exception.__init__(self)
-
-
-class CircularDependencyError(BaseDepsTreeError):
- """Raised when a dependency cycle is encountered."""
-
- def __init__(self, dependency_list):
- BaseDepsTreeError.__init__(self)
- self._dependency_list = dependency_list
-
- def __str__(self):
- return ('Encountered circular dependency:\n%s\n' %
- '\n'.join(self._dependency_list))
-
-
-class MultipleProvideError(BaseDepsTreeError):
- """Raised when a namespace is provided more than once."""
-
- def __init__(self, namespace, sources):
- BaseDepsTreeError.__init__(self)
- self._namespace = namespace
- self._sources = sources
-
- def __str__(self):
- source_strs = map(str, self._sources)
-
- return ('Namespace "%s" provided more than once in sources:\n%s\n' %
- (self._namespace, '\n'.join(source_strs)))
-
-
-class NamespaceNotFoundError(BaseDepsTreeError):
- """Raised when a namespace is requested but not provided."""
-
- def __init__(self, namespace, source=None):
- BaseDepsTreeError.__init__(self)
- self._namespace = namespace
- self._source = source
-
- def __str__(self):
- msg = 'Namespace "%s" never provided.' % self._namespace
- if self._source:
- msg += ' Required in %s' % self._source
- return msg
View
127 closure-library/closure/bin/build/depstree_test.py
@@ -1,127 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009 The Closure Library Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS-IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-"""Unit test for depstree."""
-
-
-
-
-import unittest
-
-import depstree
-
-
-def _GetProvides(sources):
- """Get all namespaces provided by a collection of sources."""
-
- provides = set()
- for source in sources:
- provides.update(source.provides)
- return provides
-
-
-class MockSource(object):
- """Mock Source file."""
-
- def __init__(self, provides, requires):
- self.provides = set(provides)
- self.requires = set(requires)
-
- def __repr__(self):
- return 'MockSource %s' % self.provides
-
-
-class DepsTreeTestCase(unittest.TestCase):
- """Unit test for DepsTree. Tests several common situations and errors."""
-
- def AssertValidDependencies(self, deps_list):
- """Validates a dependency list.
-
- Asserts that a dependency list is valid: For every source in the list,
- ensure that every require is provided by a source earlier in the list.
-
- Args:
- deps_list: A list of sources that should be in dependency order.
- """
-
- for i in range(len(deps_list)):
- source = deps_list[i]
- previous_provides = _GetProvides(deps_list[:i])
- for require in source.requires:
- self.assertTrue(
- require in previous_provides,
- 'Namespace "%s" not provided before required by %s' % (
- require, source))
-
- def testSimpleDepsTree(self):
- a = MockSource(['A'], ['B', 'C'])
- b = MockSource(['B'], [])
- c = MockSource(['C'], ['D'])
- d = MockSource(['D'], ['E'])
- e = MockSource(['E'], [])
-
- tree = depstree.DepsTree([a, b, c, d, e])
-
- self.AssertValidDependencies(tree.GetDependencies('A'))
- self.AssertValidDependencies(tree.GetDependencies('B'))
- self.AssertValidDependencies(tree.GetDependencies('C'))
- self.AssertValidDependencies(tree.GetDependencies('D'))
- self.AssertValidDependencies(tree.GetDependencies('E'))
-
- def testCircularDependency(self):
- # Circular deps
- a = MockSource(['A'], ['B'])
- b = MockSource(['B'], ['C'])
- c = MockSource(['C'], ['A'])
-
- tree = depstree.DepsTree([a, b, c])
-
- self.assertRaises(depstree.CircularDependencyError,
- tree.GetDependencies, 'A')
-
- def testRequiresUndefinedNamespace(self):
- a = MockSource(['A'], ['B'])
- b = MockSource(['B'], ['C'])
- c = MockSource(['C'], ['D']) # But there is no D.
-
- def MakeDepsTree():
- return depstree.DepsTree([a, b, c])
-
- self.assertRaises(depstree.NamespaceNotFoundError, MakeDepsTree)
-
- def testDepsForMissingNamespace(self):
- a = MockSource(['A'], ['B'])
- b = MockSource(['B'], [])
-
- tree = depstree.DepsTree([a, b])
-
- # There is no C.
- self.assertRaises(depstree.NamespaceNotFoundError,
- tree.GetDependencies, 'C')
-
- def testMultipleRequires(self):
- a = MockSource(['A'], ['B'])
- b = MockSource(['B'], ['C'])
- c = MockSource(['C'], [])
- d = MockSource(['D'], ['B'])
-
- tree = depstree.DepsTree([a, b, c, d])
- self.AssertValidDependencies(tree.GetDependencies(['D', 'A']))
-
-
-if __name__ == '__main__':
- unittest.main()
View
206 closure-library/closure/bin/build/depswriter.py
@@ -1,206 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009 The Closure Library Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS-IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-"""Generates out a Closure deps.js file given a list of JavaScript sources.
-
-Paths can be specified as arguments or (more commonly) specifying trees
-with the flags (call with --help for descriptions).
-
-Usage: depswriter.py [path/to/js1.js [path/to/js2.js] ...]
-"""
-
-import logging
-import optparse
-import os
-import posixpath
-import shlex
-import sys
-
-import source
-import treescan
-
-
-
-
-
-def MakeDepsFile(source_map):
- """Make a generated deps file.
-
- Args:
- source_map: A dict map of the source path to source.Source object.
-
- Returns:
- str, A generated deps file source.
- """
-
- # Write in path alphabetical order
- paths = source_map.keys()
- paths.sort()
-
- lines = []
-
- for path in paths:
- js_source = source_map[path]
-
- # We don't need to add entries that don't provide anything.
- if js_source.provides:
- lines.append(_GetDepsLine(path, js_source))
-
- return ''.join(lines)
-
-
-def _GetDepsLine(path, js_source):
- """Get a deps.js file string for a source."""
-
- provides = list(js_source.provides)
- provides.sort()
-
- requires = list(js_source.requires)
- requires.sort()
-
- return 'goog.addDependency(\'%s\', %s, %s);\n' % (path, provides, requires)
-
-
-def _GetOptionsParser():
- """Get the options parser."""
-
- parser = optparse.OptionParser(__doc__)
-
- parser.add_option('--output_file',
- dest='output_file',
- action='store',
- help=('If specified, write output to this path instead of '
- 'writing to standard output.'))
- parser.add_option('--root',
- dest='roots',
- default=[],
- action='append',
- help='A root directory to scan for JS source files. '
- 'Paths of JS files in generated deps file will be '
- 'relative to this path. This flag may be specified '
- 'multiple times.')
- parser.add_option('--root_with_prefix',
- dest='roots_with_prefix',
- default=[],
- action='append',
- help='A root directory to scan for JS source files, plus '
- 'a prefix (if either contains a space, surround with '
- 'quotes). Paths in generated deps file will be relative '
- 'to the root, but preceded by the prefix. This flag '
- 'may be specified multiple times.')
- parser.add_option('--path_with_depspath',
- dest='paths_with_depspath',
- default=[],
- action='append',
- help='A path to a source file and an alternate path to '
- 'the file in the generated deps file (if either contains '
- 'a space, surround with whitespace). This flag may be '
- 'specified multiple times.')
- return parser
-
-
-def _NormalizePathSeparators(path):
- """Replaces OS-specific path separators with POSIX-style slashes.
-
- Args:
- path: str, A file path.
-
- Returns:
- str, The path with any OS-specific path separators (such as backslash on
- Windows) replaced with URL-compatible forward slashes. A no-op on systems
- that use POSIX paths.
- """
- return path.replace(os.sep, posixpath.sep)
-
-
-def _GetRelativePathToSourceDict(root, prefix=''):
- """Scans a top root directory for .js sources.
-
- Args:
- root: str, Root directory.
- prefix: str, Prefix for returned paths.
-
- Returns:
- dict, A map of relative paths (with prefix, if given), to source.Source
- objects.
- """
- # Remember and restore the cwd when we're done. We work from the root so
- # that paths are relative from the root.
- start_wd = os.getcwd()
- os.chdir(root)
-
- path_to_source = {}
- for path in treescan.ScanTreeForJsFiles('.'):
- prefixed_path = _NormalizePathSeparators(os.path.join(prefix, path))
- path_to_source[prefixed_path] = source.Source(source.GetFileContents(path))
-
- os.chdir(start_wd)
-
- return path_to_source
-
-
-def _GetPair(s):
- """Return a string as a shell-parsed tuple. Two values expected."""
- try:
- # shlex uses '\' as an escape character, so they must be escaped.
- s = s.replace('\\', '\\\\')
- first, second = shlex.split(s)
- return (first, second)
- except:
- raise Exception('Unable to parse input line as a pair: %s' % s)
-
-
-def main():
- """CLI frontend to MakeDepsFile."""
- logging.basicConfig(format=(sys.argv[0] + ': %(message)s'),
- level=logging.INFO)
- options, args = _GetOptionsParser().parse_args()
-
- path_to_source = {}
-
- # Roots without prefixes
- for root in options.roots:
- path_to_source.update(_GetRelativePathToSourceDict(root))
-
- # Roots with prefixes
- for root_and_prefix in options.roots_with_prefix:
- root, prefix = _GetPair(root_and_prefix)
- path_to_source.update(_GetRelativePathToSourceDict(root, prefix=prefix))
-
- # Source paths
- for path in args:
- path_to_source[path] = source.Source(source.GetFileContents(path))
-
- # Source paths with alternate deps paths
- for path_with_depspath in options.paths_with_depspath:
- srcpath, depspath = _GetPair(path_with_depspath)
- path_to_source[depspath] = source.Source(source.GetFileContents(srcpath))
-
- # Make our output pipe.
- if options.output_file:
- out = open(options.output_file, 'w')
- else:
- out = sys.stdout
-
- out.write('// This file was autogenerated by %s.\n' % sys.argv[0])
- out.write('// Please do not edit.\n')
-
- out.write(MakeDepsFile(path_to_source))
-
-
-if __name__ == '__main__':
- main()
View
71 closure-library/closure/bin/build/jscompiler.py
@@ -1,71 +0,0 @@
-# Copyright 2010 The Closure Library Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS-IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Utility to use the Closure Compiler CLI from Python."""
-
-import distutils.version
-import logging
-import re
-import subprocess
-
-
-# Pulls a version number from the first line of 'java -version'
-# See http://java.sun.com/j2se/versioning_naming.html to learn more about the
-# command's output format.
-_VERSION_REGEX = re.compile('"([0-9][.0-9]*)')
-
-
-def _GetJavaVersion():
- """Returns the string for the current version of Java installed."""
- proc = subprocess.Popen(['java', '-version'], stderr=subprocess.PIPE)
- unused_stdoutdata, stderrdata = proc.communicate()
- version_line = stderrdata.splitlines()[0]
- return _VERSION_REGEX.search(version_line).group(1)
-
-
-def Compile(compiler_jar_path, source_paths, flags=None):
- """Prepares command-line call to Closure Compiler.
-
- Args:
- compiler_jar_path: Path to the Closure compiler .jar file.
- source_paths: Source paths to build, in order.
- flags: A list of additional flags to pass on to Closure Compiler.
-
- Returns:
- The compiled source, as a string, or None if compilation failed.
- """
-
- # User friendly version check.
- if not (distutils.version.LooseVersion(_GetJavaVersion()) >=
- distutils.version.LooseVersion('1.6')):
- logging.error('Closure Compiler requires Java 1.6 or higher. '
- 'Please visit http://www.java.com/getjava')
- return
-
- args = ['java', '-jar', compiler_jar_path]
- for path in source_paths:
- args += ['--js', path]
-
- if flags:
- args += flags
-
- logging.info('Compiling with the following command: %s', ' '.join(args))
-
- proc = subprocess.Popen(args, stdout=subprocess.PIPE)
- stdoutdata, unused_stderrdata = proc.communicate()
-
- if proc.returncode != 0:
- return
-
- return stdoutdata
View
100 closure-library/closure/bin/build/source.py
@@ -1,100 +0,0 @@
-# Copyright 2009 The Closure Library Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS-IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-"""Scans a source JS file for its provided and required namespaces.
-
-Simple class to scan a JavaScript file and express its dependencies.
-"""
-
-
-
-
-import re
-
-_BASE_REGEX_STRING = '^\s*goog\.%s\(\s*[\'"](.+)[\'"]\s*\)'
-_PROVIDE_REGEX = re.compile(_BASE_REGEX_STRING % 'provide')
-_REQUIRES_REGEX = re.compile(_BASE_REGEX_STRING % 'require')
-
-# This line identifies base.js and should match the line in that file.
-_GOOG_BASE_LINE = (
- 'var goog = goog || {}; // Identifies this file as the Closure base.')
-
-
-class Source(object):
- """Scans a JavaScript source for its provided and required namespaces."""
-
- def __init__(self, source):
- """Initialize a source.
-
- Args:
- source: str, The JavaScript source.
- """
-
- self.provides = set()
- self.requires = set()
-
- self._source = source
- self._ScanSource()
-
- def __str__(self):
- return 'Source %s' % self._path
-
- def GetSource(self):
- """Get the source as a string."""
- return self._source
-
- def _ScanSource(self):
- """Fill in provides and requires by scanning the source."""
-
- # TODO: Strip source comments first, as these might be in a comment
- # block. RegExes can be borrowed from other projects.
- source = self.GetSource()
-
- source_lines = source.splitlines()
- for line in source_lines:
- match = _PROVIDE_REGEX.match(line)
- if match:
- self.provides.add(match.group(1))
- match = _REQUIRES_REGEX.match(line)
- if match:
- self.requires.add(match.group(1))
-
- # Closure's base file implicitly provides 'goog'.
- for line in source_lines:
- if line == _GOOG_BASE_LINE:
- if len(self.provides) or len(self.requires):
- raise Exception(
- 'Base files should not provide or require namespaces.')
- self.provides.add('goog')
-
-
-def GetFileContents(path):
- """Get a file's contents as a string.
-
- Args:
- path: str, Path to file.
-
- Returns:
- str, Contents of file.
-
- Raises:
- IOError: An error occurred opening or reading the file.
-
- """
- fileobj = open(path)
- try:
- return fileobj.read()
- finally:
- fileobj.close()
View
82 closure-library/closure/bin/build/source_test.py
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2010 The Closure Library Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS-IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-"""Unit test for source."""
-
-
-
-
-import unittest
-
-import source
-
-
-class SourceTestCase(unittest.TestCase):
- """Unit test for source. Tests the parser on a known source input."""
-
- def testSourceScan(self):
- test_source = source.Source(_TEST_SOURCE)
-
- self.assertEqual(set(['foo', 'foo.test']),
- test_source.provides)
- self.assertEqual(set(['goog.dom', 'goog.events.EventType']),
- test_source.requires)
-
- def testSourceScanBase(self):
- test_source = source.Source(_TEST_BASE_SOURCE)
-
- self.assertEqual(set(['goog']),
- test_source.provides)
- self.assertEqual(test_source.requires, set())
-
- def testSourceScanBadBase(self):
-
- def MakeSource():
- source.Source(_TEST_BAD_BASE_SOURCE)
-
- self.assertRaises(Exception, MakeSource)
-
-
-_TEST_SOURCE = """// Fake copyright notice
-
-/** Very important comment. */
-
-goog.provide('foo');
-goog.provide('foo.test');
-
-goog.require('goog.dom');
-goog.require('goog.events.EventType');
-
-function foo() {
- // Set bar to seventeen to increase performance.
- this.bar = 17;
-}
-"""
-
-_TEST_BASE_SOURCE = """
-var goog = goog || {}; // Identifies this file as the Closure base.
-"""
-
-_TEST_BAD_BASE_SOURCE = """
-goog.provide('goog');
-
-var goog = goog || {}; // Identifies this file as the Closure base.
-"""
-
-
-if __name__ == '__main__':
- unittest.main()
View
78 closure-library/closure/bin/build/treescan.py
@@ -1,78 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2010 The Closure Library Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS-IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-"""Shared utility functions for scanning directory trees."""
-
-import os
-import re
-
-
-
-
-
-# Matches a .js file path.
-_JS_FILE_REGEX = re.compile(r'^.+\.js$')
-
-
-def ScanTreeForJsFiles(root):
- """Scans a directory tree for JavaScript files.
-
- Args:
- root: str, Path to a root directory.
-
- Returns:
- An iterable of paths to JS files, relative to cwd.
- """
- return ScanTree(root, path_filter=_JS_FILE_REGEX)
-
-
-def ScanTree(root, path_filter=None, ignore_hidden=True):
- """Scans a directory tree for files.
-
- Args:
- root: str, Path to a root directory.
- path_filter: A regular expression filter. If set, only paths matching
- the path_filter are returned.
- ignore_hidden: If True, do not follow or return hidden directories or files
- (those starting with a '.' character).
-
- Yields:
- A string path to files, relative to cwd.
- """
-
- def OnError(os_error):
- raise os_error
-
- for dirpath, dirnames, filenames in os.walk(root, onerror=OnError):
- # os.walk allows us to modify dirnames to prevent decent into particular
- # directories. Avoid hidden directories.
- for dirname in dirnames:
- if ignore_hidden and dirname.startswith('.'):
- dirnames.remove(dirname)
-
- for filename in filenames:
-
- # nothing that starts with '.'
- if ignore_hidden and filename.startswith('.'):
- continue
-
- fullpath = os.path.join(dirpath, filename)
-
- if path_filter and not path_filter.match(fullpath):
- continue
-
- yield os.path.normpath(fullpath)
View
570 closure-library/closure/bin/calcdeps.py
@@ -1,570 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006 The Closure Library Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS-IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-"""Calculates Javascript dependencies without requiring Google3.
-
-It iterates over a number of search paths and builds a dependency tree. With
-the inputs provided, it walks the dependency tree and outputs all the files
-required for compilation.\n
-"""
-
-
-
-
-
-try:
- import distutils.version
-except ImportError:
- # distutils is not available in all environments
- distutils = None
-
-import logging
-import optparse
-import os
-import re
-import subprocess
-import sys
-
-
-
-req_regex = re.compile('goog\.require\s*\(\s*[\'\"]([^\)]+)[\'\"]\s*\)')
-prov_regex = re.compile('goog\.provide\s*\(\s*[\'\"]([^\)]+)[\'\"]\s*\)')
-ns_regex = re.compile('^ns:((\w+\.)*(\w+))$')
-version_regex = re.compile('[\.0-9]+')
-
-
-def IsValidFile(ref):
- """Returns true if the provided reference is a file and exists."""
- return os.path.isfile(ref)
-
-
-def IsJsFile(ref):
- """Returns true if the provided reference is a Javascript file."""
- return ref.endswith('.js')
-
-
-def IsNamespace(ref):
- """Returns true if the provided reference is a namespace."""
- return re.match(ns_regex, ref) is not None
-
-
-def IsDirectory(ref):
- """Returns true if the provided reference is a directory."""
- return os.path.isdir(ref)
-
-
-def ExpandDirectories(refs):
- """Expands any directory references into inputs.
-
- Description:
- Looks for any directories in the provided references. Found directories
- are recursively searched for .js files, which are then added to the result
- list.
-
- Args:
- refs: a list of references such as files, directories, and namespaces
-
- Returns:
- A list of references with directories removed and replaced by any
- .js files that are found in them. Also, the paths will be normalized.
- """
- result = []
- for ref in refs:
- if IsDirectory(ref):
- # Disable 'Unused variable' for subdirs
- # pylint: disable-msg=W0612
- for (directory, subdirs, filenames) in os.walk(ref):
- for filename in filenames:
- if IsJsFile(filename):
- result.append(os.path.join(directory, filename))
- else:
- result.append(ref)
- return map(os.path.normpath, result)
-
-
-class DependencyInfo(object):
- """Represents a dependency that is used to build and walk a tree."""
-
- def __init__(self, filename):
- self.filename = filename
- self.provides = []
- self.requires = []
-
- def __str__(self):
- return '%s Provides: %s Requires: %s' % (self.filename,
- repr(self.provides),
- repr(self.requires))
-
-
-def BuildDependenciesFromFiles(files):
- """Build a list of dependencies from a list of files.
-
- Description:
- Takes a list of files, extracts their provides and requires, and builds
- out a list of dependency objects.
-
- Args:
- files: a list of files to be parsed for goog.provides and goog.requires.
-
- Returns:
- A list of dependency objects, one for each file in the files argument.
- """
- result = []
- filenames = set()
- for filename in files:
- if filename in filenames:
- continue
-
- # Python 3 requires the file encoding to be specified
- if (sys.version_info[0] < 3):
- file_handle = open(filename, 'r')
- else:
- file_handle = open(filename, 'r', encoding='utf8')
- dep = DependencyInfo(filename)
- try:
- for line in file_handle:
- if re.match(req_regex, line):
- dep.requires.append(re.search(req_regex, line).group(1))
- if re.match(prov_regex, line):
- dep.provides.append(re.search(prov_regex, line).group(1))
- finally:
- file_handle.close()
- result.append(dep)
- filenames.add(filename)
-
- return result
-
-
-def BuildDependencyHashFromDependencies(deps):
- """Builds a hash for searching dependencies by the namespaces they provide.
-
- Description:
- Dependency objects can provide multiple namespaces. This method enumerates
- the provides of each dependency and adds them to a hash that can be used
- to easily resolve a given dependency by a namespace it provides.
-
- Args:
- deps: a list of dependency objects used to build the hash.
-
- Raises:
- Exception: If a multiple files try to provide the same namepace.
-
- Returns:
- A hash table { namespace: dependency } that can be used to resolve a
- dependency by a namespace it provides.
- """
- dep_hash = {}
- for dep in deps:
- for provide in dep.provides:
- if provide in dep_hash:
- raise Exception('Duplicate provide (%s) in (%s, %s)' % (
- provide,
- dep_hash[provide].filename,
- dep.filename))
- dep_hash[provide] = dep
- return dep_hash
-
-
-def CalculateDependencies(paths, inputs):
- """Calculates the dependencies for given inputs.
-
- Description:
- This method takes a list of paths (files, directories) and builds a
- searchable data structure based on the namespaces that each .js file
- provides. It then parses through each input, resolving dependencies
- against this data structure. The final output is a list of files,
- including the inputs, that represent all of the code that is needed to
- compile the given inputs.
-
- Args:
- paths: the references (files, directories) that are used to build the
- dependency hash.
- inputs: the inputs (files, directories, namespaces) that have dependencies
- that need to be calculated.
-
- Raises:
- Exception: if a provided input is invalid.
-
- Returns:
- A list of all files, including inputs, that are needed to compile the given
- inputs.
- """
- deps = BuildDependenciesFromFiles(paths + inputs)
- search_hash = BuildDependencyHashFromDependencies(deps)
- result_list = []
- seen_list = []
- for input_file in inputs:
- if IsNamespace(input_file):
- namespace = re.search(ns_regex, input_file).group(1)
- if namespace not in search_hash:
- raise Exception('Invalid namespace (%s)' % namespace)
- input_file = search_hash[namespace].filename
- if not IsValidFile(input_file) or not IsJsFile(input_file):
- raise Exception('Invalid file (%s)' % input_file)
- seen_list.append(input_file)
- file_handle = open(input_file, 'r')
- try:
- for line in file_handle:
- if re.match(req_regex, line):
- require = re.search(req_regex, line).group(1)
- ResolveDependencies(require, search_hash, result_list, seen_list)
- finally:
- file_handle.close()
- result_list.append(input_file)
-
- # All files depend on base.js, so put it first.
- base_js_path = FindClosureBasePath(paths)
- if base_js_path:
- result_list.insert(0, base_js_path)
- else:
- logging.warning('Closure Library base.js not found.')
-
- return result_list
-
-
-def FindClosureBasePath(paths):
- """Given a list of file paths, return Closure base.js path, if any.
-
- Args:
- paths: A list of paths.
-
- Returns:
- The path to Closure's base.js file including filename, if found.
- """
-
- for path in paths:
- pathname, filename = os.path.split(path)
-
- if filename == 'base.js':
- f = open(path)
-
- is_base = False
-
- # Sanity check that this is the Closure base file. Check that this
- # is where goog is defined.
- for line in f:
- if line.startswith('var goog = goog || {};'):
- is_base = True
- break
-
- f.close()
-
- if is_base:
- return path
-
-def ResolveDependencies(require, search_hash, result_list, seen_list):
- """Takes a given requirement and resolves all of the dependencies for it.
-
- Description:
- A given requirement may require other dependencies. This method
- recursively resolves all dependencies for the given requirement.
-
- Raises:
- Exception: when require does not exist in the search_hash.
-
- Args:
- require: the namespace to resolve dependencies for.
- search_hash: the data structure used for resolving dependencies.
- result_list: a list of filenames that have been calculated as dependencies.
- This variable is the output for this function.
- seen_list: a list of filenames that have been 'seen'. This is required
- for the dependency->dependant ordering.
- """
- if require not in search_hash:
- raise Exception('Missing provider for (%s)' % require)
-
- dep = search_hash[require]
- if not dep.filename in seen_list:
- seen_list.append(dep.filename)
- for sub_require in dep.requires:
- ResolveDependencies(sub_require, search_hash, result_list, seen_list)
- result_list.append(dep.filename)
-
-
-def GetDepsLine(dep, base_path):
- """Returns a JS string for a dependency statement in the deps.js file.
-
- Args:
- dep: The dependency that we're printing.
- base_path: The path to Closure's base.js including filename.
- """
- return 'goog.addDependency("%s", %s, %s);' % (
- GetRelpath(dep.filename, base_path), dep.provides, dep.requires)
-
-
-def GetRelpath(path, start):
- """Return a relative path to |path| from |start|."""
- # NOTE: Python 2.6 provides os.path.relpath, which has almost the same
- # functionality as this function. Since we want to support 2.4, we have
- # to implement it manually. :(
- path_list = os.path.abspath(os.path.normpath(path)).split(os.sep)
- start_list = os.path.abspath(
- os.path.normpath(os.path.dirname(start))).split(os.sep)
-
- common_prefix_count = 0
- for i in range(0, min(len(path_list), len(start_list))):
- if path_list[i] != start_list[i]:
- break
- common_prefix_count += 1
-
- # Always use forward slashes, because this will get expanded to a url,
- # not a file path.
- return '/'.join(['..'] * (len(start_list) - common_prefix_count) +
- path_list[common_prefix_count:])
-
-
-def PrintLine(msg, out):
- out.write(msg)
- out.write('\n')
-
-
-def PrintDeps(source_paths, deps, out):
- """Print out a deps.js file from a list of source paths.
-
- Args:
- source_paths: Paths that we should generate dependency info for.
- deps: Paths that provide dependency info. Their dependency info should
- not appear in the deps file.
- out: The output file.
-
- Returns:
- True on success, false if it was unable to find the base path
- to generate deps relative to.
- """
- base_path = FindClosureBasePath(source_paths + deps)
- if not base_path:
- return False
-
- PrintLine('// This file was autogenerated by calcdeps.py', out)
- excludesSet = set(deps)
-
- for dep in BuildDependenciesFromFiles(source_paths + deps):
- if not dep.filename in excludesSet:
- PrintLine(GetDepsLine(dep, base_path), out)
-
- return True
-
-
-def PrintScript(source_paths, out):
- for index, dep in enumerate(source_paths):
- PrintLine('// Input %d' % index, out)
- f = open(dep, 'r')
- PrintLine(f.read(), out)
- f.close()
-
-
-def GetJavaVersion():
- """Returns the string for the current version of Java installed."""
- proc = subprocess.Popen(['java', '-version'], stderr=subprocess.PIPE)
- proc.wait()
- version_line = proc.stderr.read().splitlines()[0]
- return version_regex.search(version_line).group()
-
-
-def FilterByExcludes(options, files):
- """Filters the given files by the exlusions specified at the command line.
-
- Args:
- options: The flags to calcdeps.
- files: The files to filter.
- Returns:
- A list of files.
- """
- excludes = []
- if options.excludes:
- excludes = ExpandDirectories(options.excludes)
-
- excludesSet = set(excludes)
- return [i for i in files if not i in excludesSet]
-
-
-def GetPathsFromOptions(options):
- """Generates the path files from flag options.
-
- Args:
- options: The flags to calcdeps.
- Returns:
- A list of files in the specified paths. (strings).
- """
-
- search_paths = options.paths
- if not search_paths:
- search_paths = ['.'] # Add default folder if no path is specified.
-
- search_paths = ExpandDirectories(search_paths)
- return FilterByExcludes(options, search_paths)
-
-
-def GetInputsFromOptions(options):
- """Generates the inputs from flag options.
-
- Args:
- options: The flags to calcdeps.
- Returns:
- A list of inputs (strings).
- """
- inputs = options.inputs
- if not inputs: # Parse stdin
- logging.info('No inputs specified. Reading from stdin...')
- inputs = filter(None, [line.strip('\n') for line in sys.stdin.readlines()])
-
- logging.info('Scanning files...')
- inputs = ExpandDirectories(inputs)
-
- return FilterByExcludes(options, inputs)
-
-
-def Compile(compiler_jar_path, source_paths, out, flags=None):
- """Prepares command-line call to Closure compiler.
-
- Args:
- compiler_jar_path: Path to the Closure compiler .jar file.
- source_paths: Source paths to build, in order.
- flags: A list of additional flags to pass on to Closure compiler.
- """
- args = ['java', '-jar', compiler_jar_path]
- for path in source_paths:
- args += ['--js', path]
-
- if flags:
- args += flags
-
- logging.info('Compiling with the following command: %s', ' '.join(args))
- proc = subprocess.Popen(args, stdout=subprocess.PIPE)
- (stdoutdata, stderrdata) = proc.communicate()
- if proc.returncode != 0:
- logging.error('JavaScript compilation failed.')
- sys.exit(1)
- else:
- out.write(stdoutdata)
-
-
-def main():
- """The entrypoint for this script."""
-
- logging.basicConfig(format='calcdeps.py: %(message)s', level=logging.INFO)
-
- usage = 'usage: %prog [options] arg'
- parser = optparse.OptionParser(usage)
- parser.add_option('-i',
- '--input',
- dest='inputs',
- action='append',
- help='The inputs to calculate dependencies for. Valid '
- 'values can be files, directories, or namespaces '
- '(ns:goog.net.XhrLite). Only relevant to "list" and '
- '"script" output.')
- parser.add_option('-p',
- '--path',
- dest='paths',
- action='append',
- help='The paths that should be traversed to build the '
- 'dependencies.')
- parser.add_option('-d',
- '--dep',
- dest='deps',
- action='append',
- help='Directories or files that should be traversed to '
- 'find required dependencies for the deps file. '
- 'Does not generate dependency information for names '
- 'provided by these files. Only useful in "deps" mode.')
- parser.add_option('-e',
- '--exclude',
- dest='excludes',
- action='append',
- help='Files or directories to exclude from the --path '
- 'and --input flags')
- parser.add_option('-o',
- '--output_mode',
- dest='output_mode',
- action='store',
- default='list',
- help='The type of output to generate from this script. '
- 'Options are "list" for a list of filenames, "script" '
- 'for a single script containing the contents of all the '
- 'file, "deps" to generate a deps.js file for all '
- 'paths, or "compiled" to produce compiled output with '
- 'the Closure compiler.')
- parser.add_option('-c',
- '--compiler_jar',
- dest='compiler_jar',
- action='store',
- help='The location of the Closure compiler .jar file.')
- parser.add_option('-f',
- '--compiler_flag',
- '--compiler_flags', # for backwards compatability
- dest='compiler_flags',
- action='append',
- help='Additional flag to pass to the Closure compiler. '
- 'May be specified multiple times to pass multiple flags.')
- parser.add_option('--output_file',
- dest='output_file',
- action='store',
- help=('If specified, write output to this path instead of '
- 'writing to standard output.'))
-
- (options, args) = parser.parse_args()
-
- search_paths = GetPathsFromOptions(options)
-
- if options.output_file:
- out = open(options.output_file, 'w')
- else:
- out = sys.stdout
-
- if options.output_mode == 'deps':
- result = PrintDeps(search_paths, ExpandDirectories(options.deps or []), out)
- if not result:
- logging.error('Could not find Closure Library in the specified paths')
- sys.exit(1)
-
- return
-
- inputs = GetInputsFromOptions(options)
-
- logging.info('Finding Closure dependencies...')
- deps = CalculateDependencies(search_paths, inputs)
- output_mode = options.output_mode
-
- if output_mode == 'script':
- PrintScript(deps, out)
- elif output_mode == 'list':
- # Just print out a dep per line
- for dep in deps:
- PrintLine(dep, out)
- elif output_mode == 'compiled':
- # Make sure a .jar is specified.
- if not options.compiler_jar:
- logging.error('--compiler_jar flag must be specified if --output is '
- '"compiled"')
- sys.exit(1)
-
- # User friendly version check.
- if distutils and not (distutils.version.LooseVersion(GetJavaVersion()) >
- distutils.version.LooseVersion('1.6')):
- logging.error('Closure Compiler requires Java 1.6 or higher.')
- logging.error('Please visit http://www.java.com/getjava')
- sys.exit(1)
-
- Compile(options.compiler_jar, deps, out, options.compiler_flags)
-
- else:
- logging.error('Invalid value for --output flag.')
- sys.exit(1)
-
-if __name__ == '__main__':
- main()
View
211 closure-library/closure/bin/scopify.py
@@ -1,211 +0,0 @@
-#!/usr/bin/python2.4
-#
-# Copyright 2010 The Closure Library Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS-IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-"""Automatically converts codebases over to goog.scope.
-
-Usage:
-cd path/to/my/dir;
-../../../../javascript/closure/bin/scopify.py
-
-Scans every file in this directory, recursively. Looks for existing
-goog.scope calls, and goog.require'd symbols. If it makes sense to
-generate a goog.scope call for the file, then we will do so, and
-try to auto-generate some aliases based on the goog.require'd symbols.
-
-Known Issues:
-
- When a file is goog.scope'd, the file contents will be indented +2.
- This may put some lines over 80 chars. These will need to be fixed manually.
-