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
48936d9a
Unverified
Commit
48936d9a
authored
Apr 30, 2019
by
Jonah Williams
Committed by
GitHub
Apr 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated commands (#31759)
parent
fb876191
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
260 deletions
+0
-260
executable.dart
packages/flutter_tools/lib/executable.dart
+0
-4
build.dart
packages/flutter_tools/lib/src/commands/build.dart
+0
-2
build_flx.dart
packages/flutter_tools/lib/src/commands/build_flx.dart
+0
-28
stop.dart
packages/flutter_tools/lib/src/commands/stop.dart
+0
-49
trace.dart
packages/flutter_tools/lib/src/commands/trace.dart
+0
-112
stop_test.dart
packages/flutter_tools/test/stop_test.dart
+0
-40
trace_test.dart
packages/flutter_tools/test/trace_test.dart
+0
-25
No files found.
packages/flutter_tools/lib/executable.dart
View file @
48936d9a
...
...
@@ -35,9 +35,7 @@ import 'src/commands/precache.dart';
import
'src/commands/run.dart'
;
import
'src/commands/screenshot.dart'
;
import
'src/commands/shell_completion.dart'
;
import
'src/commands/stop.dart'
;
import
'src/commands/test.dart'
;
import
'src/commands/trace.dart'
;
import
'src/commands/train.dart'
;
import
'src/commands/update_packages.dart'
;
import
'src/commands/upgrade.dart'
;
...
...
@@ -82,9 +80,7 @@ Future<void> main(List<String> args) async {
RunCommand
(
verboseHelp:
verboseHelp
),
ScreenshotCommand
(),
ShellCompletionCommand
(),
StopCommand
(),
TestCommand
(
verboseHelp:
verboseHelp
),
TraceCommand
(),
TrainingCommand
(),
UpdatePackagesCommand
(
hidden:
!
verboseHelp
),
UpgradeCommand
(),
...
...
packages/flutter_tools/lib/src/commands/build.dart
View file @
48936d9a
...
...
@@ -13,7 +13,6 @@ import 'build_aot.dart';
import
'build_apk.dart'
;
import
'build_appbundle.dart'
;
import
'build_bundle.dart'
;
import
'build_flx.dart'
;
import
'build_ios.dart'
;
import
'build_web.dart'
;
...
...
@@ -23,7 +22,6 @@ class BuildCommand extends FlutterCommand {
addSubcommand
(
BuildAppBundleCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildAotCommand
());
addSubcommand
(
BuildIOSCommand
());
addSubcommand
(
BuildFlxCommand
());
addSubcommand
(
BuildBundleCommand
(
verboseHelp:
verboseHelp
));
addSubcommand
(
BuildWebCommand
());
addSubcommand
(
BuildMacosCommand
());
...
...
packages/flutter_tools/lib/src/commands/build_flx.dart
deleted
100644 → 0
View file @
fb876191
// Copyright 2015 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:async'
;
import
'../globals.dart'
;
import
'../runner/flutter_command.dart'
show
FlutterCommandResult
;
import
'build.dart'
;
class
BuildFlxCommand
extends
BuildSubCommand
{
@override
final
String
name
=
'flx'
;
@override
final
String
description
=
'Deprecated'
;
@override
final
String
usageFooter
=
'FLX archives are deprecated.'
;
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
printError
(
"'build flx' is no longer supported. Instead, use 'build "
"bundle' to build and assemble the application code and resources "
'for your app.'
);
return
null
;
}
}
packages/flutter_tools/lib/src/commands/stop.dart
deleted
100644 → 0
View file @
fb876191
// Copyright 2015 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:async'
;
import
'../application_package.dart'
;
import
'../base/common.dart'
;
import
'../build_info.dart'
;
import
'../device.dart'
;
import
'../globals.dart'
;
import
'../runner/flutter_command.dart'
;
class
StopCommand
extends
FlutterCommand
{
StopCommand
()
{
requiresPubspecYaml
();
}
@override
final
String
name
=
'stop'
;
@override
final
String
description
=
'Stop your Flutter app on an attached device.'
;
Device
device
;
@override
Future
<
void
>
validateCommand
()
async
{
await
super
.
validateCommand
();
device
=
await
findTargetDevice
();
if
(
device
==
null
)
throwToolExit
(
null
);
}
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
final
TargetPlatform
targetPlatform
=
await
device
.
targetPlatform
;
final
ApplicationPackage
app
=
await
applicationPackages
.
getPackageForPlatform
(
targetPlatform
);
if
(
app
==
null
)
{
final
String
platformName
=
getNameForTargetPlatform
(
targetPlatform
);
throwToolExit
(
'No Flutter application for
$platformName
found in the current directory.'
);
}
printStatus
(
'Stopping apps on
${device.name}
.'
);
if
(!
await
device
.
stopApp
(
app
))
throwToolExit
(
null
);
return
null
;
}
}
packages/flutter_tools/lib/src/commands/trace.dart
deleted
100644 → 0
View file @
fb876191
// Copyright 2015 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:async'
;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../base/utils.dart'
;
import
'../cache.dart'
;
import
'../convert.dart'
;
import
'../globals.dart'
;
import
'../runner/flutter_command.dart'
;
import
'../tracing.dart'
;
class
TraceCommand
extends
FlutterCommand
{
TraceCommand
()
{
requiresPubspecYaml
();
argParser
.
addOption
(
'debug-port'
,
help:
'Local port where the observatory is listening. Required.'
,
);
argParser
.
addFlag
(
'start'
,
negatable:
false
,
help:
'Start tracing. Implied if --stop is also omitted.'
);
argParser
.
addFlag
(
'stop'
,
negatable:
false
,
help:
'Stop tracing. Implied if --start is also omitted.'
);
argParser
.
addOption
(
'duration'
,
abbr:
'd'
,
help:
'Time to wait after starting (if --start is specified or implied) and before '
'stopping (if --stop is specified or implied).
\n
'
'Defaults to ten seconds if --stop is specified or implied, zero otherwise.'
,
);
argParser
.
addOption
(
'out'
,
help:
'Specify the path of the saved trace file.'
);
}
@override
final
String
name
=
'trace'
;
@override
final
String
description
=
'Start and stop tracing for a running Flutter app.'
;
@override
final
String
usageFooter
=
'
\
`trace
\
` called without the --start or --stop flags will automatically start tracing, '
'delay a set amount of time (controlled by --duration), and stop tracing. To explicitly '
'control tracing, call trace with --start and later with --stop.
\n
'
'The --debug-port argument is required.'
;
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
int
observatoryPort
;
if
(
argResults
.
wasParsed
(
'debug-port'
))
{
observatoryPort
=
int
.
tryParse
(
argResults
[
'debug-port'
]);
}
if
(
observatoryPort
==
null
)
{
throwToolExit
(
'The --debug-port argument must be specified.'
);
}
bool
start
=
argResults
[
'start'
];
bool
stop
=
argResults
[
'stop'
];
if
(!
start
&&
!
stop
)
{
start
=
true
;
stop
=
true
;
}
assert
(
start
||
stop
);
Duration
duration
;
if
(
argResults
.
wasParsed
(
'duration'
))
{
try
{
duration
=
Duration
(
seconds:
int
.
parse
(
argResults
[
'duration'
]));
}
on
FormatException
{
throwToolExit
(
'Invalid duration passed to --duration; it should be a positive number of seconds.'
);
}
}
else
{
duration
=
stop
?
const
Duration
(
seconds:
10
)
:
Duration
.
zero
;
}
// TODO(danrubel): this will break if we move to the new observatory URL
// See https://github.com/flutter/flutter/issues/7038
final
Uri
observatoryUri
=
Uri
.
parse
(
'http://127.0.0.1:
$observatoryPort
'
);
Tracing
tracing
;
try
{
tracing
=
await
Tracing
.
connect
(
observatoryUri
);
}
catch
(
error
)
{
throwToolExit
(
'Error connecting to observatory:
$error
'
);
}
Cache
.
releaseLockEarly
();
if
(
start
)
await
tracing
.
startTracing
();
await
Future
<
void
>.
delayed
(
duration
);
if
(
stop
)
await
_stopTracing
(
tracing
);
return
null
;
}
Future
<
void
>
_stopTracing
(
Tracing
tracing
)
async
{
final
Map
<
String
,
dynamic
>
timeline
=
await
tracing
.
stopTracingAndDownloadTimeline
();
File
localFile
;
if
(
argResults
[
'out'
]
!=
null
)
{
localFile
=
fs
.
file
(
argResults
[
'out'
]);
}
else
{
localFile
=
getUniqueFile
(
fs
.
currentDirectory
,
'trace'
,
'json'
);
}
await
localFile
.
writeAsString
(
json
.
encode
(
timeline
));
printStatus
(
'Trace file saved to
${localFile.path}
'
);
}
}
packages/flutter_tools/test/stop_test.dart
deleted
100644 → 0
View file @
fb876191
// Copyright 2015 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:async'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/stop.dart'
;
import
'package:mockito/mockito.dart'
;
import
'src/common.dart'
;
import
'src/context.dart'
;
import
'src/mocks.dart'
;
void
main
(
)
{
group
(
'stop'
,
()
{
setUpAll
(()
{
Cache
.
disableLocking
();
});
testUsingContext
(
'returns 0 when Android is connected and ready to be stopped'
,
()
async
{
final
StopCommand
command
=
StopCommand
();
applyMocksToCommand
(
command
);
final
MockAndroidDevice
device
=
MockAndroidDevice
();
when
(
device
.
stopApp
(
any
)).
thenAnswer
((
Invocation
invocation
)
=>
Future
<
bool
>.
value
(
true
));
testDeviceManager
.
addDevice
(
device
);
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'stop'
]);
});
testUsingContext
(
'returns 0 when iOS is connected and ready to be stopped'
,
()
async
{
final
StopCommand
command
=
StopCommand
();
applyMocksToCommand
(
command
);
final
MockIOSDevice
device
=
MockIOSDevice
();
when
(
device
.
stopApp
(
any
)).
thenAnswer
((
Invocation
invocation
)
=>
Future
<
bool
>.
value
(
true
));
testDeviceManager
.
addDevice
(
device
);
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'stop'
]);
});
});
}
packages/flutter_tools/test/trace_test.dart
deleted
100644 → 0
View file @
fb876191
// Copyright 2015 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
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/commands/trace.dart'
;
import
'src/common.dart'
;
import
'src/context.dart'
;
import
'src/mocks.dart'
;
void
main
(
)
{
group
(
'trace'
,
()
{
testUsingContext
(
'returns 1 when no Android device is connected'
,
()
async
{
final
TraceCommand
command
=
TraceCommand
();
applyMocksToCommand
(
command
);
try
{
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'trace'
]);
fail
(
'Exception expected'
);
}
on
ToolExit
catch
(
e
)
{
expect
(
e
.
exitCode
??
1
,
1
);
}
});
});
}
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