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
cff7dc54
Commit
cff7dc54
authored
Feb 11, 2017
by
Michael Goderbauer
Committed by
GitHub
Feb 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump package:process version (#8073)
parent
fe0b9093
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
55 deletions
+33
-55
android_sdk.dart
packages/flutter_tools/lib/src/android/android_sdk.dart
+19
-12
os.dart
packages/flutter_tools/lib/src/base/os.dart
+0
-18
build_aot.dart
packages/flutter_tools/lib/src/commands/build_aot.dart
+6
-3
build_apk.dart
packages/flutter_tools/lib/src/commands/build_apk.dart
+4
-3
format.dart
packages/flutter_tools/lib/src/commands/format.dart
+1
-3
upgrade.dart
packages/flutter_tools/lib/src/commands/upgrade.dart
+1
-2
pubspec.yaml
packages/flutter_tools/pubspec.yaml
+1
-1
context.dart
packages/flutter_tools/test/src/context.dart
+1
-13
No files found.
packages/flutter_tools/lib/src/android/android_sdk.dart
View file @
cff7dc54
...
...
@@ -10,6 +10,7 @@ import '../base/context.dart';
import
'../base/file_system.dart'
;
import
'../base/os.dart'
;
import
'../base/platform.dart'
;
import
'../base/process_manager.dart'
;
import
'../globals.dart'
;
AndroidSdk
get
androidSdk
=>
context
[
AndroidSdk
];
...
...
@@ -120,7 +121,7 @@ class AndroidSdk {
/// Validate the Android SDK. This returns an empty list if there are no
/// issues; otherwise, it returns a list of issues found.
List
<
String
>
validateSdkWellFormed
()
{
if
(!
fs
.
isFileSync
(
adbPath
))
if
(!
processManager
.
canRun
(
adbPath
))
return
<
String
>[
'Android SDK file not found:
$adbPath
.'
];
if
(
sdkVersions
.
isEmpty
||
latestVersion
==
null
)
...
...
@@ -130,7 +131,7 @@ class AndroidSdk {
}
String
getPlatformToolsPath
(
String
binaryName
)
{
return
path
.
join
(
directory
,
'platform-tools'
,
os
.
getExecutableName
(
binaryName
)
);
return
path
.
join
(
directory
,
'platform-tools'
,
binaryName
);
}
void
_init
()
{
...
...
@@ -221,7 +222,7 @@ class AndroidSdkVersion implements Comparable<AndroidSdkVersion> {
String
get
aaptPath
=>
getBuildToolsPath
(
'aapt'
);
String
get
dxPath
=>
getBuildToolsPath
(
'dx'
,
winExtension:
'bat'
);
String
get
dxPath
=>
getBuildToolsPath
(
'dx'
);
String
get
zipalignPath
=>
getBuildToolsPath
(
'zipalign'
);
...
...
@@ -229,24 +230,24 @@ class AndroidSdkVersion implements Comparable<AndroidSdkVersion> {
if
(
_exists
(
androidJarPath
)
!=
null
)
return
<
String
>[
_exists
(
androidJarPath
)];
if
(
_
exists
(
aaptPath
)
!=
null
)
return
<
String
>[
_
exists
(
aaptPath
)];
if
(
_
canRun
(
aaptPath
)
!=
null
)
return
<
String
>[
_
canRun
(
aaptPath
)];
if
(
_
exists
(
dxPath
)
!=
null
)
return
<
String
>[
_
exists
(
dxPath
)];
if
(
_
canRun
(
dxPath
)
!=
null
)
return
<
String
>[
_
canRun
(
dxPath
)];
if
(
_
exists
(
zipalignPath
)
!=
null
)
return
<
String
>[
_
exists
(
zipalignPath
)];
if
(
_
canRun
(
zipalignPath
)
!=
null
)
return
<
String
>[
_
canRun
(
zipalignPath
)];
return
<
String
>[];
}
String
getPlatformsPath
(
String
itemName
)
{
return
path
.
join
(
sdk
.
directory
,
'platforms'
,
platformVersionName
,
os
.
getExecutableName
(
itemName
)
);
return
path
.
join
(
sdk
.
directory
,
'platforms'
,
platformVersionName
,
itemName
);
}
String
getBuildToolsPath
(
String
binaryName
,
{
String
winExtension
}
)
{
return
path
.
join
(
sdk
.
directory
,
'build-tools'
,
buildToolsVersionName
,
os
.
getExecutableName
(
binaryName
,
winExtension:
winExtension
)
);
String
getBuildToolsPath
(
String
binaryName
)
{
return
path
.
join
(
sdk
.
directory
,
'build-tools'
,
buildToolsVersionName
,
binaryName
);
}
@override
...
...
@@ -260,4 +261,10 @@ class AndroidSdkVersion implements Comparable<AndroidSdkVersion> {
return
'Android SDK file not found:
$path
.'
;
return
null
;
}
String
_canRun
(
String
path
)
{
if
(!
processManager
.
canRun
(
path
))
return
'Android SDK file not found:
$path
.'
;
return
null
;
}
}
packages/flutter_tools/lib/src/base/os.dart
View file @
cff7dc54
...
...
@@ -46,13 +46,6 @@ abstract class OperatingSystemUtils {
File
makePipe
(
String
path
);
void
unzip
(
File
file
,
Directory
targetDirectory
);
/// Returns the name of the [binaryName] executable.
///
/// No-op on most OS.
/// On Windows it returns [binaryName].[winExtension], if [winExtension] is
/// specified, or [binaryName].exe otherwise.
String
getExecutableName
(
String
binaryName
,
{
String
winExtension
});
}
class
_PosixUtils
extends
OperatingSystemUtils
{
...
...
@@ -85,9 +78,6 @@ class _PosixUtils extends OperatingSystemUtils {
runSync
(<
String
>[
'mkfifo'
,
path
]);
return
fs
.
file
(
path
);
}
@override
String
getExecutableName
(
String
binaryName
,
{
String
winExtension
})
=>
binaryName
;
}
class
_WindowsUtils
extends
OperatingSystemUtils
{
...
...
@@ -127,14 +117,6 @@ class _WindowsUtils extends OperatingSystemUtils {
File
makePipe
(
String
path
)
{
throw
new
UnsupportedError
(
'makePipe is not implemented on Windows.'
);
}
@override
String
getExecutableName
(
String
binaryName
,
{
String
winExtension
})
{
winExtension
??=
'exe'
;
if
(
path
.
extension
(
binaryName
).
isEmpty
&&
winExtension
.
isNotEmpty
)
return
'
$binaryName
.
$winExtension
'
;
return
binaryName
;
}
}
Future
<
int
>
findAvailablePort
()
async
{
...
...
packages/flutter_tools/lib/src/commands/build_aot.dart
View file @
cff7dc54
...
...
@@ -9,8 +9,8 @@ import 'package:path/path.dart' as path;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../base/logger.dart'
;
import
'../base/os.dart'
;
import
'../base/process.dart'
;
import
'../base/process_manager.dart'
;
import
'../base/utils.dart'
;
import
'../build_info.dart'
;
import
'../dart/package_map.dart'
;
...
...
@@ -120,7 +120,7 @@ Future<String> _buildAotSnapshot(
String
entryPointsDir
,
dartEntryPointsDir
,
snapshotterDir
,
genSnapshot
;
String
engineSrc
=
tools
.
engineSrcPath
;
String
genSnapshotExecutable
=
os
.
getExecutableName
(
'gen_snapshot'
)
;
String
genSnapshotExecutable
=
'gen_snapshot'
;
if
(
engineSrc
!=
null
)
{
entryPointsDir
=
path
.
join
(
engineSrc
,
'flutter'
,
'runtime'
);
dartEntryPointsDir
=
path
.
join
(
engineSrc
,
'dart'
,
'runtime'
,
'bin'
);
...
...
@@ -168,7 +168,6 @@ Future<String> _buildAotSnapshot(
String
vmServicePath
=
path
.
join
(
skyEnginePkg
,
'sdk_ext'
,
'vmservice_io.dart'
);
List
<
String
>
filePaths
=
<
String
>[
genSnapshot
,
vmEntryPoints
,
ioEntryPoints
,
uiPath
,
...
...
@@ -209,6 +208,10 @@ Future<String> _buildAotSnapshot(
printError
(
'Missing files:
$missingFiles
'
);
return
null
;
}
if
(!
processManager
.
canRun
(
genSnapshot
))
{
printError
(
'Cannot locate the genSnapshot executable'
);
return
null
;
}
List
<
String
>
genSnapshotCmd
=
<
String
>[
genSnapshot
,
...
...
packages/flutter_tools/lib/src/commands/build_apk.dart
View file @
cff7dc54
...
...
@@ -14,6 +14,7 @@ import '../base/file_system.dart';
import
'../base/logger.dart'
;
import
'../base/os.dart'
;
import
'../base/process.dart'
;
import
'../base/process_manager.dart'
;
import
'../base/utils.dart'
;
import
'../build_info.dart'
;
import
'../flx.dart'
as
flx
;
...
...
@@ -82,11 +83,11 @@ class _ApkBuilder {
String
checkDependencies
()
{
if
(!
_androidJar
.
existsSync
())
return
'Cannot find android.jar at
${_androidJar.path}
'
;
if
(!
_aapt
.
existsSync
(
))
if
(!
processManager
.
canRun
(
_aapt
.
path
))
return
'Cannot find aapt at
${_aapt.path}
'
;
if
(!
_dx
.
existsSync
(
))
if
(!
processManager
.
canRun
(
_dx
.
path
))
return
'Cannot find dx at
${_dx.path}
'
;
if
(!
_zipalign
.
existsSync
(
))
if
(!
processManager
.
canRun
(
_zipalign
.
path
))
return
'Cannot find zipalign at
${_zipalign.path}
'
;
if
(
_jarsigner
==
null
)
return
'Cannot find jarsigner in PATH.'
;
...
...
packages/flutter_tools/lib/src/commands/format.dart
View file @
cff7dc54
...
...
@@ -7,7 +7,6 @@ import 'dart:async';
import
'package:path/path.dart'
as
path
;
import
'../base/common.dart'
;
import
'../base/os.dart'
;
import
'../base/process.dart'
;
import
'../cache.dart'
;
import
'../runner/flutter_command.dart'
;
...
...
@@ -38,8 +37,7 @@ class FormatCommand extends FlutterCommand {
);
}
String
executable
=
os
.
getExecutableName
(
'dartfmt'
,
winExtension:
'bat'
);
String
dartfmt
=
path
.
join
(
Cache
.
flutterRoot
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
executable
);
String
dartfmt
=
path
.
join
(
Cache
.
flutterRoot
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
'dartfmt'
);
List
<
String
>
cmd
=
<
String
>[
dartfmt
,
'-w'
]..
addAll
(
argResults
.
rest
);
int
result
=
await
runCommandAndStreamOutput
(
cmd
);
if
(
result
!=
0
)
...
...
packages/flutter_tools/lib/src/commands/upgrade.dart
View file @
cff7dc54
...
...
@@ -58,10 +58,9 @@ class UpgradeCommand extends FlutterCommand {
// if necessary.
printStatus
(
''
);
printStatus
(
'Upgrading engine...'
);
String
flutter
=
os
.
getExecutableName
(
'flutter'
,
winExtension:
'bat'
);
code
=
await
runCommandAndStreamOutput
(
<
String
>[
path
.
join
(
Cache
.
flutterRoot
,
'bin'
,
flutter
),
'--no-color'
,
'precache'
path
.
join
(
Cache
.
flutterRoot
,
'bin'
,
'flutter'
),
'--no-color'
,
'precache'
],
workingDirectory:
Cache
.
flutterRoot
,
allowReentrantFlutter:
true
...
...
packages/flutter_tools/pubspec.yaml
View file @
cff7dc54
...
...
@@ -23,7 +23,7 @@ dependencies:
package_config
:
'
>=0.1.5
<2.0.0'
path
:
^1.4.0
platform
:
1.0.1
process
:
1.
0.1
process
:
1.
1.0
pub_semver
:
^1.0.0
stack_trace
:
^1.4.0
usage
:
^3.0.0
...
...
packages/flutter_tools/test/src/context.dart
View file @
cff7dc54
...
...
@@ -145,19 +145,7 @@ class MockSimControl extends Mock implements SimControl {
}
}
class
MockOperatingSystemUtils
extends
Mock
implements
OperatingSystemUtils
{
// TODO(goderbauer): Calls to the executable should be mocked out.
// That way it wouldn't really matter what the mock returns here.
@override
String
getExecutableName
(
String
binaryName
,
{
String
winExtension
})
{
if
(!
platform
.
isWindows
)
return
binaryName
;
winExtension
??=
'exe'
;
if
(
path
.
extension
(
binaryName
).
isEmpty
&&
winExtension
.
isNotEmpty
)
return
'
$binaryName
.
$winExtension
'
;
return
binaryName
;
}
}
class
MockOperatingSystemUtils
extends
Mock
implements
OperatingSystemUtils
{}
class
MockIOSSimulatorUtils
extends
Mock
implements
IOSSimulatorUtils
{}
...
...
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