Skip to content

Commit

Permalink
Always use relative paths to import from within the front end
Browse files Browse the repository at this point in the history
The style guide says to "PREFER relative paths when importing
libraries within your own package’s lib directory".  Mixing them with
package: imports doesn't work.  Before: we had a mix.  Now: we don't.

Change-Id: Iadcf1dda7bae51121e325f5d4b8c6add8759da95
Reviewed-on: https://dart-review.googlesource.com/68082
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
  • Loading branch information
Kevin Millikin authored and commit-bot@chromium.org committed Aug 8, 2018
1 parent 84d8887 commit 35d26c9
Show file tree
Hide file tree
Showing 26 changed files with 99 additions and 97 deletions.
4 changes: 2 additions & 2 deletions pkg/front_end/lib/src/api_prototype/byte_store.dart
Expand Up @@ -4,7 +4,7 @@

library front_end.byte_store;

export 'package:front_end/src/byte_store/byte_store.dart'
export '../byte_store/byte_store.dart'
show ByteStore, MemoryByteStore, MemoryCachingByteStore, NullByteStore;
export 'package:front_end/src/byte_store/file_byte_store.dart'
export '../byte_store/file_byte_store.dart'
show EvictingFileByteStore, FileByteStore;
4 changes: 2 additions & 2 deletions pkg/front_end/lib/src/api_prototype/compilation_message.dart
Expand Up @@ -8,8 +8,8 @@ library front_end.compilation_message;

import 'package:source_span/source_span.dart' show SourceSpan;

import 'package:front_end/src/fasta/severity.dart' show Severity;
export 'package:front_end/src/fasta/severity.dart' show Severity;
import '../fasta/severity.dart' show Severity;
export '../fasta/severity.dart' show Severity;

/// A single message, typically an error, reported during compilation, and
/// information about where it occurred and suggestions on how to fix it.
Expand Down
5 changes: 3 additions & 2 deletions pkg/front_end/lib/src/api_prototype/compiler_options.dart
Expand Up @@ -4,10 +4,11 @@

library front_end.compiler_options;

import 'package:front_end/src/api_prototype/byte_store.dart';
import 'package:front_end/src/base/performance_logger.dart';
import 'package:kernel/target/targets.dart' show Target;

import 'byte_store.dart';
import '../base/performance_logger.dart';

import '../fasta/fasta_codes.dart' show FormattedMessage;
import '../fasta/severity.dart' show Severity;

Expand Down
7 changes: 4 additions & 3 deletions pkg/front_end/lib/src/api_unstable/bazel_worker.dart
Expand Up @@ -7,11 +7,12 @@
import 'dart:async' show Future;

import 'package:front_end/src/api_prototype/file_system.dart';
import 'package:front_end/src/base/processed_options.dart';
import 'package:front_end/src/kernel_generator_impl.dart';
import 'package:kernel/target/targets.dart' show Target;

import '../api_prototype/file_system.dart';
import '../base/processed_options.dart';
import '../kernel_generator_impl.dart';

import '../api_prototype/compiler_options.dart';
import 'compiler_state.dart';

Expand Down
9 changes: 5 additions & 4 deletions pkg/front_end/lib/src/api_unstable/ddc.dart
Expand Up @@ -4,13 +4,14 @@

import 'dart:async' show Future;

import 'package:front_end/src/api_prototype/file_system.dart';
import 'package:front_end/src/api_prototype/standard_file_system.dart';
import 'package:front_end/src/base/processed_options.dart';
import 'package:front_end/src/kernel_generator_impl.dart';
import 'package:kernel/kernel.dart' show Component;
import 'package:kernel/target/targets.dart' show Target;

import '../api_prototype/file_system.dart';
import '../api_prototype/standard_file_system.dart';
import '../base/processed_options.dart';
import '../kernel_generator_impl.dart';

import '../api_prototype/compiler_options.dart';
import 'compiler_state.dart';

Expand Down
2 changes: 1 addition & 1 deletion pkg/front_end/lib/src/base/analysis_target.dart
Expand Up @@ -2,7 +2,7 @@
// 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.

import 'package:front_end/src/base/source.dart';
import 'source.dart';

/**
* An object with which an analysis result can be associated.
Expand Down
3 changes: 2 additions & 1 deletion pkg/front_end/lib/src/base/instrumentation.dart
Expand Up @@ -2,9 +2,10 @@
// 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.

import 'package:front_end/src/fasta/problems.dart';
import 'package:kernel/ast.dart';

import '../fasta/problems.dart';

/// Convert '→' to '->' because '→' doesn't show up in some terminals.
/// Remove prefixes that are used very often in tests.
String _shortenInstrumentationString(String s) => s
Expand Down
7 changes: 4 additions & 3 deletions pkg/front_end/lib/src/base/source.dart
Expand Up @@ -2,11 +2,12 @@
// 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.

import 'package:front_end/src/base/analysis_target.dart';
import 'package:front_end/src/base/timestamped_data.dart';
import 'package:front_end/src/base/uri_kind.dart';
import 'package:path/path.dart' as pathos;

import 'analysis_target.dart';
import 'timestamped_data.dart';
import 'uri_kind.dart';

/// Base class providing implementations for the methods in [Source] that don't
/// require filesystem access.
abstract class BasicSource extends Source {
Expand Down
2 changes: 1 addition & 1 deletion pkg/front_end/lib/src/byte_store/byte_store.dart
Expand Up @@ -2,7 +2,7 @@
// 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.

import 'package:front_end/src/byte_store/cache.dart';
import 'cache.dart';

/**
* Store of bytes associated with string keys.
Expand Down
5 changes: 3 additions & 2 deletions pkg/front_end/lib/src/byte_store/file_byte_store.dart
Expand Up @@ -7,10 +7,11 @@ import 'dart:io';
import 'dart:isolate';
import 'dart:typed_data';

import 'package:front_end/src/byte_store/byte_store.dart';
import 'package:front_end/src/byte_store/fletcher16.dart';
import 'package:path/path.dart';

import 'byte_store.dart';
import 'fletcher16.dart';

/**
* The request that is sent from the main isolate to the clean-up isolate.
*/
Expand Down
Expand Up @@ -5,12 +5,13 @@
import 'dart:convert';
import 'dart:io';

import 'package:front_end/src/byte_store/byte_store.dart';
import 'package:front_end/src/byte_store/cache.dart';
import 'package:front_end/src/byte_store/file_byte_store.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart';

import 'byte_store.dart';
import 'cache.dart';
import 'file_byte_store.dart';

/// The function that returns current time in milliseconds.
typedef int GetCurrentTime();

Expand Down
5 changes: 2 additions & 3 deletions pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
Expand Up @@ -4,9 +4,6 @@

library fasta.kernel_enum_builder;

import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'
show ShadowClass;

import 'package:kernel/ast.dart'
show
Arguments,
Expand All @@ -29,6 +26,8 @@ import 'package:kernel/ast.dart'
TreeNode,
VariableGet;

import 'kernel_shadow_ast.dart' show ShadowClass;

import '../fasta_codes.dart'
show
messageNoUnnamedConstructorInObject,
Expand Down
Expand Up @@ -4,8 +4,7 @@

library fasta.kernel_formal_parameter_builder;

import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'
show VariableDeclarationJudgment;
import 'kernel_shadow_ast.dart' show VariableDeclarationJudgment;

import '../modifier.dart' show finalMask;

Expand All @@ -16,8 +15,7 @@ import 'kernel_builder.dart'
KernelTypeBuilder,
MetadataBuilder;

import 'package:front_end/src/fasta/source/source_library_builder.dart'
show SourceLibraryBuilder;
import '../source/source_library_builder.dart' show SourceLibraryBuilder;

class KernelFormalParameterBuilder
extends FormalParameterBuilder<KernelTypeBuilder> {
Expand Down
11 changes: 5 additions & 6 deletions pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart
Expand Up @@ -4,12 +4,6 @@

library fasta.kernel_procedure_builder;

import 'package:front_end/src/base/instrumentation.dart'
show Instrumentation, InstrumentationValueForType;

import 'package:front_end/src/fasta/type_inference/type_inferrer.dart'
show TypeInferrer;

import 'package:kernel/ast.dart'
show
Arguments,
Expand Down Expand Up @@ -42,6 +36,11 @@ import 'package:kernel/ast.dart'

import 'package:kernel/type_algebra.dart' show containsTypeVariable, substitute;

import '../../base/instrumentation.dart'
show Instrumentation, InstrumentationValueForType;

import '../type_inference/type_inferrer.dart' show TypeInferrer;

import '../loader.dart' show Loader;

import '../messages.dart'
Expand Down
6 changes: 3 additions & 3 deletions pkg/front_end/lib/src/fasta/parser/directive_context.dart
Expand Up @@ -2,9 +2,9 @@
// 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.

import 'package:front_end/src/fasta/fasta_codes.dart';
import 'package:front_end/src/fasta/parser/parser.dart';
import 'package:front_end/src/scanner/token.dart';
import '../fasta_codes.dart';
import 'parser.dart';
import '../../scanner/token.dart';

class DirectiveContext {
DirectiveState state = DirectiveState.Unknown;
Expand Down
Expand Up @@ -2,8 +2,7 @@
// 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.

import 'package:front_end/src/fasta/scanner/error_token.dart'
show UnmatchedToken;
import '../scanner/error_token.dart' show UnmatchedToken;

import '../../scanner/token.dart'
show
Expand Down
7 changes: 3 additions & 4 deletions pkg/front_end/lib/src/fasta/testing/kernel_chain.dart
Expand Up @@ -33,12 +33,11 @@ import 'package:kernel/text/ast_to_text.dart' show Printer;
import 'package:testing/testing.dart'
show ChainContext, Result, StdioProcess, Step, TestDescription;

import 'package:front_end/src/api_prototype/front_end.dart';
import '../../api_prototype/front_end.dart';

import 'package:front_end/src/base/processed_options.dart'
show ProcessedOptions;
import '../../base/processed_options.dart' show ProcessedOptions;

import 'package:front_end/src/compute_platform_binaries_location.dart'
import '../../compute_platform_binaries_location.dart'
show computePlatformBinariesLocation;

import '../compiler_context.dart';
Expand Down
12 changes: 6 additions & 6 deletions pkg/front_end/lib/src/fasta/uri_translator_impl.dart
Expand Up @@ -4,14 +4,14 @@

library fasta.uri_translator_impl;

import 'package:front_end/src/base/libraries_specification.dart'
show TargetLibrariesSpecification;
import 'package:front_end/src/fasta/compiler_context.dart' show CompilerContext;
import 'package:front_end/src/fasta/fasta_codes.dart';
import 'package:front_end/src/fasta/severity.dart' show Severity;
import 'package:front_end/src/fasta/uri_translator.dart';
import 'package:package_config/packages.dart' show Packages;

import '../base/libraries_specification.dart' show TargetLibrariesSpecification;
import 'compiler_context.dart' show CompilerContext;
import 'fasta_codes.dart';
import 'severity.dart' show Severity;
import 'uri_translator.dart';

/// Implementation of [UriTranslator] for absolute `dart` and `package` URIs.
class UriTranslatorImpl implements UriTranslator {
/// Library information for platform libraries.
Expand Down
17 changes: 9 additions & 8 deletions pkg/front_end/lib/src/incremental/file_state.dart
Expand Up @@ -8,16 +8,17 @@ import 'dart:typed_data';

import 'package:convert/convert.dart';
import 'package:crypto/crypto.dart';
import 'package:front_end/src/api_prototype/byte_store.dart';
import 'package:front_end/src/api_prototype/file_system.dart';
import 'package:front_end/src/base/api_signature.dart';
import 'package:front_end/src/base/resolve_relative_uri.dart';
import 'package:front_end/src/dependency_walker.dart' as graph;
import 'package:front_end/src/fasta/uri_translator.dart';
import 'package:front_end/src/incremental/format.dart';
import 'package:front_end/src/incremental/unlinked_unit.dart';
import 'package:kernel/target/targets.dart';

import '../api_prototype/byte_store.dart';
import '../api_prototype/file_system.dart';
import '../base/api_signature.dart';
import '../base/resolve_relative_uri.dart';
import '../dependency_walker.dart' as graph;
import '../fasta/uri_translator.dart';
import 'format.dart';
import 'unlinked_unit.dart';

/// This function is called for each newly discovered file, and the returned
/// [Future] is awaited before reading the file content.
typedef Future<Null> NewFileFn(Uri uri);
Expand Down
2 changes: 1 addition & 1 deletion pkg/front_end/lib/src/incremental/format.dart
Expand Up @@ -4,7 +4,7 @@

import 'dart:typed_data' show Uint8List;

import 'package:front_end/src/base/flat_buffers.dart' as fb;
import '../base/flat_buffers.dart' as fb;

/// Unlinked information about a `show` or `hide` combinator in an import or
/// export directive.
Expand Down
29 changes: 15 additions & 14 deletions pkg/front_end/lib/src/incremental/kernel_driver.dart
Expand Up @@ -4,27 +4,28 @@

import 'dart:async';

import 'package:front_end/src/api_prototype/byte_store.dart';
import 'package:front_end/src/api_prototype/compilation_message.dart';
import 'package:front_end/src/api_prototype/file_system.dart';
import 'package:front_end/src/base/api_signature.dart';
import 'package:front_end/src/base/performance_logger.dart';
import 'package:front_end/src/base/processed_options.dart';
import 'package:front_end/src/fasta/compiler_context.dart';
import 'package:front_end/src/fasta/dill/dill_target.dart';
import 'package:front_end/src/fasta/kernel/kernel_target.dart';
import 'package:front_end/src/fasta/kernel/metadata_collector.dart';
import 'package:front_end/src/fasta/kernel/utils.dart';
import 'package:front_end/src/fasta/ticker.dart';
import 'package:front_end/src/fasta/uri_translator.dart';
import 'package:front_end/src/incremental/file_state.dart';
import 'package:kernel/binary/ast_from_binary.dart';
import 'package:kernel/class_hierarchy.dart';
import 'package:kernel/core_types.dart';
import 'package:kernel/kernel.dart';
import 'package:kernel/type_environment.dart';
import 'package:meta/meta.dart';

import '../api_prototype/byte_store.dart';
import '../api_prototype/compilation_message.dart';
import '../api_prototype/file_system.dart';
import '../base/api_signature.dart';
import '../base/performance_logger.dart';
import '../base/processed_options.dart';
import '../fasta/compiler_context.dart';
import '../fasta/dill/dill_target.dart';
import '../fasta/kernel/kernel_target.dart';
import '../fasta/kernel/metadata_collector.dart';
import '../fasta/kernel/utils.dart';
import '../fasta/ticker.dart';
import '../fasta/uri_translator.dart';
import 'file_state.dart';

/// This function is invoked for each newly discovered file, and the returned
/// [Future] is awaited before reading the file content.
typedef Future<Null> KernelDriverFileAddedFn(Uri uri);
Expand Down
16 changes: 7 additions & 9 deletions pkg/front_end/lib/src/incremental/unlinked_unit.dart
Expand Up @@ -4,15 +4,13 @@

import 'dart:typed_data';

import 'package:front_end/src/base/api_signature.dart';
import 'package:front_end/src/fasta/parser.dart'
show Listener, Parser, optional;
import 'package:front_end/src/fasta/parser/top_level_parser.dart';
import 'package:front_end/src/fasta/scanner.dart';
import 'package:front_end/src/fasta/scanner/token_constants.dart'
show STRING_TOKEN;
import 'package:front_end/src/fasta/source/directive_listener.dart';
import 'package:front_end/src/incremental/format.dart';
import '../base/api_signature.dart';
import '../fasta/parser.dart' show Listener, Parser, optional;
import '../fasta/parser/top_level_parser.dart';
import '../fasta/scanner.dart';
import '../fasta/scanner/token_constants.dart' show STRING_TOKEN;
import '../fasta/source/directive_listener.dart';
import 'format.dart';

/// Compute the [UnlinkedUnitBuilder] for the [content].
UnlinkedUnitBuilder computeUnlinkedUnit(List<int> salt, List<int> content) {
Expand Down
10 changes: 5 additions & 5 deletions pkg/front_end/lib/src/scanner/errors.dart
Expand Up @@ -2,11 +2,11 @@
// 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.

import 'package:front_end/src/base/errors.dart';
import 'package:front_end/src/fasta/fasta_codes.dart';
import 'package:front_end/src/fasta/scanner/error_token.dart';
import 'package:front_end/src/scanner/token.dart' show Token, TokenType;
import 'package:front_end/src/fasta/scanner/token_constants.dart';
import '../base/errors.dart';
import '../fasta/fasta_codes.dart';
import '../fasta/scanner/error_token.dart';
import 'token.dart' show Token, TokenType;
import '../fasta/scanner/token_constants.dart';

/**
* The error codes used for errors detected by the scanner.
Expand Down

0 comments on commit 35d26c9

Please sign in to comment.