Commit 57d6e851 authored by Collin Jackson's avatar Collin Jackson

Merge pull request #3701 from collinjackson/assets

Support for putting assets in android/assets folder (like ios/Resources)
parents 4b401a3e 80ef8142
......@@ -26,6 +26,7 @@ export '../android/android_device.dart' show AndroidDevice;
const String _kDefaultAndroidManifestPath = 'android/AndroidManifest.xml';
const String _kDefaultOutputPath = 'build/app.apk';
const String _kDefaultResourcesPath = 'android/res';
const String _kDefaultAssetsPath = 'android/assets';
const String _kFlutterManifestPath = 'flutter.yaml';
const String _kPackagesStatusPath = '.packages';
......@@ -226,6 +227,16 @@ class BuildApkCommand extends FlutterCommand {
extraFiles[keyValue.first] = new File(keyValue.last);
}
if (FileSystemEntity.isDirectorySync(_kDefaultAssetsPath)) {
Directory assetsDir = new Directory(_kDefaultAssetsPath);
for (FileSystemEntity entity in assetsDir.listSync(recursive: true)) {
if (entity is File) {
String targetPath = entity.path.substring(assetsDir.path.length);
extraFiles["assets/$targetPath"] = entity;
}
};
}
// TODO(devoncarew): This command should take an arg for the output type (arm / x64).
return await buildAndroid(
......
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