Commit de8d11e7 authored by Devon Carew's avatar Devon Carew

rename the apk/ directory to android/

parent f38d94e8
......@@ -60,11 +60,6 @@ Future main(List<String> args) async {
..addCommand(new UpgradeCommand());
return Chain.capture(() async {
// Convert `flutter init` invocations to `flutter create` ones.
// TODO(devoncarew): Remove this after a few releases.
if (args.isNotEmpty && args[0] == 'init')
args[0] = 'create';
// Initialize globals.
context[Logger] = new StdoutLogger();
context[DeviceManager] = new DeviceManager();
......
......@@ -34,7 +34,7 @@ class AndroidApk extends ApplicationPackage {
static const String _defaultName = 'SkyShell.apk';
static const String _defaultId = 'org.domokit.sky.shell';
static const String _defaultLaunchActivity = '$_defaultId/$_defaultId.SkyActivity';
static const String _defaultManifestPath = 'apk/AndroidManifest.xml';
static const String _defaultManifestPath = 'android/AndroidManifest.xml';
static const String _defaultOutputPath = 'build/app.apk';
/// The path to the activity that should be launched.
......
......@@ -21,9 +21,9 @@ import '../services.dart';
import '../toolchain.dart';
import 'start.dart';
const String _kDefaultAndroidManifestPath = 'apk/AndroidManifest.xml';
const String _kDefaultAndroidManifestPath = 'android/AndroidManifest.xml';
const String _kDefaultOutputPath = 'build/app.apk';
const String _kDefaultResourcesPath = 'apk/res';
const String _kDefaultResourcesPath = 'android/res';
const String _kFlutterManifestPath = 'flutter.yaml';
const String _kPackagesStatusPath = '.packages';
......@@ -264,9 +264,9 @@ Future<_ApkComponents> _findApkComponents(
printError('and version $_kBuildToolsVersion of the build tools.');
return null;
}
for (File f in [components.manifest, components.icuData,
components.libSkyShell, components.debugKeystore]
..addAll(components.jars)) {
for (File f in [
components.manifest, components.icuData, components.libSkyShell, components.debugKeystore
]..addAll(components.jars)) {
if (!f.existsSync()) {
printError('Can not locate file: ${f.path}');
return null;
......@@ -299,8 +299,10 @@ int _buildApk(
artifactBuilder.add(components.libSkyShell, 'lib/armeabi-v7a/libsky_shell.so');
File unalignedApk = new File('${tempDir.path}/app.apk.unaligned');
builder.package(unalignedApk, components.manifest, assetBuilder.directory,
artifactBuilder.directory, components.resources);
builder.package(
unalignedApk, components.manifest, assetBuilder.directory,
artifactBuilder.directory, components.resources
);
int signResult = _signApk(builder, components, unalignedApk, keystore);
if (signResult != 0)
......@@ -389,7 +391,7 @@ Future<int> buildAndroid({
}
BuildConfiguration config = configs.firstWhere(
(BuildConfiguration bc) => bc.targetPlatform == TargetPlatform.android
(BuildConfiguration bc) => bc.targetPlatform == TargetPlatform.android
);
_ApkComponents components = await _findApkComponents(config, enginePath, manifest, resources);
if (components == null) {
......@@ -422,6 +424,7 @@ Future<int> buildAndroid({
}
// TODO(mpcomplete): move this to Device?
/// This is currently Android specific.
Future buildAll(
DeviceStore devices,
ApplicationPackageStore applicationPackages,
......@@ -437,6 +440,14 @@ Future buildAll(
// TODO(mpcomplete): Temporary hack. We only support the apk builder atm.
if (package == applicationPackages.android) {
// TODO(devoncarew): Remove this warning after a few releases.
if (FileSystemEntity.isDirectorySync('apk') && !FileSystemEntity.isDirectorySync('android')) {
// Tell people the android directory location changed.
printStatus(
"Warning: Flutter now looks for Android resources in the android/ directory; "
"consider renaming your 'apk/' directory to 'android/'.");
}
if (!FileSystemEntity.isFileSync(_kDefaultAndroidManifestPath)) {
printStatus('Using pre-built SkyShell.apk.');
continue;
......
......@@ -145,7 +145,7 @@ class FlutterSimpleTemplate extends Template {
files['flutter.yaml'] = _flutterYaml;
files['pubspec.yaml'] = _pubspec;
files['README.md'] = _readme;
files['apk/AndroidManifest.xml'] = _apkManifest;
files['android/AndroidManifest.xml'] = _apkManifest;
files['lib/main.dart'] = _libMain;
}
}
......
......@@ -145,7 +145,8 @@ Future<int> startApp(
await buildAll(
devices, applicationPackages, toolchain, configs,
enginePath: enginePath,
target: target);
target: target
);
}
if (stop) {
......
......@@ -13,8 +13,8 @@ import 'package:flx/signing.dart';
import 'package:path/path.dart' as path;
import 'package:yaml/yaml.dart';
import 'base/globals.dart';
import 'base/file_system.dart';
import 'base/globals.dart';
import 'toolchain.dart';
const String defaultMainPath = 'lib/main.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