Support a configurable build directory (#5601)
This change adds a top-level getBuildDirectory func and funcs for android, aot, asset, ios build products. Developers may now add a "build-dir" mapping to their ~/.flutter_settings (JSON format) config file. Output directory is relative to the main flutter application directory. This change also changes the default build directory for iOS builds to a subdirectory of the configured build directory, 'build/ios' by default.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_tools/src/asset.dart';
|
||||
import 'package:flutter_tools/src/build_info.dart';
|
||||
import 'package:flutter_tools/src/devfs.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:test/test.dart';
|
||||
@@ -59,17 +60,20 @@ void main() {
|
||||
});
|
||||
testUsingContext('add file in an asset bundle', () async {
|
||||
await devFS.update(bundle: assetBundle, bundleDirty: true);
|
||||
expect(devFSOperations.contains('writeFile test build/flx/a.txt'), isTrue);
|
||||
expect(devFSOperations.contains(
|
||||
'writeFile test ${getAssetBuildDirectory()}/a.txt'), isTrue);
|
||||
});
|
||||
testUsingContext('add a file to the asset bundle', () async {
|
||||
assetBundle.entries.add(new AssetBundleEntry.fromString('b.txt', ''));
|
||||
await devFS.update(bundle: assetBundle, bundleDirty: true);
|
||||
expect(devFSOperations.contains('writeFile test build/flx/b.txt'), isTrue);
|
||||
expect(devFSOperations.contains(
|
||||
'writeFile test ${getAssetBuildDirectory()}/b.txt'), isTrue);
|
||||
});
|
||||
testUsingContext('delete a file from the asset bundle', () async {
|
||||
assetBundle.entries.clear();
|
||||
await devFS.update(bundle: assetBundle, bundleDirty: true);
|
||||
expect(devFSOperations.contains('deleteFile test build/flx/b.txt'), isTrue);
|
||||
expect(devFSOperations.contains(
|
||||
'deleteFile test ${getAssetBuildDirectory()}/b.txt'), isTrue);
|
||||
});
|
||||
testUsingContext('delete dev file system', () async {
|
||||
await devFS.destroy();
|
||||
|
||||
Reference in New Issue
Block a user