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
8a2ee2c0
Commit
8a2ee2c0
authored
Mar 28, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2960 from abarth/use_packages
Use --packages rather than --package-root
parents
6ffee20b
2e062dfa
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
99 additions
and
61 deletions
+99
-61
engine.version
bin/cache/engine.version
+1
-1
flutter
bin/flutter
+3
-3
flutter.bat
bin/flutter.bat
+2
-2
pubspec.yaml
packages/flutter/pubspec.yaml
+3
-0
artifacts.dart
packages/flutter_tools/lib/src/artifacts.dart
+1
-20
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+3
-2
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+1
-1
package_map.dart
packages/flutter_tools/lib/src/package_map.dart
+42
-0
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+8
-1
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+17
-18
services.dart
packages/flutter_tools/lib/src/services.dart
+9
-5
flutter_platform.dart
packages/flutter_tools/lib/src/test/flutter_platform.dart
+4
-5
toolchain.dart
packages/flutter_tools/lib/src/toolchain.dart
+2
-1
pubspec.yaml
packages/flutter_tools/pubspec.yaml
+2
-1
pubspec.yaml
packages/flx/pubspec.yaml
+1
-1
No files found.
bin/cache/engine.version
View file @
8a2ee2c0
f7909035f11b1347814ea2c2942426ef3cf7f44d
ce3b4547ac579f67a6e473f7f5b5eac4357424ff
bin/flutter
View file @
8a2ee2c0
...
...
@@ -35,7 +35,7 @@ if [ ! -f "$SNAPSHOT_PATH" ] || [ ! -f "$STAMP_PATH" ] || [ `cat "$STAMP_PATH"`
echo
Building flutter tool...
FLUTTER_DIR
=
"
$FLUTTER_ROOT
/packages/flutter"
(
cd
"
$FLUTTER_TOOLS_DIR
"
;
"../../bin/cache/dart-sdk/bin/pub"
get
--verbosity
=
warning
)
"
$DART
"
--snapshot
=
"
$SNAPSHOT_PATH
"
--package
-root
=
"
$FLUTTER_TOOLS_DIR
/
packages"
"
$SCRIPT_PATH
"
"
$DART
"
--snapshot
=
"
$SNAPSHOT_PATH
"
--package
s
=
"
$FLUTTER_TOOLS_DIR
/.
packages"
"
$SCRIPT_PATH
"
echo
$REVISION
>
"
$STAMP_PATH
"
fi
...
...
@@ -51,7 +51,7 @@ set +e
if
[
$FLUTTER_DEV
]
;
then
echo
-e
"(FLUTTER_DEV set - ignoring
$SNAPSHOT_PATH
)
\n
"
"
$DART
"
--package
-root
=
"
$FLUTTER_TOOLS_DIR
/
packages"
"
$SCRIPT_PATH
"
"
$@
"
"
$DART
"
--package
s
=
"
$FLUTTER_TOOLS_DIR
/.
packages"
"
$SCRIPT_PATH
"
"
$@
"
else
"
$DART
"
"
$SNAPSHOT_PATH
"
"
$@
"
fi
...
...
@@ -65,5 +65,5 @@ fi
set
-e
"
$DART
"
--snapshot
=
"
$SNAPSHOT_PATH
"
--package
-root
=
"
$FLUTTER_TOOLS_DIR
/
packages"
"
$SCRIPT_PATH
"
"
$DART
"
--snapshot
=
"
$SNAPSHOT_PATH
"
--package
=
"
$FLUTTER_TOOLS_DIR
/.
packages"
"
$SCRIPT_PATH
"
"
$DART
"
"
$SNAPSHOT_PATH
"
"
$@
"
bin/flutter.bat
View file @
8a2ee2c0
...
...
@@ -38,7 +38,7 @@ CD "%flutter_dir"
REM Allows us to check if sky_engine's REVISION is correct
CALL pub.bat get
CD "%flutter_root%"
CALL %dart% --snapshot="%snapshot_path%" --package
-root="%flutter_tools_dir%\
packages" "%script_path%"
CALL %dart% --snapshot="%snapshot_path%" --package
s="%flutter_tools_dir%\.
packages" "%script_path%"
<nul SET /p=%revision%> "%stamp_path%"
:after_snapshot
...
...
@@ -48,6 +48,6 @@ POPD
CALL %dart% "%snapshot_path%" %*
IF /I "%ERRORLEVEL%" EQU "253" (
CALL %dart% --snapshot="%snapshot_path%" --package
-root="%flutter_tools_dir%\
packages" "%script_path%"
CALL %dart% --snapshot="%snapshot_path%" --package
s="%flutter_tools_dir%\.
packages" "%script_path%"
CALL %dart% "%snapshot_path%" %*
)
packages/flutter/pubspec.yaml
View file @
8a2ee2c0
...
...
@@ -9,6 +9,9 @@ dependencies:
intl
:
'
>=0.12.4+2
<0.13.0'
vector_math
:
'
>=1.4.5
<2.0.0'
# We need to pin crypto because archive can't handle larger numbers.
crypto
:
0.9.2
sky_engine
:
path
:
../../bin/cache/pkg/sky_engine
sky_services
:
...
...
packages/flutter_tools/lib/src/artifacts.dart
View file @
8a2ee2c0
...
...
@@ -165,27 +165,8 @@ class ArtifactStore {
return
null
;
}
//
These values are i
nitialized by FlutterCommandRunner on startup.
//
I
nitialized by FlutterCommandRunner on startup.
static
String
flutterRoot
;
static
String
packageRoot
=
'packages'
;
static
bool
get
isPackageRootValid
{
return
FileSystemEntity
.
isDirectorySync
(
packageRoot
);
}
static
void
ensurePackageRootIsValid
()
{
if
(!
isPackageRootValid
)
{
String
message
=
'
$packageRoot
is not a valid directory.'
;
if
(
packageRoot
==
'packages'
)
{
if
(
FileSystemEntity
.
isFileSync
(
'pubspec.yaml'
))
message
+=
'
\n
Did you run `pub get` in this directory?'
;
else
message
+=
'
\n
Did you run this command from the same directory as your pubspec.yaml file?'
;
}
printError
(
message
);
throw
new
ProcessExit
(
2
);
}
}
static
String
_engineRevision
;
...
...
packages/flutter_tools/lib/src/commands/test.dart
View file @
8a2ee2c0
...
...
@@ -11,6 +11,7 @@ import 'package:test/src/executable.dart' as executable; // ignore: implementati
import
'../artifacts.dart'
;
import
'../build_configuration.dart'
;
import
'../globals.dart'
;
import
'../package_map.dart'
;
import
'../runner/flutter_command.dart'
;
import
'../test/flutter_platform.dart'
as
loader
;
...
...
@@ -99,8 +100,8 @@ class TestCommand extends FlutterCommand {
// If we're running the flutter tests, we want to use the packages directory
// from the flutter package in order to find the proper shell binary.
if
(
runFlutterTests
&&
ArtifactStore
.
packageRoot
==
'packages'
)
ArtifactStore
.
packageRoot
=
path
.
join
(
ArtifactStore
.
flutterRoot
,
'packages'
,
'flutter'
,
'packages'
);
if
(
runFlutterTests
)
PackageMap
.
instance
=
new
PackageMap
(
path
.
join
(
ArtifactStore
.
flutterRoot
,
'packages'
,
'flutter'
,
'.packages'
)
);
Directory
testDir
=
runFlutterTests
?
_flutterUnitTestDir
:
_currentPackageTestDir
;
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
8a2ee2c0
...
...
@@ -467,7 +467,7 @@ class IOSSimulator extends Device {
List
<
String
>
args
=
<
String
>[
"--flx=
${path.absolute(path.join('build', 'app.flx'))}
"
,
"--dart-main=
${path.absolute(mainPath)}
"
,
"--package
-root=
${path.absolute('
packages')}
"
,
"--package
s=
${path.absolute('.
packages')}
"
,
];
if
(
checked
)
...
...
packages/flutter_tools/lib/src/package_map.dart
0 → 100644
View file @
8a2ee2c0
// 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
'dart:io'
;
import
'package:package_config/packages_file.dart'
as
packages_file
;
import
'package:path/path.dart'
as
path
;
const
String
_kPackages
=
'.packages'
;
Map
<
String
,
Uri
>
_parse
(
String
packagesPath
)
{
List
<
int
>
source
=
new
File
(
packagesPath
).
readAsBytesSync
();
return
packages_file
.
parse
(
source
,
new
Uri
.
file
(
packagesPath
));
}
class
PackageMap
{
PackageMap
(
this
.
packagesPath
);
final
String
packagesPath
;
Map
<
String
,
Uri
>
get
map
{
if
(
_map
==
null
)
_map
=
_parse
(
packagesPath
);
return
_map
;
}
Map
<
String
,
Uri
>
_map
;
static
PackageMap
instance
;
String
checkValid
()
{
if
(
FileSystemEntity
.
isFileSync
(
packagesPath
))
return
null
;
String
message
=
'
$packagesPath
does not exist.'
;
String
pubspecPath
=
path
.
absolute
(
path
.
dirname
(
packagesPath
),
'pubspec.yaml'
);
if
(
FileSystemEntity
.
isFileSync
(
pubspecPath
))
message
+=
'
\n
Did you run `pub get` in this directory?'
;
else
message
+=
'
\n
Did you run this command from the same directory as your pubspec.yaml file?'
;
return
message
;
}
}
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
8a2ee2c0
...
...
@@ -7,12 +7,13 @@ import 'dart:io';
import
'package:args/command_runner.dart'
;
import
'../dart/pub.dart'
;
import
'../application_package.dart'
;
import
'../build_configuration.dart'
;
import
'../dart/pub.dart'
;
import
'../device.dart'
;
import
'../flx.dart'
as
flx
;
import
'../globals.dart'
;
import
'../package_map.dart'
;
import
'../toolchain.dart'
;
import
'flutter_command_runner.dart'
;
...
...
@@ -147,6 +148,12 @@ abstract class FlutterCommand extends Command {
}
}
String
error
=
PackageMap
.
instance
.
checkValid
();
if
(
error
!=
null
)
{
printError
(
error
);
return
false
;
}
return
true
;
}
...
...
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
8a2ee2c0
...
...
@@ -9,13 +9,14 @@ import 'package:args/args.dart';
import
'package:args/command_runner.dart'
;
import
'package:path/path.dart'
as
path
;
import
'../android/android_sdk.dart'
;
import
'../artifacts.dart'
;
import
'../android/android_sdk.dart'
;
import
'../base/context.dart'
;
import
'../base/logger.dart'
;
import
'../base/process.dart'
;
import
'../build_configuration.dart'
;
import
'../globals.dart'
;
import
'../package_map.dart'
;
import
'version.dart'
;
const
String
kFlutterRootEnvironmentVariableName
=
'FLUTTER_ROOT'
;
// should point to //flutter/ (root of flutter/flutter repo)
...
...
@@ -41,13 +42,13 @@ class FlutterCommandRunner extends CommandRunner {
help:
'Reports the version of this tool.'
);
String
packagesHelp
;
if
(
ArtifactStore
.
isPackageRootValid
)
packagesHelp
=
'
\n
(defaults to "
${ArtifactStore.packageRoot}
")'
;
if
(
FileSystemEntity
.
isFileSync
(
'.packages'
)
)
packagesHelp
=
'
\n
(defaults to "
.packages
")'
;
else
packagesHelp
=
'
\n
(required, since the current directory does not contain a "
packages" subdirectory
)'
;
argParser
.
addOption
(
'package
-root
'
,
packagesHelp
=
'
\n
(required, since the current directory does not contain a "
.packages" file
)'
;
argParser
.
addOption
(
'package
s
'
,
hide:
!
verboseHelp
,
help:
'Path to your
packages directory
.
$packagesHelp
'
);
help:
'Path to your
".packages" file
.
$packagesHelp
'
);
argParser
.
addOption
(
'flutter-root'
,
help:
'The root directory of the Flutter repository (uses
\$
$kFlutterRootEnvironmentVariableName
if set).'
,
defaultsTo:
_defaultFlutterRoot
);
...
...
@@ -184,8 +185,9 @@ class FlutterCommandRunner extends CommandRunner {
// we must set ArtifactStore.flutterRoot early because other features use it
// (e.g. enginePath's initialiser uses it)
ArtifactStore
.
flutterRoot
=
path
.
normalize
(
path
.
absolute
(
globalResults
[
'flutter-root'
]));
if
(
globalResults
.
wasParsed
(
'package-root'
))
ArtifactStore
.
packageRoot
=
path
.
normalize
(
path
.
absolute
(
globalResults
[
'package-root'
]));
PackageMap
.
instance
=
new
PackageMap
(
path
.
normalize
(
path
.
absolute
(
globalResults
.
wasParsed
(
'packages'
)
?
globalResults
[
'packages'
]
:
'.packages'
)));
// See if the user specified a specific device.
deviceManager
.
specifiedDeviceId
=
globalResults
[
'device-id'
];
...
...
@@ -219,16 +221,13 @@ class FlutterCommandRunner extends CommandRunner {
bool
isRelease
=
globalResults
[
'release'
];
if
(
engineSourcePath
==
null
&&
(
isDebug
||
isRelease
))
{
if
(
ArtifactStore
.
isPackageRootValid
)
{
Directory
engineDir
=
new
Directory
(
path
.
join
(
ArtifactStore
.
packageRoot
,
kFlutterEnginePackageName
));
try
{
String
realEnginePath
=
engineDir
.
resolveSymbolicLinksSync
();
engineSourcePath
=
path
.
dirname
(
path
.
dirname
(
path
.
dirname
(
path
.
dirname
(
realEnginePath
))));
bool
dirExists
=
FileSystemEntity
.
isDirectorySync
(
path
.
join
(
engineSourcePath
,
'out'
));
if
(
engineSourcePath
==
'/'
||
engineSourcePath
.
isEmpty
||
!
dirExists
)
engineSourcePath
=
null
;
}
on
FileSystemException
{
}
}
try
{
Uri
engineUri
=
PackageMap
.
instance
.
map
[
kFlutterEnginePackageName
];
engineSourcePath
=
path
.
dirname
(
path
.
dirname
(
path
.
dirname
(
path
.
dirname
(
engineUri
.
path
))));
bool
dirExists
=
FileSystemEntity
.
isDirectorySync
(
path
.
join
(
engineSourcePath
,
'out'
));
if
(
engineSourcePath
==
'/'
||
engineSourcePath
.
isEmpty
||
!
dirExists
)
engineSourcePath
=
null
;
}
on
FileSystemException
{
}
on
FormatException
{
}
if
(
engineSourcePath
==
null
)
engineSourcePath
=
_tryEnginePath
(
path
.
join
(
ArtifactStore
.
flutterRoot
,
'../engine/src'
));
...
...
packages/flutter_tools/lib/src/services.dart
View file @
8a2ee2c0
...
...
@@ -11,6 +11,7 @@ import 'package:yaml/yaml.dart';
import
'artifacts.dart'
;
import
'globals.dart'
;
import
'package_map.dart'
;
const
String
_kFlutterManifestPath
=
'flutter.yaml'
;
const
String
_kFlutterServicesManifestPath
=
'flutter_services.yaml'
;
...
...
@@ -28,22 +29,25 @@ dynamic _loadYamlFile(String path) {
Future
<
Null
>
parseServiceConfigs
(
List
<
Map
<
String
,
String
>>
services
,
{
List
<
File
>
jars
}
)
async
{
if
(!
ArtifactStore
.
isPackageRootValid
)
{
printTrace
(
"Artifact store invalid while parsing service configs"
);
Map
<
String
,
Uri
>
packageMap
;
try
{
packageMap
=
PackageMap
.
instance
.
map
;
}
on
FormatException
catch
(
e
)
{
printTrace
(
'Invalid ".packages" file while parsing service configs:
\n
$e
'
);
return
;
}
dynamic
manifest
=
_loadYamlFile
(
_kFlutterManifestPath
);
if
(
manifest
==
null
||
manifest
[
'services'
]
==
null
)
{
printTrace
(
"No services specified in the manifest"
);
printTrace
(
'No services specified in the manifest'
);
return
;
}
for
(
String
service
in
manifest
[
'services'
])
{
String
serviceRoot
=
'
${ArtifactStore.packageRoot}
/
$service
'
;
String
serviceRoot
=
packageMap
[
service
].
path
;
dynamic
serviceConfig
=
_loadYamlFile
(
'
$serviceRoot
/
$_kFlutterServicesManifestPath
'
);
if
(
serviceConfig
==
null
)
{
printStatus
(
"No
$_kFlutterServicesManifestPath
found for service '
$serviceRoot
'. Skipping."
);
printStatus
(
'No
$_kFlutterServicesManifestPath
found for service "
$serviceRoot
". Skipping.'
);
continue
;
}
...
...
packages/flutter_tools/lib/src/test/flutter_platform.dart
View file @
8a2ee2c0
...
...
@@ -14,7 +14,7 @@ import 'package:test/src/backend/test_platform.dart'; // ignore: implementation_
import
'package:test/src/runner/plugin/platform.dart'
;
// ignore: implementation_imports
import
'package:test/src/runner/plugin/hack_register_platform.dart'
as
hack
;
// ignore: implementation_imports
import
'../
artifacts
.dart'
;
import
'../
package_map
.dart'
;
final
String
_kSkyShell
=
Platform
.
environment
[
'SKY_SHELL'
];
const
String
_kHost
=
'127.0.0.1'
;
...
...
@@ -44,12 +44,12 @@ Future<_ServerInfo> _startServer() async {
return
new
_ServerInfo
(
server
,
'ws://
$_kHost
:
${server.port}$_kPath
'
,
socket
.
future
);
}
Future
<
Process
>
_startProcess
(
String
mainPath
,
{
String
package
Root
})
{
Future
<
Process
>
_startProcess
(
String
mainPath
,
{
String
package
s
})
{
assert
(
shellPath
!=
null
||
_kSkyShell
!=
null
);
// Please provide the path to the shell in the SKY_SHELL environment variable.
return
Process
.
start
(
shellPath
??
_kSkyShell
,
[
'--enable-checked-mode'
,
'--non-interactive'
,
'--package
-root=
$packageRoot
'
,
'--package
s=
$packages
'
,
mainPath
,
]);
}
...
...
@@ -90,8 +90,7 @@ void main() {
'''
);
Process
process
=
await
_startProcess
(
listenerFile
.
path
,
packageRoot:
path
.
absolute
(
ArtifactStore
.
packageRoot
)
listenerFile
.
path
,
packages:
PackageMap
.
instance
.
packagesPath
);
void
finalize
()
{
...
...
packages/flutter_tools/lib/src/toolchain.dart
View file @
8a2ee2c0
...
...
@@ -10,6 +10,7 @@ import 'package:path/path.dart' as path;
import
'artifacts.dart'
;
import
'base/process.dart'
;
import
'build_configuration.dart'
;
import
'package_map.dart'
;
class
SnapshotCompiler
{
SnapshotCompiler
(
this
.
_path
);
...
...
@@ -25,7 +26,7 @@ class SnapshotCompiler {
final
List
<
String
>
args
=
[
_path
,
mainPath
,
'--package
-root=
${ArtifactStore.packageRoot
}
'
,
'--package
s=
${PackageMap.instance.packagesPath
}
'
,
'--snapshot=
$snapshotPath
'
];
if
(
depfilePath
!=
null
)
...
...
packages/flutter_tools/pubspec.yaml
View file @
8a2ee2c0
...
...
@@ -11,11 +11,12 @@ dependencies:
analyzer
:
'
>=0.26.1+17'
# see note below
archive
:
^1.0.20
args
:
^0.13.4
crypto
:
^
0.9.2
crypto
:
0.9.2
den_api
:
^0.1.0
file
:
^0.1.0
json_schema
:
^1.0.3
mustache4dart
:
^1.0.0
package_config
:
^0.1.3
path
:
^1.3.0
pub_semver
:
^1.0.0
stack_trace
:
^1.4.0
...
...
packages/flx/pubspec.yaml
View file @
8a2ee2c0
...
...
@@ -7,7 +7,7 @@ dependencies:
bignum
:
^0.1.0
asn1lib
:
^0.4.1
pointycastle
:
0.10.0
crypto
:
^
0.9.2
crypto
:
0.9.2
environment
:
sdk
:
'
>=1.12.0
<2.0.0'
...
...
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