mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 12:57:42 +00:00
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:
parent
81da4e07fd
commit
846af57d99
|
@ -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",
|
||||
|
|
|
@ -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. */}
|
||||
|
|
|
@ -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, [
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue