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
1c43c4e2
Commit
1c43c4e2
authored
Jan 06, 2017
by
Todd Volkert
Committed by
GitHub
Jan 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump package:file version to 1.0.0 (#7371)
parent
29a88cf8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
29 deletions
+22
-29
transitions_perf_test.dart
...es/flutter_gallery/test_driver/transitions_perf_test.dart
+1
-1
common.dart
packages/flutter_driver/lib/src/common.dart
+2
-1
pubspec.yaml
packages/flutter_driver/pubspec.yaml
+1
-1
file_system.dart
packages/flutter_tools/lib/src/base/file_system.dart
+13
-23
drive.dart
packages/flutter_tools/lib/src/commands/drive.dart
+1
-1
pubspec.yaml
packages/flutter_tools/pubspec.yaml
+1
-1
drive_test.dart
packages/flutter_tools/test/drive_test.dart
+3
-1
No files found.
examples/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
1c43c4e2
...
...
@@ -6,7 +6,7 @@ import 'dart:async';
import
'dart:convert'
show
JsonEncoder
;
import
'package:file/file.dart'
;
import
'package:file/
io
.dart'
;
import
'package:file/
local
.dart'
;
import
'package:flutter_driver/flutter_driver.dart'
;
import
'package:path/path.dart'
as
path
;
import
'package:test/test.dart'
;
...
...
packages/flutter_driver/lib/src/common.dart
View file @
1c43c4e2
...
...
@@ -5,7 +5,8 @@
import
'dart:io'
show
Platform
;
import
'package:file/file.dart'
;
import
'package:file/io.dart'
;
import
'package:file/local.dart'
;
import
'package:file/memory.dart'
;
/// The file system implementation used by this library.
///
...
...
packages/flutter_driver/pubspec.yaml
View file @
1c43c4e2
...
...
@@ -8,7 +8,7 @@ environment:
sdk
:
'
>=1.19.0
<2.0.0'
dependencies
:
file
:
'
^
0.1
.0'
file
:
'
^
1.0
.0'
json_rpc_2
:
'
^2.0.0'
matcher
:
'
>=0.12.0
<1.0.0'
path
:
'
^1.4.0'
...
...
packages/flutter_tools/lib/src/base/file_system.dart
View file @
1c43c4e2
...
...
@@ -4,28 +4,19 @@
import
'dart:io'
as
dart_io
;
import
'package:file/io.dart'
;
import
'package:file/sync_io.dart'
;
import
'package:file/file.dart'
;
import
'package:file/local.dart'
;
import
'package:file/memory.dart'
;
import
'package:path/path.dart'
as
path
;
export
'package:file/
io
.dart'
;
export
'package:file/
sync_io
.dart'
;
export
'package:file/
file
.dart'
;
export
'package:file/
local
.dart'
;
/// Currently active implementation of the file system.
///
/// By default it uses local disk-based implementation. Override this in tests
/// with [MemoryFileSystem].
FileSystem
fs
=
new
LocalFileSystem
();
SyncFileSystem
syncFs
=
new
SyncLocalFileSystem
();
typedef
String
CurrentDirectoryGetter
(
);
final
CurrentDirectoryGetter
_defaultCurrentDirectoryGetter
=
()
{
return
dart_io
.
Directory
.
current
.
path
;
};
/// Points to the current working directory (like `pwd`).
CurrentDirectoryGetter
getCurrentDirectory
=
_defaultCurrentDirectoryGetter
;
/// Exits the process with the given [exitCode].
typedef
void
ExitFunction
(
[
int
exitCode
]);
...
...
@@ -37,20 +28,19 @@ final ExitFunction _defaultExitFunction = ([int exitCode]) {
/// Exits the process.
ExitFunction
exit
=
_defaultExitFunction
;
/// Restores [fs]
and [syncFs]
to the default local disk-based implementation.
/// Restores [fs] to the default local disk-based implementation.
void
restoreFileSystem
(
)
{
fs
=
new
LocalFileSystem
();
syncFs
=
new
SyncLocalFileSystem
();
getCurrentDirectory
=
_defaultCurrentDirectoryGetter
;
exit
=
_defaultExitFunction
;
}
/// Uses in-memory replacments for `dart:io` functionality. Useful in tests.
void
useInMemoryFileSystem
(
{
String
cwd:
'/'
,
ExitFunction
exitFunction
})
{
MemoryFileSystem
memFs
=
new
MemoryFileSystem
();
fs
=
memFs
;
syncFs
=
new
SyncMemoryFileSystem
(
backedBy:
memFs
.
storage
);
getCurrentDirectory
=
()
=>
cwd
;
fs
=
new
MemoryFileSystem
();
if
(!
fs
.
directory
(
cwd
).
existsSync
())
{
fs
.
directory
(
cwd
).
createSync
(
recursive:
true
);
}
fs
.
currentDirectory
=
cwd
;
exit
=
exitFunction
??
([
int
exitCode
])
{
throw
new
Exception
(
'Exited with code
$exitCode
'
);
};
...
...
@@ -60,9 +50,9 @@ void useInMemoryFileSystem({ String cwd: '/', ExitFunction exitFunction }) {
void
ensureDirectoryExists
(
String
filePath
)
{
String
dirPath
=
path
.
dirname
(
filePath
);
if
(
syncFs
.
type
(
dirPath
)
==
FileSystemEntityType
.
DIRECTORY
)
if
(
fs
.
typeSync
(
dirPath
)
==
FileSystemEntityType
.
DIRECTORY
)
return
;
syncFs
.
directory
(
dirPath
).
create
(
recursive:
true
);
fs
.
directory
(
dirPath
).
createSync
(
recursive:
true
);
}
/// Recursively copies a folder from `srcPath` to `destPath`
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
1c43c4e2
...
...
@@ -155,7 +155,7 @@ class DriveCommand extends RunCommandBase {
String
appFile
=
path
.
normalize
(
targetFile
);
// This command extends `flutter start` and therefore CWD == package dir
String
packageDir
=
getCurrentDirectory
()
;
String
packageDir
=
fs
.
currentDirectory
.
path
;
// Make appFile path relative to package directory because we are looking
// for the corresponding test file relative to it.
...
...
packages/flutter_tools/pubspec.yaml
View file @
1c43c4e2
...
...
@@ -12,7 +12,7 @@ dependencies:
args
:
^0.13.4
coverage
:
^0.8.0
crypto
:
'
>=1.1.1
<3.0.0'
file
:
^
0.1
.0
file
:
^
1.0
.0
http
:
^0.11.3
intl
:
'
>=0.14.0
<0.15.0'
json_rpc_2
:
^2.0.0
...
...
packages/flutter_tools/test/drive_test.dart
View file @
1c43c4e2
...
...
@@ -4,7 +4,7 @@
import
'dart:async'
;
import
'package:file/
file
.dart'
;
import
'package:file/
memory
.dart'
;
import
'package:flutter_tools/src/android/android_device.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
...
...
@@ -34,6 +34,8 @@ void main() {
command
=
new
DriveCommand
();
applyMocksToCommand
(
command
);
useInMemoryFileSystem
(
cwd:
'/some/app'
);
fs
.
directory
(
'test'
).
createSync
();
fs
.
directory
(
'test_driver'
).
createSync
();
targetDeviceFinder
=
()
{
throw
'Unexpected call to targetDeviceFinder'
;
};
...
...
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