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