mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 08:24:39 +00:00
[pkg/dart2native] switch to use package:lints
Change-Id: I81f2b25cc57fc89138638eb0b98f6d5489146473 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204641 Reviewed-by: Phil Quitslund <pquitslund@google.com> Commit-Queue: Devon Carew <devoncarew@google.com>
This commit is contained in:
parent
4f5d4731c5
commit
dc1804fff4
|
@ -1,13 +1,8 @@
|
|||
include: package:pedantic/analysis_options.1.8.0.yaml
|
||||
|
||||
analyzer:
|
||||
errors:
|
||||
# Increase the severity of several hints.
|
||||
prefer_single_quotes: warning
|
||||
unused_import: warning
|
||||
include: package:lints/recommended.yaml
|
||||
|
||||
linter:
|
||||
rules:
|
||||
- directives_ordering
|
||||
- prefer_relative_imports
|
||||
- prefer_single_quotes
|
||||
# Enable additional rules.
|
||||
depend_on_referenced_packages: true
|
||||
directives_ordering: true
|
||||
sort_pub_dependencies: true
|
||||
|
|
|
@ -103,7 +103,7 @@ Sets the verbosity level used for filtering messages during compilation.
|
|||
final String sourceFile = parsedArgs.rest[0];
|
||||
if (!FileSystemEntity.isFileSync(sourceFile)) {
|
||||
stderr.writeln(
|
||||
'"${sourceFile}" is not a file. See \'--help\' for more information.');
|
||||
'"$sourceFile" is not a file. See \'--help\' for more information.');
|
||||
await stderr.flush();
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -52,10 +52,10 @@ Future<ProcessResult> generateAotKernel(
|
|||
genKernel,
|
||||
'--platform',
|
||||
platformDill,
|
||||
if (enableExperiment.isNotEmpty) '--enable-experiment=${enableExperiment}',
|
||||
if (enableExperiment.isNotEmpty) '--enable-experiment=$enableExperiment',
|
||||
'--aot',
|
||||
'-Ddart.vm.product=true',
|
||||
...(defines.map((d) => '-D${d}')),
|
||||
...(defines.map((d) => '-D$d')),
|
||||
if (packages != null) ...['--packages', packages],
|
||||
'-o',
|
||||
kernelFile,
|
||||
|
@ -73,7 +73,7 @@ Future generateAotSnapshot(
|
|||
List<String> extraGenSnapshotOptions) {
|
||||
return Process.run(genSnapshot, [
|
||||
'--snapshot-kind=app-aot-elf',
|
||||
'--elf=${snapshotFile}',
|
||||
'--elf=$snapshotFile',
|
||||
if (debugFile != null) '--save-debugging-info=$debugFile',
|
||||
if (debugFile != null) '--dwarf-stack-traces',
|
||||
if (debugFile != null) '--strip',
|
||||
|
|
|
@ -3,17 +3,19 @@
|
|||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import 'dart2native.dart';
|
||||
|
||||
final Directory binDir = File(Platform.resolvedExecutable).parent;
|
||||
final String executableSuffix = Platform.isWindows ? '.exe' : '';
|
||||
final String dartaotruntime =
|
||||
path.join(binDir.path, 'dartaotruntime${executableSuffix}');
|
||||
path.join(binDir.path, 'dartaotruntime$executableSuffix');
|
||||
final String genKernel =
|
||||
path.join(binDir.path, 'snapshots', 'gen_kernel.dart.snapshot');
|
||||
final String genSnapshot =
|
||||
path.join(binDir.path, 'utils', 'gen_snapshot${executableSuffix}');
|
||||
path.join(binDir.path, 'utils', 'gen_snapshot$executableSuffix');
|
||||
final String productPlatformDill = path.join(
|
||||
binDir.parent.path, 'lib', '_internal', 'vm_platform_strong_product.dill');
|
||||
|
||||
|
@ -42,11 +44,10 @@ Future<void> generateNative({
|
|||
'exe': Kind.exe,
|
||||
}[kind];
|
||||
final sourceWithoutDart = sourcePath.replaceFirst(RegExp(r'\.dart$'), '');
|
||||
final outputPath = path.canonicalize(path.normalize(outputFile != null
|
||||
? outputFile
|
||||
: {
|
||||
Kind.aot: '${sourceWithoutDart}.aot',
|
||||
Kind.exe: '${sourceWithoutDart}.exe',
|
||||
final outputPath = path.canonicalize(path.normalize(outputFile ??
|
||||
{
|
||||
Kind.aot: '$sourceWithoutDart.aot',
|
||||
Kind.exe: '$sourceWithoutDart.exe',
|
||||
}[outputKind]));
|
||||
final debugPath =
|
||||
debugFile != null ? path.canonicalize(path.normalize(debugFile)) : null;
|
||||
|
@ -113,7 +114,7 @@ Future<void> generateNative({
|
|||
}
|
||||
}
|
||||
|
||||
print('Generated: ${outputPath}');
|
||||
print('Generated: $outputPath');
|
||||
} finally {
|
||||
tempDir.deleteSync(recursive: true);
|
||||
}
|
||||
|
|
|
@ -11,8 +11,9 @@ executables:
|
|||
|
||||
dependencies:
|
||||
args: ^1.4.0
|
||||
path: any
|
||||
front_end:
|
||||
path: ../front_end
|
||||
path: any
|
||||
|
||||
dev_dependencies:
|
||||
lints: any
|
||||
|
|
Loading…
Reference in a new issue