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
79323f7c
Unverified
Commit
79323f7c
authored
Oct 31, 2019
by
Jonah Williams
Committed by
GitHub
Oct 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure target platform is passed is always passed to assemble (#43862)
parent
40670c09
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
3 deletions
+30
-3
bundle.dart
packages/flutter_tools/lib/src/bundle.dart
+1
-1
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+6
-2
simulators_test.dart
...flutter_tools/test/general.shard/ios/simulators_test.dart
+23
-0
No files found.
packages/flutter_tools/lib/src/bundle.dart
View file @
79323f7c
...
...
@@ -50,7 +50,7 @@ class BundleBuilder {
/// The default `mainPath` is `lib/main.dart`.
/// The default `manifestPath` is `pubspec.yaml`
Future
<
void
>
build
({
TargetPlatform
platform
,
@required
TargetPlatform
platform
,
BuildMode
buildMode
,
String
mainPath
,
String
manifestPath
=
defaultManifestPath
,
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
79323f7c
...
...
@@ -5,6 +5,8 @@
import
'dart:async'
;
import
'dart:math'
as
math
;
import
'package:meta/meta.dart'
;
import
'../application_package.dart'
;
import
'../base/common.dart'
;
import
'../base/context.dart'
;
...
...
@@ -417,7 +419,7 @@ class IOSSimulator extends Device {
}
Future
<
void
>
_setupUpdatedApplicationBundle
(
covariant
BuildableIOSApp
app
,
BuildInfo
buildInfo
,
String
mainPath
)
async
{
await
_sideloadUpdatedAssetsForInstalledApplicationBundle
(
app
,
buildInfo
,
mainPath
);
await
sideloadUpdatedAssetsForInstalledApplicationBundle
(
buildInfo
,
mainPath
);
// Step 1: Build the Xcode project.
// The build mode for the simulator is always debug.
...
...
@@ -448,9 +450,11 @@ class IOSSimulator extends Device {
await
SimControl
.
instance
.
install
(
id
,
fs
.
path
.
absolute
(
bundle
.
path
));
}
Future
<
void
>
_sideloadUpdatedAssetsForInstalledApplicationBundle
(
ApplicationPackage
app
,
BuildInfo
buildInfo
,
String
mainPath
)
{
@visibleForTesting
Future
<
void
>
sideloadUpdatedAssetsForInstalledApplicationBundle
(
BuildInfo
buildInfo
,
String
mainPath
)
{
// Run compiler to produce kernel file for the application.
return
BundleBuilder
().
build
(
platform:
TargetPlatform
.
ios
,
mainPath:
mainPath
,
precompiledSnapshot:
false
,
buildMode:
buildInfo
.
mode
,
...
...
packages/flutter_tools/test/general.shard/ios/simulators_test.dart
View file @
79323f7c
...
...
@@ -8,6 +8,8 @@ import 'dart:io' show ProcessResult, Process;
import
'package:file/file.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/build_system/build_system.dart'
;
import
'package:flutter_tools/src/build_system/targets/dart.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/application_package.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
...
...
@@ -183,6 +185,25 @@ void main() {
});
});
testUsingContext
(
'builds with targetPlatform'
,
()
async
{
final
IOSSimulator
simulator
=
IOSSimulator
(
'x'
,
name:
'iPhone X'
);
when
(
buildSystem
.
build
(
any
,
any
)).
thenAnswer
((
Invocation
invocation
)
async
{
return
BuildResult
(
success:
true
);
});
await
simulator
.
sideloadUpdatedAssetsForInstalledApplicationBundle
(
BuildInfo
.
debug
,
'lib/main.dart'
);
final
VerificationResult
result
=
verify
(
buildSystem
.
build
(
any
,
captureAny
));
final
Environment
environment
=
result
.
captured
.
single
;
expect
(
environment
.
defines
,
<
String
,
String
>{
kTargetFile:
'lib/main.dart'
,
kTargetPlatform:
'ios'
,
kBuildMode:
'debug'
,
kTrackWidgetCreation:
'false'
,
});
},
overrides:
<
Type
,
Generator
>{
BuildSystem:
()
=>
MockBuildSystem
(),
});
group
(
'Simulator screenshot'
,
()
{
MockXcode
mockXcode
;
MockProcessManager
mockProcessManager
;
...
...
@@ -512,3 +533,5 @@ flutter:
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
}
class
MockBuildSystem
extends
Mock
implements
BuildSystem
{}
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