Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1452)

Side by Side Diff: mojo/public/tools/dart_pkg.py

Issue 1242873003: Fix dart_pkg.py build crash (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2015 The Chromium Authors. All rights reserved. 3 # Copyright 2015 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Utility for dart_pkg and dart_pkg_app rules""" 7 """Utility for dart_pkg and dart_pkg_app rules"""
8 8
9 import argparse 9 import argparse
10 import errno 10 import errno
(...skipping 30 matching lines...) Expand all
41 41
42 42
43 def mojom_filter(path): 43 def mojom_filter(path):
44 if os.path.isdir(path): 44 if os.path.isdir(path):
45 return True 45 return True
46 _, ext = os.path.splitext(path) 46 _, ext = os.path.splitext(path)
47 return ext == '.mojom' 47 return ext == '.mojom'
48 48
49 49
50 def ensure_dir_exists(path): 50 def ensure_dir_exists(path):
51 if not os.path.exists(path): 51 abspath = os.path.abspath(path)
52 os.makedirs(path) 52 if not os.path.exists(abspath):
53 os.makedirs(abspath)
53 54
54 55
55 def has_pubspec_yaml(paths): 56 def has_pubspec_yaml(paths):
56 for path in paths: 57 for path in paths:
57 _, filename = os.path.split(path) 58 _, filename = os.path.split(path)
58 if 'pubspec.yaml' == filename: 59 if 'pubspec.yaml' == filename:
59 return True 60 return True
60 return False 61 return False
61 62
62 63
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 # Remove any broken symlinks in target_dir and package root. 267 # Remove any broken symlinks in target_dir and package root.
267 remove_broken_symlinks(target_dir) 268 remove_broken_symlinks(target_dir)
268 remove_broken_symlinks(args.package_root) 269 remove_broken_symlinks(args.package_root)
269 270
270 # Write stamp file. 271 # Write stamp file.
271 with open(args.stamp_file, 'w'): 272 with open(args.stamp_file, 'w'):
272 pass 273 pass
273 274
274 if __name__ == '__main__': 275 if __name__ == '__main__':
275 sys.exit(main()) 276 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698