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
a1d3edc4
Unverified
Commit
a1d3edc4
authored
Jun 28, 2019
by
Jonah Williams
Committed by
GitHub
Jun 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Twiggle bit to exclude dev and beta from desktop and web (#35221)
parent
b43b8bab
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
26 additions
and
23 deletions
+26
-23
build_bundle.dart
packages/flutter_tools/lib/src/commands/build_bundle.dart
+1
-1
create.dart
packages/flutter_tools/lib/src/commands/create.dart
+1
-1
precache.dart
packages/flutter_tools/lib/src/commands/precache.dart
+1
-1
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+2
-2
desktop.dart
packages/flutter_tools/lib/src/desktop.dart
+2
-2
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+4
-4
version.dart
packages/flutter_tools/lib/src/version.dart
+4
-3
workflow.dart
packages/flutter_tools/lib/src/web/workflow.dart
+2
-2
build_web_test.dart
packages/flutter_tools/test/commands/build_web_test.dart
+1
-1
precache_test.dart
packages/flutter_tools/test/commands/precache_test.dart
+1
-1
run_test.dart
packages/flutter_tools/test/commands/run_test.dart
+1
-1
flutter_command_test.dart
packages/flutter_tools/test/runner/flutter_command_test.dart
+2
-2
context.dart
packages/flutter_tools/test/src/context.dart
+1
-1
workflow_test.dart
packages/flutter_tools/test/web/workflow_test.dart
+3
-1
No files found.
packages/flutter_tools/lib/src/commands/build_bundle.dart
View file @
a1d3edc4
...
...
@@ -103,7 +103,7 @@ class BuildBundleCommand extends BuildSubCommand {
case
TargetPlatform
.
darwin_x64
:
case
TargetPlatform
.
windows_x64
:
case
TargetPlatform
.
linux_x64
:
if
(
FlutterVersion
.
instance
.
isStable
)
{
if
(
!
FlutterVersion
.
instance
.
isMaster
)
{
throwToolExit
(
'
$targetPlatform
is not supported on stable Flutter.'
);
}
break
;
...
...
packages/flutter_tools/lib/src/commands/create.dart
View file @
a1d3edc4
...
...
@@ -613,7 +613,7 @@ To edit platform code in an IDE see https://flutter.dev/developing-packages/#edi
'iosLanguage'
:
iosLanguage
,
'flutterRevision'
:
FlutterVersion
.
instance
.
frameworkRevision
,
'flutterChannel'
:
FlutterVersion
.
instance
.
channel
,
'web'
:
web
&&
!
FlutterVersion
.
instance
.
isStable
,
'web'
:
web
&&
FlutterVersion
.
instance
.
isMaster
};
}
...
...
packages/flutter_tools/lib/src/commands/precache.dart
View file @
a1d3edc4
...
...
@@ -50,7 +50,7 @@ class PrecacheCommand extends FlutterCommand {
final
Set
<
DevelopmentArtifact
>
requiredArtifacts
=
<
DevelopmentArtifact
>{};
for
(
DevelopmentArtifact
artifact
in
DevelopmentArtifact
.
values
)
{
// Don't include unstable artifacts on stable branches.
if
(
FlutterVersion
.
instance
.
isStable
&&
artifact
.
unstable
)
{
if
(
!
FlutterVersion
.
instance
.
isMaster
&&
artifact
.
unstable
)
{
continue
;
}
if
(
argResults
[
artifact
.
name
])
{
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
a1d3edc4
...
...
@@ -352,7 +352,7 @@ class RunCommand extends RunCommandBase {
);
}
if
(
argResults
[
'dart-flags'
]
!=
null
&&
FlutterVersion
.
instance
.
isStable
)
{
if
(
argResults
[
'dart-flags'
]
!=
null
&&
!
FlutterVersion
.
instance
.
isMaster
)
{
throw
UsageException
(
'--dart-flags is not available on the stable '
'channel.'
,
null
);
}
...
...
@@ -411,7 +411,7 @@ class RunCommand extends RunCommandBase {
}
// Only support "web mode" on non-stable branches with a single web device
// in a "hot mode".
final
bool
webMode
=
!
FlutterVersion
.
instance
.
isStable
final
bool
webMode
=
FlutterVersion
.
instance
.
isMaster
&&
devices
.
length
==
1
&&
await
devices
.
single
.
targetPlatform
==
TargetPlatform
.
web_javascript
;
...
...
packages/flutter_tools/lib/src/desktop.dart
View file @
a1d3edc4
...
...
@@ -26,9 +26,9 @@ bool get flutterDesktopEnabled {
if
(
isRunningFromDaemon
)
{
final
bool
platformEnabled
=
platform
.
environment
[
'ENABLE_FLUTTER_DESKTOP'
]?.
toLowerCase
()
==
'true'
;
return
platformEnabled
&&
!
FlutterVersion
.
instance
.
isStable
;
return
platformEnabled
&&
FlutterVersion
.
instance
.
isMaster
;
}
return
!
FlutterVersion
.
instance
.
isStable
;
return
FlutterVersion
.
instance
.
isMaster
;
}
/// Kills a process on linux or macOS.
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
a1d3edc4
...
...
@@ -555,7 +555,7 @@ abstract class FlutterCommand extends Command<void> {
Future
<
void
>
validateCommand
()
async
{
// If we're on a stable branch, then don't allow the usage of
// "experimental" features.
if
(
isExperimental
&&
FlutterVersion
.
instance
.
isStable
)
{
if
(
isExperimental
&&
!
FlutterVersion
.
instance
.
isMaster
)
{
throwToolExit
(
'Experimental feature
$name
is not supported on stable branches'
);
}
...
...
@@ -651,17 +651,17 @@ DevelopmentArtifact _artifactFromTargetPlatform(TargetPlatform targetPlatform) {
case
TargetPlatform
.
ios
:
return
DevelopmentArtifact
.
iOS
;
case
TargetPlatform
.
darwin_x64
:
if
(
!
FlutterVersion
.
instance
.
isStable
)
{
if
(
FlutterVersion
.
instance
.
isMaster
)
{
return
DevelopmentArtifact
.
macOS
;
}
return
null
;
case
TargetPlatform
.
windows_x64
:
if
(!
FlutterVersion
.
instance
.
is
Stable
)
{
if
(!
FlutterVersion
.
instance
.
is
Master
)
{
return
DevelopmentArtifact
.
windows
;
}
return
null
;
case
TargetPlatform
.
linux_x64
:
if
(!
FlutterVersion
.
instance
.
is
Stable
)
{
if
(!
FlutterVersion
.
instance
.
is
Master
)
{
return
DevelopmentArtifact
.
linux
;
}
return
null
;
...
...
packages/flutter_tools/lib/src/version.dart
View file @
a1d3edc4
...
...
@@ -32,9 +32,10 @@ class FlutterVersion {
return
_repositoryUrl
;
}
/// Whether we are currently on the stable branch.
bool
get
isStable
{
return
getBranchName
()
==
'stable'
;
/// Whether we are currently on the master branch.
bool
get
isMaster
{
final
String
branchName
=
getBranchName
();
return
!<
String
>[
'dev'
,
'beta'
,
'stable'
].
contains
(
branchName
);
}
static
const
Set
<
String
>
officialChannels
=
<
String
>{
...
...
packages/flutter_tools/lib/src/web/workflow.dart
View file @
a1d3edc4
...
...
@@ -24,9 +24,9 @@ bool get flutterWebEnabled {
if
(
isRunningFromDaemon
)
{
final
bool
platformEnabled
=
platform
.
environment
[
'FLUTTER_WEB'
]?.
toLowerCase
()
==
'true'
;
return
platformEnabled
&&
!
FlutterVersion
.
instance
.
isStable
;
return
platformEnabled
&&
FlutterVersion
.
instance
.
isMaster
;
}
return
!
FlutterVersion
.
instance
.
isStable
;
return
FlutterVersion
.
instance
.
isMaster
;
}
/// The web workflow instance.
...
...
packages/flutter_tools/test/commands/build_web_test.dart
View file @
a1d3edc4
...
...
@@ -93,5 +93,5 @@ class MockPlatform extends Mock implements Platform {
}
class
MockFlutterVersion
extends
Mock
implements
FlutterVersion
{
@override
bool
get
is
Stable
=>
fals
e
;
bool
get
is
Master
=>
tru
e
;
}
packages/flutter_tools/test/commands/precache_test.dart
View file @
a1d3edc4
...
...
@@ -44,7 +44,7 @@ void main() {
});
final
MockFlutterVersion
flutterVersion
=
MockFlutterVersion
();
when
(
flutterVersion
.
is
Stable
).
thenReturn
(
tru
e
);
when
(
flutterVersion
.
is
Master
).
thenReturn
(
fals
e
);
testUsingContext
(
'Adds artifact flags to requested artifacts on stable'
,
()
async
{
// Release lock between test cases.
...
...
packages/flutter_tools/test/commands/run_test.dart
View file @
a1d3edc4
...
...
@@ -201,7 +201,7 @@ class TestRunCommand extends RunCommand {
class
MockStableFlutterVersion
extends
MockFlutterVersion
{
@override
bool
get
is
Stable
=>
tru
e
;
bool
get
is
Master
=>
fals
e
;
}
class
FakeDevice
extends
Fake
implements
Device
{
...
...
packages/flutter_tools/test/runner/flutter_command_test.dart
View file @
a1d3edc4
...
...
@@ -274,8 +274,8 @@ void main() {
final
MockVersion
stableVersion
=
MockVersion
();
final
MockVersion
betaVersion
=
MockVersion
();
final
FakeCommand
fakeCommand
=
FakeCommand
();
when
(
stableVersion
.
is
Stable
).
thenReturn
(
tru
e
);
when
(
betaVersion
.
is
Stable
).
thenReturn
(
fals
e
);
when
(
stableVersion
.
is
Master
).
thenReturn
(
fals
e
);
when
(
betaVersion
.
is
Master
).
thenReturn
(
tru
e
);
testUsingContext
(
'Can be disabled on stable branch'
,
()
async
{
expect
(()
=>
fakeCommand
.
run
(),
throwsA
(
isA
<
ToolExit
>()));
...
...
packages/flutter_tools/test/src/context.dart
View file @
a1d3edc4
...
...
@@ -348,7 +348,7 @@ class MockFlutterVersion extends Mock implements FlutterVersion {
final
bool
_isStable
;
@override
bool
get
is
Stable
=>
_isStable
;
bool
get
is
Master
=>
!
_isStable
;
}
class
MockClock
extends
Mock
implements
SystemClock
{}
...
...
packages/flutter_tools/test/web/workflow_test.dart
View file @
a1d3edc4
...
...
@@ -96,8 +96,10 @@ void main() {
class
MockFlutterVersion
extends
Mock
implements
FlutterVersion
{
MockFlutterVersion
(
this
.
isStable
);
@override
final
bool
isStable
;
@override
bool
get
isMaster
=>
!
isStable
;
}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
...
...
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