Unverified Commit bd935e5d authored by 嘟囔's avatar 嘟囔 Committed by GitHub

feat: migrate test_data/project.dart to null safety (#92646)

parent 125545da
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import '../test_utils.dart';
import 'project.dart';
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'project.dart';
class BasicProject extends Project {
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import '../../src/common.dart';
import 'deferred_components_config.dart';
import 'project.dart';
......@@ -84,7 +82,7 @@ class BasicDeferredComponentsConfig extends DeferredComponentsConfig {
''';
@override
String get deferredComponentsGolden => r'''
String? get deferredComponentsGolden => r'''
loading-units:
- id: 2
libraries:
......@@ -604,7 +602,7 @@ class NoAndroidDynamicFeatureModuleDeferredComponentsConfig extends BasicDeferre
/// Missing golden
class NoGoldenDeferredComponentsConfig extends BasicDeferredComponentsConfig {
@override
String get deferredComponentsGolden => null;
String? get deferredComponentsGolden => null;
}
/// Missing golden
......
......@@ -2,10 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:file/file.dart';
import 'package:meta/meta.dart';
import '../test_utils.dart';
import 'project.dart';
......@@ -750,8 +747,8 @@ void main() {
''';
String l10nYaml({
@required bool useDeferredLoading,
@required bool useSyntheticPackage,
required bool useDeferredLoading,
required bool useSyntheticPackage,
}) {
String l10nYamlString = '';
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import '../test_utils.dart';
import 'project.dart';
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import '../test_utils.dart';
import 'project.dart';
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import '../test_utils.dart';
import 'project.dart';
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:file/file.dart';
import '../../src/common.dart';
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:file/file.dart';
import '../test_utils.dart';
......@@ -21,31 +19,32 @@ const String _kDefaultHtml = '''
''';
abstract class Project {
Directory dir;
late Directory dir;
String get pubspec;
String get main;
String get test => null;
String get generatedFile => null;
DeferredComponentsConfig get deferredComponents => null;
String? get main => null;
String? get test => null;
String? get generatedFile => null;
DeferredComponentsConfig? get deferredComponents => null;
Uri get mainDart => Uri.parse('package:test/main.dart');
Future<void> setUpIn(Directory dir) async {
this.dir = dir;
writeFile(fileSystem.path.join(dir.path, 'pubspec.yaml'), pubspec);
final String? main = this.main;
if (main != null) {
writeFile(fileSystem.path.join(dir.path, 'lib', 'main.dart'), main);
}
final String? test = this.test;
if (test != null) {
writeFile(fileSystem.path.join(dir.path, 'test', 'test.dart'), test);
}
final String? generatedFile = this.generatedFile;
if (generatedFile != null) {
writeFile(fileSystem.path.join(dir.path, '.dart_tool', 'flutter_gen', 'flutter_gen.dart'), generatedFile);
}
if (deferredComponents != null) {
deferredComponents.setUpIn(dir);
}
deferredComponents?.setUpIn(dir);
writeFile(fileSystem.path.join(dir.path, 'web', 'index.html'), _kDefaultHtml);
writePackages(dir.path);
await getPackages(dir.path);
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'project.dart';
class ProjectWithEarlyError extends Project {
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import '../test_utils.dart';
import 'project.dart';
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import '../test_utils.dart';
import 'project.dart';
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'project.dart';
class SteppingProject extends Project {
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'project.dart';
class TestProject extends Project {
......
......@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:file/file.dart';
import 'package:flutter_tools/src/base/file_system.dart';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment