Migrate pkg/dart2native to null safety

Change-Id: I87e4fd454b8e52acc17243495295ffee9dfd79bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208986
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This commit is contained in:
Alexander Markov 2021-08-05 17:41:30 +00:00 committed by commit-bot@chromium.org
parent 81da4e07fd
commit 846af57d99
5 changed files with 14 additions and 14 deletions

View file

@ -11,7 +11,7 @@
"constraint, update this by running tools/generate_package_config.dart."
],
"configVersion": 2,
"generated": "2021-08-04T21:18:41.561058",
"generated": "2021-08-04T16:42:24.433381",
"generator": "tools/generate_package_config.dart",
"packages": [
{
@ -226,7 +226,7 @@
"name": "dart2native",
"rootUri": "../pkg/dart2native",
"packageUri": "lib/",
"languageVersion": "2.7"
"languageVersion": "2.12"
},
{
"name": "dart_internal",

View file

@ -21,7 +21,7 @@ Generates an executable or an AOT snapshot from <main-dart-file>.
Future<void> main(List<String> args) async {
// If we're outputting to a terminal, wrap usage text to that width.
int outputLineWidth;
int? outputLineWidth;
try {
outputLineWidth = stdout.terminalColumns;
} catch (_) {/* Ignore. */}

View file

@ -44,7 +44,7 @@ Future<ProcessResult> generateAotKernel(
String platformDill,
String sourceFile,
String kernelFile,
String packages,
String? packages,
List<String> defines,
{String enableExperiment = '',
List<String> extraGenKernelOptions = const []}) {
@ -68,7 +68,7 @@ Future generateAotSnapshot(
String genSnapshot,
String kernelFile,
String snapshotFile,
String debugFile,
String? debugFile,
bool enableAsserts,
List<String> extraGenSnapshotOptions) {
return Process.run(genSnapshot, [

View file

@ -21,14 +21,14 @@ final String productPlatformDill = path.join(
Future<void> generateNative({
String kind = 'exe',
String sourceFile,
String outputFile,
String debugFile,
String packages,
List<String> defines,
required String sourceFile,
String? outputFile,
String? debugFile,
String? packages,
required List<String> defines,
String enableExperiment = '',
bool enableAsserts = false,
bool soundNullSafety,
bool? soundNullSafety,
bool verbose = false,
String verbosity = 'all',
List<String> extraOptions = const [],
@ -42,13 +42,13 @@ Future<void> generateNative({
final Kind outputKind = {
'aot': Kind.aot,
'exe': Kind.exe,
}[kind];
}[kind]!;
final sourceWithoutDart = sourcePath.replaceFirst(RegExp(r'\.dart$'), '');
final outputPath = path.canonicalize(path.normalize(outputFile ??
{
Kind.aot: '$sourceWithoutDart.aot',
Kind.exe: '$sourceWithoutDart.exe',
}[outputKind]));
}[outputKind]!));
final debugPath =
debugFile != null ? path.canonicalize(path.normalize(debugFile)) : null;

View file

@ -3,7 +3,7 @@ name: dart2native
publish_to: none
environment:
sdk: "^2.7.0"
sdk: '>=2.12.0 <3.0.0'
# Add the bin/dart2native.dart script to the scripts pub installs.
executables: