Look for APKs at the path used by Android Gradle plugin 3.0 (#10798)
Fixes https://github.com/flutter/flutter/issues/10630
This commit is contained in:
34
packages/flutter_tools/test/android/gradle_test.dart
Normal file
34
packages/flutter_tools/test/android/gradle_test.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
// Copyright 2017 The Chromium 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:file/file.dart';
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:flutter_tools/src/android/gradle.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import '../src/context.dart';
|
||||
|
||||
const String _kBuildDirectory = '/build/app/outputs';
|
||||
|
||||
void main() {
|
||||
FileSystem fs;
|
||||
|
||||
setUp(() {
|
||||
fs = new MemoryFileSystem();
|
||||
fs.directory('$_kBuildDirectory/release').createSync(recursive: true);
|
||||
fs.file('$_kBuildDirectory/app-debug.apk').createSync();
|
||||
fs.file('$_kBuildDirectory/release/app-release.apk').createSync();
|
||||
});
|
||||
|
||||
group('gradle', () {
|
||||
testUsingContext('findApkFile', () {
|
||||
expect(findApkFile(_kBuildDirectory, 'debug').path,
|
||||
'/build/app/outputs/app-debug.apk');
|
||||
expect(findApkFile(_kBuildDirectory, 'release').path,
|
||||
'/build/app/outputs/release/app-release.apk');
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user