Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
1686b6d5
Unverified
Commit
1686b6d5
authored
Feb 16, 2018
by
Todd Volkert
Committed by
GitHub
Feb 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove fixed asset bundles - they're no longer used. (#14729)
parent
fe00598a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1 addition
and
92 deletions
+1
-92
asset.dart
packages/flutter_tools/lib/src/asset.dart
+0
-24
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+0
-2
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+0
-5
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+1
-5
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+0
-2
asset_bundle_test.dart
packages/flutter_tools/test/asset_bundle_test.dart
+0
-54
No files found.
packages/flutter_tools/lib/src/asset.dart
View file @
1686b6d5
...
...
@@ -30,9 +30,6 @@ abstract class AssetBundleFactory {
}
abstract
class
AssetBundle
{
factory
AssetBundle
.
fixed
(
String
projectRoot
,
String
projectAssets
)
=>
new
_ManifestAssetBundle
.
fixed
(
projectRoot
,
projectAssets
);
Map
<
String
,
DevFSContent
>
get
entries
;
bool
wasBuiltOnce
();
...
...
@@ -66,38 +63,17 @@ class _ManifestAssetBundle implements AssetBundle {
static
const
String
_kFontSetMaterial
=
'material'
;
static
const
String
_kLICENSE
=
'LICENSE'
;
bool
_fixed
=
false
;
DateTime
_lastBuildTimestamp
;
/// Constructs an [_ManifestAssetBundle] that gathers the set of assets from the
/// pubspec.yaml manifest.
_ManifestAssetBundle
();
/// Constructs an [_ManifestAssetBundle] with a fixed set of assets.
/// [projectRoot] The absolute path to the project root.
/// [projectAssets] comma separated list of assets.
_ManifestAssetBundle
.
fixed
(
String
projectRoot
,
String
projectAssets
)
{
_fixed
=
true
;
if
((
projectRoot
==
null
)
||
(
projectAssets
==
null
))
return
;
final
List
<
String
>
assets
=
projectAssets
.
split
(
','
);
for
(
String
asset
in
assets
)
{
if
(
asset
==
''
)
continue
;
final
String
assetPath
=
fs
.
path
.
join
(
projectRoot
,
asset
);
final
String
archivePath
=
asset
;
entries
[
archivePath
]
=
new
DevFSFileContent
(
fs
.
file
(
assetPath
));
}
}
@override
bool
wasBuiltOnce
()
=>
_lastBuildTimestamp
!=
null
;
@override
bool
needsBuild
({
String
manifestPath:
defaultManifestPath
})
{
if
(
_fixed
)
return
false
;
if
(
_lastBuildTimestamp
==
null
)
return
true
;
...
...
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
1686b6d5
...
...
@@ -350,7 +350,6 @@ class AppDomain extends Domain {
bool
previewDart2:
false
,
String
projectRootPath
,
String
packagesFilePath
,
String
projectAssets
,
bool
ipv6:
false
,
})
async
{
if
(
await
device
.
isLocalEmulator
&&
!
options
.
buildInfo
.
supportsEmulator
)
{
...
...
@@ -375,7 +374,6 @@ class AppDomain extends Domain {
previewDart2:
previewDart2
,
projectRootPath:
projectRootPath
,
packagesFilePath:
packagesFilePath
,
projectAssets:
projectAssets
,
ipv6:
ipv6
,
hostIsIde:
true
,
);
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
1686b6d5
...
...
@@ -116,9 +116,6 @@ class RunCommand extends RunCommandBase {
argParser
.
addOption
(
'project-root'
,
hide:
!
verboseHelp
,
help:
'Specify the project root directory.'
);
argParser
.
addOption
(
'project-assets'
,
hide:
!
verboseHelp
,
help:
'Specify the project assets relative to the root directory.'
);
argParser
.
addFlag
(
'machine'
,
hide:
!
verboseHelp
,
negatable:
false
,
...
...
@@ -260,7 +257,6 @@ class RunCommand extends RunCommandBase {
previewDart2:
argResults
[
'preview-dart-2'
],
projectRootPath:
argResults
[
'project-root'
],
packagesFilePath:
globalResults
[
'packages'
],
projectAssets:
argResults
[
'project-assets'
],
ipv6:
ipv6
,
);
}
catch
(
error
)
{
...
...
@@ -314,7 +310,6 @@ class RunCommand extends RunCommandBase {
previewDart2:
argResults
[
'preview-dart-2'
],
projectRootPath:
argResults
[
'project-root'
],
packagesFilePath:
globalResults
[
'packages'
],
projectAssets:
argResults
[
'project-assets'
],
stayResident:
stayResident
,
ipv6:
ipv6
,
);
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
1686b6d5
...
...
@@ -413,7 +413,6 @@ abstract class ResidentRunner {
this
.
usesTerminalUI
:
true
,
String
projectRootPath
,
String
packagesFilePath
,
String
projectAssets
,
this
.
stayResident
,
this
.
ipv6
,
})
{
...
...
@@ -421,10 +420,7 @@ abstract class ResidentRunner {
_projectRootPath
=
projectRootPath
??
fs
.
currentDirectory
.
path
;
_packagesFilePath
=
packagesFilePath
??
fs
.
path
.
absolute
(
PackageMap
.
globalPackagesPath
);
if
(
projectAssets
!=
null
)
_assetBundle
=
new
AssetBundle
.
fixed
(
_projectRootPath
,
projectAssets
);
else
_assetBundle
=
AssetBundleFactory
.
instance
.
createBundle
();
_assetBundle
=
AssetBundleFactory
.
instance
.
createBundle
();
}
final
List
<
FlutterDevice
>
flutterDevices
;
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
1686b6d5
...
...
@@ -43,7 +43,6 @@ class HotRunner extends ResidentRunner {
this
.
hostIsIde
:
false
,
String
projectRootPath
,
String
packagesFilePath
,
String
projectAssets
,
bool
stayResident:
true
,
bool
ipv6:
false
,
})
:
super
(
devices
,
...
...
@@ -52,7 +51,6 @@ class HotRunner extends ResidentRunner {
usesTerminalUI:
usesTerminalUI
,
projectRootPath:
projectRootPath
,
packagesFilePath:
packagesFilePath
,
projectAssets:
projectAssets
,
stayResident:
stayResident
,
ipv6:
ipv6
);
...
...
packages/flutter_tools/test/asset_bundle_test.dart
View file @
1686b6d5
...
...
@@ -9,7 +9,6 @@ import 'package:file/file.dart';
import
'package:flutter_tools/src/asset.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/devfs.dart'
;
import
'package:test/test.dart'
;
...
...
@@ -21,59 +20,6 @@ void main() {
Cache
.
flutterRoot
=
getFlutterRoot
();
});
// Fixed asset bundle tests.
group
(
'AssetBundle.fixed'
,
()
{
test
(
'empty strings'
,
()
async
{
expect
(
new
AssetBundle
.
fixed
(
null
,
null
),
isNotNull
);
expect
(
new
AssetBundle
.
fixed
(
''
,
''
),
isNotNull
);
expect
(
new
AssetBundle
.
fixed
(
null
,
null
).
entries
,
isEmpty
);
});
test
(
'does not need a rebuild'
,
()
async
{
expect
(
new
AssetBundle
.
fixed
(
null
,
null
).
needsBuild
(),
isFalse
);
});
test
(
'empty string'
,
()
async
{
final
AssetBundle
ab
=
new
AssetBundle
.
fixed
(
''
,
''
);
expect
(
ab
.
entries
,
isEmpty
);
});
test
(
'single entry'
,
()
async
{
final
AssetBundle
ab
=
new
AssetBundle
.
fixed
(
''
,
'apple.txt'
);
expect
(
ab
.
entries
,
isNotEmpty
);
expect
(
ab
.
entries
.
length
,
1
);
final
String
archivePath
=
ab
.
entries
.
keys
.
first
;
expect
(
archivePath
,
isNotNull
);
expect
(
archivePath
,
'apple.txt'
);
});
test
(
'two entries'
,
()
async
{
final
AssetBundle
ab
=
new
AssetBundle
.
fixed
(
''
,
'apple.txt,packages/flutter_gallery_assets/shrine/products/heels.png'
);
expect
(
ab
.
entries
,
isNotEmpty
);
expect
(
ab
.
entries
.
length
,
2
);
final
List
<
String
>
archivePaths
=
ab
.
entries
.
keys
.
toList
()..
sort
();
expect
(
archivePaths
[
0
],
'apple.txt'
);
expect
(
archivePaths
[
1
],
'packages/flutter_gallery_assets/shrine/products/heels.png'
);
});
testUsingContext
(
'file contents'
,
()
async
{
// Create a temporary directory and write a single file into it.
final
Directory
tempDir
=
fs
.
systemTempDirectory
.
createTempSync
();
final
String
projectRoot
=
tempDir
.
path
;
const
String
assetPath
=
'banana.txt'
;
const
String
assetContents
=
'banana'
;
final
File
tempFile
=
fs
.
file
(
fs
.
path
.
join
(
projectRoot
,
assetPath
));
tempFile
.
parent
.
createSync
(
recursive:
true
);
tempFile
.
writeAsBytesSync
(
UTF8
.
encode
(
assetContents
));
final
AssetBundle
ab
=
new
AssetBundle
.
fixed
(
projectRoot
,
assetPath
);
expect
(
ab
.
entries
,
isNotEmpty
);
expect
(
ab
.
entries
.
length
,
1
);
final
String
archivePath
=
ab
.
entries
.
keys
.
first
;
final
DevFSContent
content
=
ab
.
entries
[
archivePath
];
expect
(
archivePath
,
assetPath
);
expect
(
assetContents
,
UTF8
.
decode
(
await
content
.
contentsAsBytes
()));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
const
LocalFileSystem
(),
});
});
group
(
'AssetBundle.build'
,
()
{
// These tests do not use a memory file system because we want to ensure that
// asset bundles work correctly on Windows and Posix systems.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment