Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 # | 6 # |
| 7 | 7 |
| 8 # Script to build a tarball of the Dart source. | 8 # Script to build a tarball of the Dart source. |
| 9 # | 9 # |
| 10 # The tarball includes all the source needed to build Dart. This | 10 # The tarball includes all the source needed to build Dart. This |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 import sys | 26 import sys |
| 27 import tarfile | 27 import tarfile |
| 28 import utils | 28 import utils |
| 29 | 29 |
| 30 from os import listdir, makedirs | 30 from os import listdir, makedirs |
| 31 from os.path import join, exists, split, dirname, abspath | 31 from os.path import join, exists, split, dirname, abspath |
| 32 | 32 |
| 33 HOST_OS = utils.GuessOS() | 33 HOST_OS = utils.GuessOS() |
| 34 DART_DIR = abspath(join(__file__, '..', '..')) | 34 DART_DIR = abspath(join(__file__, '..', '..')) |
| 35 | 35 |
| 36 # TODO (16582): Remove this when the LICENSE file becomes part of | |
| 37 # all checkouts. | |
| 38 license = [ | |
| 39 'This license applies to all parts of Dart that are not externally', | |
| 40 'maintained libraries. The external maintained libraries used by', | |
| 41 'Dart are:', | |
| 42 '', | |
| 43 '7-Zip - in third_party/7zip', | |
| 44 'JSCRE - in runtime/third_party/jscre', | |
| 45 'Ant - in third_party/apache_ant', | |
| 46 'args4j - in third_party/args4j', | |
| 47 'bzip2 - in third_party/bzip2', | |
| 48 'Commons IO - in third_party/commons-io', | |
| 49 'Commons Lang in third_party/commons-lang', | |
| 50 'dromaeo - in samples/third_party/dromaeo', | |
| 51 'Eclipse - in third_party/eclipse', | |
| 52 'gsutil - in third_party/gsutil', | |
| 53 'Guava - in third_party/guava', | |
| 54 'hamcrest - in third_party/hamcrest', | |
| 55 'Httplib2 - in samples/third_party/httplib2', | |
| 56 'JSON - in third_party/json', | |
| 57 'JUnit - in third_party/junit', | |
| 58 'Oauth - in samples/third_party/oauth2client', | |
| 59 'weberknecht - in third_party/weberknecht', | |
| 60 'fest - in third_party/fest', | |
| 61 'mockito - in third_party/mockito', | |
| 62 '', | |
| 63 'The libraries may have their own licenses; we recommend you read them,', | |
| 64 'as their terms may differ from the terms below.', | |
| 65 '', | |
| 66 'Copyright 2012, the Dart project authors. All rights reserved.', | |
| 67 'Redistribution and use in source and binary forms, with or without', | |
| 68 'modification, are permitted provided that the following conditions are', | |
| 69 'met:', | |
| 70 ' * Redistributions of source code must retain the above copyright', | |
| 71 ' notice, this list of conditions and the following disclaimer.', | |
| 72 ' * Redistributions in binary form must reproduce the above', | |
| 73 ' copyright notice, this list of conditions and the following', | |
| 74 ' disclaimer in the documentation and/or other materials provided', | |
| 75 ' with the distribution.', | |
| 76 ' * Neither the name of Google Inc. nor the names of its', | |
| 77 ' contributors may be used to endorse or promote products derived', | |
| 78 ' from this software without specific prior written permission.', | |
| 79 'THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS', | |
| 80 '"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT', | |
| 81 'LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR', | |
| 82 'A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT', | |
| 83 'OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,', | |
| 84 'SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT', | |
| 85 'LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,', | |
| 86 'DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY', | |
| 87 'THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT', | |
| 88 '(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE', | |
| 89 'OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.' | |
| 90 ] | |
| 91 | |
| 92 # Flags. | 36 # Flags. |
| 93 verbose = False | 37 verbose = False |
| 94 | 38 |
| 95 # Name of the dart directory when unpacking the tarball. | 39 # Name of the dart directory when unpacking the tarball. |
| 96 versiondir = '' | 40 versiondir = '' |
| 97 | 41 |
| 98 # Ignore Git/SVN files, checked-in binaries, backup files, etc.. | 42 # Ignore Git/SVN files, checked-in binaries, backup files, etc.. |
| 99 ignoredPaths = ['tools/testing/bin' | 43 ignoredPaths = ['tools/testing/bin' |
| 100 'third_party/7zip', 'third_party/android_tools', | 44 'third_party/7zip', 'third_party/android_tools', |
| 101 'third_party/clang', 'third_party/d8', | 45 'third_party/clang', 'third_party/d8', |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 127 # Add the dart directory name with version. Place the debian | 71 # Add the dart directory name with version. Place the debian |
| 128 # directory one level over the rest which are placed in the | 72 # directory one level over the rest which are placed in the |
| 129 # directory 'dart'. This enables building the Debian packages | 73 # directory 'dart'. This enables building the Debian packages |
| 130 # out-of-the-box. | 74 # out-of-the-box. |
| 131 tar_info.name = join(versiondir, 'dart', original_name) | 75 tar_info.name = join(versiondir, 'dart', original_name) |
| 132 if verbose: | 76 if verbose: |
| 133 print 'Adding %s as %s' % (original_name, tar_info.name) | 77 print 'Adding %s as %s' % (original_name, tar_info.name) |
| 134 return tar_info | 78 return tar_info |
| 135 | 79 |
| 136 def GenerateCopyright(filename): | 80 def GenerateCopyright(filename): |
| 137 license_lines = license | 81 with open(join(DART_DIR, 'LICENSE')) as lf: |
| 138 try: | 82 license_lines = lf.read().splitlines() |
|
ricow1
2014/02/10 08:23:11
lf.readlines()
Søren Gjesse
2014/02/10 08:36:16
Done. As readlines() keeps the trailing \n, I also
| |
| 139 # TODO (16582): The LICENSE file is currently not in a normal the | |
| 140 # dart checkout. | |
| 141 with open(join(DART_DIR, 'LICENSE')) as lf: | |
| 142 license_lines = lf.read().splitlines() | |
| 143 except: | |
| 144 pass | |
| 145 | 83 |
| 146 with open(filename, 'w') as f: | 84 with open(filename, 'w') as f: |
| 147 f.write('Name: dart\n') | 85 f.write('Name: dart\n') |
| 148 f.write('Maintainer: Dart Team <misc@dartlang.org>\n') | 86 f.write('Maintainer: Dart Team <misc@dartlang.org>\n') |
| 149 f.write('Source: https://code.google.com/p/dart/\n') | 87 f.write('Source: https://code.google.com/p/dart/\n') |
| 150 f.write('License:\n') | 88 f.write('License:\n') |
| 151 for line in license_lines: | 89 for line in license_lines: |
| 152 f.write(' %s\n' % line) | 90 f.write(' %s\n' % line) |
| 153 | 91 |
| 154 def GenerateChangeLog(filename, version): | 92 def GenerateChangeLog(filename, version): |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 214 parser = BuildOptions() | 152 parser = BuildOptions() |
| 215 (options, args) = parser.parse_args() | 153 (options, args) = parser.parse_args() |
| 216 if options.verbose: | 154 if options.verbose: |
| 217 global verbose | 155 global verbose |
| 218 verbose = True | 156 verbose = True |
| 219 | 157 |
| 220 CreateTarball() | 158 CreateTarball() |
| 221 | 159 |
| 222 if __name__ == '__main__': | 160 if __name__ == '__main__': |
| 223 sys.exit(Main()) | 161 sys.exit(Main()) |
| OLD | NEW |