diff --git a/packages/flutter/BUILD.gn b/packages/flutter/BUILD.gn new file mode 100644 index 00000000000..b956764340f --- /dev/null +++ b/packages/flutter/BUILD.gn @@ -0,0 +1,20 @@ +# Copyright 2016 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("//build/dart/dart_package.gni") + +dart_package("flutter") { + package_name = "flutter" + + source_dir = "lib" + + deps = [ + "//third_party/dart-pkg/pub/async", + "//third_party/dart-pkg/pub/collection", + "//third_party/dart-pkg/pub/http_parser", + "//third_party/dart-pkg/pub/intl", + "//third_party/dart-pkg/pub/meta", + "//third_party/dart-pkg/pub/vector_math", + ] +} diff --git a/packages/flutter_tools/bin/fuchsia_builder.dart b/packages/flutter_tools/bin/fuchsia_builder.dart index 3eca9afc66c..ccebe47b25f 100644 --- a/packages/flutter_tools/bin/fuchsia_builder.dart +++ b/packages/flutter_tools/bin/fuchsia_builder.dart @@ -9,6 +9,7 @@ import 'package:args/args.dart'; import '../lib/src/base/context.dart'; import '../lib/src/base/logger.dart'; +import '../lib/src/cache.dart'; import '../lib/src/flx.dart'; import '../lib/src/globals.dart'; @@ -48,6 +49,7 @@ Future main(List args) async { printError('Missing option! All options must be specified.'); exit(1); } + Cache.flutterRoot = Platform.environment['FLUTTER_ROOT']; String outputPath = argResults[_kOptionOutput]; final int buildResult = await build( snapshotterPath: argResults[_kOptionSnapshotter], diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart index 19331bea804..21fd0a96580 100644 --- a/packages/flutter_tools/lib/src/asset.dart +++ b/packages/flutter_tools/lib/src/asset.dart @@ -68,10 +68,12 @@ class AssetBundle { Future build({ String manifestPath: defaultManifestPath, String workingDirPath, + String packagesPath, bool includeRobotoFonts: true, bool reportLicensedPackages: false }) async { workingDirPath ??= getAssetBuildDirectory(); + packagesPath ??= path.absolute(PackageMap.globalPackagesPath); Object manifest = _loadFlutterYamlManifest(manifestPath); if (manifest == null) { // No manifest file found for this application. @@ -88,8 +90,7 @@ class AssetBundle { _lastBuildTimestamp = new DateTime.now(); - final PackageMap packageMap = - new PackageMap(path.join(assetBasePath, '.packages')); + final PackageMap packageMap = new PackageMap(packagesPath); Map<_Asset, List<_Asset>> assetVariants = _parseAssets( packageMap, diff --git a/packages/flutter_tools/lib/src/flx.dart b/packages/flutter_tools/lib/src/flx.dart index c159c55c979..b0ced7bac53 100644 --- a/packages/flutter_tools/lib/src/flx.dart +++ b/packages/flutter_tools/lib/src/flx.dart @@ -118,6 +118,7 @@ Future build({ outputPath: outputPath, privateKeyPath: privateKeyPath, workingDirPath: workingDirPath, + packagesPath: packagesPath, includeRobotoFonts: includeRobotoFonts, reportLicensedPackages: reportLicensedPackages ); @@ -129,11 +130,13 @@ Future assemble({ String outputPath, String privateKeyPath: defaultPrivateKeyPath, String workingDirPath, + String packagesPath, bool includeRobotoFonts: true, bool reportLicensedPackages: false }) async { outputPath ??= defaultFlxOutputPath; workingDirPath ??= getAssetBuildDirectory(); + packagesPath ??= path.absolute(PackageMap.globalPackagesPath); printTrace('Building $outputPath'); // Build the asset bundle. @@ -141,6 +144,7 @@ Future assemble({ int result = await assetBundle.build( manifestPath: manifestPath, workingDirPath: workingDirPath, + packagesPath: packagesPath, includeRobotoFonts: includeRobotoFonts, reportLicensedPackages: reportLicensedPackages );