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

Unified Diff: sdk/lib/_internal/pub/lib/src/validator/lib.dart

Issue 122533002: Remove LibValidator to allow assets-only pub packages (http://dartbug.com/15810). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/validator.dart ('k') | sdk/lib/_internal/pub/test/validator/lib_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/validator/lib.dart
diff --git a/sdk/lib/_internal/pub/lib/src/validator/lib.dart b/sdk/lib/_internal/pub/lib/src/validator/lib.dart
deleted file mode 100644
index 22ed406e2e99800739da8c2d09ce38fbad304f9a..0000000000000000000000000000000000000000
--- a/sdk/lib/_internal/pub/lib/src/validator/lib.dart
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library pub.validator.lib;
-
-import 'dart:async';
-
-import 'package:path/path.dart' as path;
-
-import '../entrypoint.dart';
-import '../io.dart';
-import '../utils.dart';
-import '../validator.dart';
-
-// TODO(nweiz): When issue 7196 is fixed, complain about non-Dart files in lib.
-/// A validator that checks that libraries in "lib/" (and not "lib/src/") exist
-/// and are well-formed.
-class LibValidator extends Validator {
- LibValidator(Entrypoint entrypoint)
- : super(entrypoint);
-
- Future validate() {
- return syncFuture(() {
- var libDir = path.join(entrypoint.root.dir, "lib");
-
- if (!dirExists(libDir)) {
- errors.add('You must have a "lib" directory.\n'
- "Without that, users cannot import any code from your package.");
- return;
- }
-
- var files = listDir(libDir)
- .map((file) => path.relative(file, from: libDir))
- .toList();
- if (files.isEmpty) {
- errors.add('You must have a non-empty "lib" directory.\n'
- "Without that, users cannot import any code from your package.");
- } else if (files.length == 1 && files.first == "src") {
- errors.add('The "lib" directory must contain something other than '
- '"src".\n'
- "Otherwise, users cannot import any code from your package.");
- }
- });
- }
-}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/validator.dart ('k') | sdk/lib/_internal/pub/test/validator/lib_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698