blob: 1465891936b21d8062e66321af48f399dff7ec14 [file] [log] [blame]
// 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 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/utils.dart';
import 'package:path/path.dart' as path;
/// Tests that apps can be built using the deprecated `android/settings.gradle` file.
/// This test should be removed once apps have been migrated to this new file.
// TODO(egarciad): Migrate existing files,
Future<void> main() async {
await task(() async {
section('Find Java');
final String javaHome = await findJavaHome();
if (javaHome == null)
return TaskResult.failure('Could not find Java');
print('\nUsing JAVA_HOME=$javaHome');
final Directory projectDirectory =
try {
section('Build debug APK using deprecated settings.gradle');
await inDirectory(projectDirectory, () async {
await flutter(
options: <String>[
'--target-platform', 'android-arm',
final File debugApk = File(path.join(
if (!exists(debugApk)) {
return TaskResult.failure('Failed to build debug APK.');
return TaskResult.success(null);
} catch (e) {
return TaskResult.failure(e.toString());