mirror of
https://github.com/flutter/flutter
synced 2024-10-12 19:23:02 +00:00
feat: migrate windows/application_package.dart to null-safety (#88081)
This commit is contained in:
parent
10e4b04010
commit
a17723d46b
|
@ -2,10 +2,6 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
// @dart = 2.8
|
|
||||||
|
|
||||||
import 'package:meta/meta.dart';
|
|
||||||
|
|
||||||
import '../application_package.dart';
|
import '../application_package.dart';
|
||||||
import '../base/file_system.dart';
|
import '../base/file_system.dart';
|
||||||
import '../base/utils.dart';
|
import '../base/utils.dart';
|
||||||
|
@ -15,7 +11,7 @@ import '../cmake_project.dart';
|
||||||
import '../globals_null_migrated.dart' as globals;
|
import '../globals_null_migrated.dart' as globals;
|
||||||
|
|
||||||
abstract class WindowsApp extends ApplicationPackage {
|
abstract class WindowsApp extends ApplicationPackage {
|
||||||
WindowsApp({@required String projectBundleId}) : super(id: projectBundleId);
|
WindowsApp({required String projectBundleId}) : super(id: projectBundleId);
|
||||||
|
|
||||||
/// Creates a new [WindowsApp] from a windows sub project.
|
/// Creates a new [WindowsApp] from a windows sub project.
|
||||||
factory WindowsApp.fromWindowsProject(WindowsProject project) {
|
factory WindowsApp.fromWindowsProject(WindowsProject project) {
|
||||||
|
@ -41,7 +37,7 @@ abstract class WindowsApp extends ApplicationPackage {
|
||||||
|
|
||||||
class PrebuiltWindowsApp extends WindowsApp {
|
class PrebuiltWindowsApp extends WindowsApp {
|
||||||
PrebuiltWindowsApp({
|
PrebuiltWindowsApp({
|
||||||
@required String executable,
|
required String executable,
|
||||||
}) : _executable = executable,
|
}) : _executable = executable,
|
||||||
super(projectBundleId: executable);
|
super(projectBundleId: executable);
|
||||||
|
|
||||||
|
@ -56,14 +52,14 @@ class PrebuiltWindowsApp extends WindowsApp {
|
||||||
|
|
||||||
class BuildableWindowsApp extends WindowsApp {
|
class BuildableWindowsApp extends WindowsApp {
|
||||||
BuildableWindowsApp({
|
BuildableWindowsApp({
|
||||||
@required this.project,
|
required this.project,
|
||||||
}) : super(projectBundleId: project.parent.manifest.appName);
|
}) : super(projectBundleId: project.parent.manifest.appName);
|
||||||
|
|
||||||
final WindowsProject project;
|
final WindowsProject project;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String executable(BuildMode buildMode) {
|
String executable(BuildMode buildMode) {
|
||||||
final String binaryName = getCmakeExecutableName(project);
|
final String? binaryName = getCmakeExecutableName(project);
|
||||||
return globals.fs.path.join(
|
return globals.fs.path.join(
|
||||||
getWindowsBuildDirectory(),
|
getWindowsBuildDirectory(),
|
||||||
'runner',
|
'runner',
|
||||||
|
@ -77,12 +73,12 @@ class BuildableWindowsApp extends WindowsApp {
|
||||||
}
|
}
|
||||||
|
|
||||||
class BuildableUwpApp extends ApplicationPackage {
|
class BuildableUwpApp extends ApplicationPackage {
|
||||||
BuildableUwpApp({@required this.project}) : super(id: project.packageGuid);
|
BuildableUwpApp({required this.project}) : super(id: project.packageGuid ?? 'com.example.placeholder');
|
||||||
|
|
||||||
final WindowsUwpProject project;
|
final WindowsUwpProject project;
|
||||||
|
|
||||||
String get projectVersion => project.packageVersion;
|
String? get projectVersion => project.packageVersion;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get name => getCmakeExecutableName(project);
|
String? get name => getCmakeExecutableName(project);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue