Revert "[flutter_tools] Allow providing dart-defines to Android, iOS, macOS builds (#51714)" (#52041)

This reverts commit ee60eeea3e.
This commit is contained in:
Jonah Williams
2020-03-05 12:51:42 -08:00
committed by GitHub
parent ee60eeea3e
commit ee476a7bd1
46 changed files with 257 additions and 293 deletions

View File

@@ -1,15 +0,0 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/defines_task.dart';
/// Verify that dart defines work on Android.
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(runDartDefinesTask);
}

View File

@@ -1,15 +0,0 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/defines_task.dart';
/// Verify that dart defines work on iOS.
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(runDartDefinesTask);
}

View File

@@ -1,30 +0,0 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'dart:io';
import '../framework/adb.dart';
import '../framework/framework.dart';
import '../framework/utils.dart';
Future<TaskResult> runDartDefinesTask() async {
final Device device = await devices.workingDevice;
await device.unlock();
final String deviceId = device.deviceId;
final Directory testDirectory = dir('${flutterDirectory.path}/dev/integration_tests/ui');
await inDirectory<void>(testDirectory, () async {
await flutter('packages', options: <String>['get']);
await flutter('drive', options: <String>[
'--verbose',
'-d',
deviceId,
'--dart-define=test.value=ExampleValue',
'lib/defines.dart',
]);
});
return TaskResult.success(<String, dynamic>{});
}

View File

@@ -323,13 +323,6 @@ tasks:
stage: devicelab
required_agent_capabilities: ["mac/android"]
android_defines_test:
description: >
Builds an APK with a --dart-define and verifies it can be used as a constant
stage: devicelab
flaky: true
required_agent_capabilities: ["linux/android"]
android_obfuscate_test:
description: >
Builds an obfuscated APK and verifies a dart identifier cannot be found
@@ -407,13 +400,6 @@ tasks:
# iOS on-device tests
ios_defines_test:
description: >
Builds a Framework with a --dart-define and verifies it can be used as a constant
stage: devicelab
flaky: true
required_agent_capabilities: ["mac/ios"]
ios_content_validation_test:
description: >
Builds an obfuscated app and verifies contents and structure

View File

@@ -1,19 +0,0 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/widgets.dart';
import 'package:flutter_driver/driver_extension.dart';
/// This application displays text passed through a --dart-define.
void main() {
enableFlutterDriverExtension();
runApp(
const Center(
child: Text(
String.fromEnvironment('test.value'),
textDirection: TextDirection.ltr,
),
),
);
}

View File

@@ -1,22 +0,0 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
void main() {
FlutterDriver driver;
setUpAll(() async {
driver = await FlutterDriver.connect();
});
tearDownAll(() async {
await driver.close();
});
test('Can run with --dart-deinfe', () async {
await driver.waitFor(find.text('ExampleValue'));
});
}