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
9c87b324
Unverified
Commit
9c87b324
authored
May 11, 2020
by
Jenn Magder
Committed by
GitHub
May 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Runner target check, prefer schemes (#56620)
parent
0177d429
Changes
28
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
475 additions
and
160 deletions
+475
-160
project.pbxproj
...ration_tests/flavors/ios/Runner.xcodeproj/project.pbxproj
+212
-19
Free.xcscheme
...ios/Runner.xcodeproj/xcshareddata/xcschemes/Free.xcscheme
+10
-14
Paid.xcscheme
...ios/Runner.xcodeproj/xcshareddata/xcschemes/Paid.xcscheme
+15
-20
IDEWorkspaceChecks.plist
.../Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+8
-0
Info-Free.plist
dev/integration_tests/flavors/ios/Runner/Info-Free.plist
+3
-3
Info-Paid.plist
dev/integration_tests/flavors/ios/Runner/Info-Paid.plist
+47
-0
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+12
-8
resident_web_runner.dart
...utter_tools/lib/src/build_runner/resident_web_runner.dart
+1
-0
build_ios.dart
packages/flutter_tools/lib/src/commands/build_ios.dart
+5
-2
build_ios_framework.dart
...s/flutter_tools/lib/src/commands/build_ios_framework.dart
+1
-1
drive.dart
packages/flutter_tools/lib/src/commands/drive.dart
+5
-2
install.dart
packages/flutter_tools/lib/src/commands/install.dart
+4
-1
code_signing.dart
packages/flutter_tools/lib/src/ios/code_signing.dart
+3
-1
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+6
-8
xcodeproj.dart
packages/flutter_tools/lib/src/ios/xcodeproj.dart
+8
-6
cocoapods.dart
packages/flutter_tools/lib/src/macos/cocoapods.dart
+0
-1
project.dart
packages/flutter_tools/lib/src/project.dart
+23
-17
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+2
-0
create_test.dart
...tter_tools/test/commands.shard/permeable/create_test.dart
+20
-7
application_package_test.dart
...er_tools/test/general.shard/application_package_test.dart
+6
-3
code_signing_test.dart
...utter_tools/test/general.shard/ios/code_signing_test.dart
+24
-5
mac_test.dart
packages/flutter_tools/test/general.shard/ios/mac_test.dart
+1
-1
simulators_test.dart
...flutter_tools/test/general.shard/ios/simulators_test.dart
+4
-4
xcodeproj_test.dart
.../flutter_tools/test/general.shard/ios/xcodeproj_test.dart
+26
-9
cocoapods_test.dart
...lutter_tools/test/general.shard/macos/cocoapods_test.dart
+2
-2
project_test.dart
packages/flutter_tools/test/general.shard/project_test.dart
+21
-21
context.dart
packages/flutter_tools/test/src/context.dart
+2
-2
mocks.dart
packages/flutter_tools/test/src/mocks.dart
+4
-3
No files found.
dev/integration_tests/flavors/ios/Runner.xcodeproj/project.pbxproj
View file @
9c87b324
This diff is collapsed.
Click to expand it.
dev/integration_tests/flavors/ios/Runner.xcodeproj/xcshareddata/xcschemes/Free.xcscheme
View file @
9c87b324
...
@@ -15,8 +15,8 @@
...
@@ -15,8 +15,8 @@
<BuildableReference
<BuildableReference
BuildableIdentifier =
"primary"
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BuildableName =
"
Runner
.app"
BuildableName =
"
Free App
.app"
BlueprintName =
"
Runner
"
BlueprintName =
"
Free App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntry>
...
@@ -27,19 +27,17 @@
...
@@ -27,19 +27,17 @@
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
>
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
</Testables>
<MacroExpansion>
<MacroExpansion>
<BuildableReference
<BuildableReference
BuildableIdentifier =
"primary"
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BuildableName =
"
Runner
.app"
BuildableName =
"
Free App
.app"
BlueprintName =
"
Runner
"
BlueprintName =
"
Free App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildableReference>
</MacroExpansion>
</MacroExpansion>
<
AdditionalOption
s>
<
Testable
s>
</
AdditionalOption
s>
</
Testable
s>
</TestAction>
</TestAction>
<LaunchAction
<LaunchAction
buildConfiguration =
"Debug Free"
buildConfiguration =
"Debug Free"
...
@@ -56,13 +54,11 @@
...
@@ -56,13 +54,11 @@
<BuildableReference
<BuildableReference
BuildableIdentifier =
"primary"
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BuildableName =
"
Runner
.app"
BuildableName =
"
Free App
.app"
BlueprintName =
"
Runner
"
BlueprintName =
"
Free App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildableReference>
</BuildableProductRunnable>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
</LaunchAction>
<ProfileAction
<ProfileAction
buildConfiguration =
"Release Free"
buildConfiguration =
"Release Free"
...
@@ -75,8 +71,8 @@
...
@@ -75,8 +71,8 @@
<BuildableReference
<BuildableReference
BuildableIdentifier =
"primary"
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BuildableName =
"
Runner
.app"
BuildableName =
"
Free App
.app"
BlueprintName =
"
Runner
"
BlueprintName =
"
Free App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildableReference>
</BuildableProductRunnable>
</BuildableProductRunnable>
...
...
dev/integration_tests/flavors/ios/Runner.xcodeproj/xcshareddata/xcschemes/Paid.xcscheme
View file @
9c87b324
...
@@ -14,9 +14,9 @@
...
@@ -14,9 +14,9 @@
buildForAnalyzing =
"YES"
>
buildForAnalyzing =
"YES"
>
<BuildableReference
<BuildableReference
BuildableIdentifier =
"primary"
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"
97C146ED1CF9000F007C117D
"
BlueprintIdentifier =
"
F723D22E2464E1C10004F0E0
"
BuildableName =
"
Runner
.app"
BuildableName =
"
Paid App
.app"
BlueprintName =
"
Runner
"
BlueprintName =
"
Paid App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntry>
...
@@ -27,19 +27,17 @@
...
@@ -27,19 +27,17 @@
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
>
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
</Testables>
<MacroExpansion>
<MacroExpansion>
<BuildableReference
<BuildableReference
BuildableIdentifier =
"primary"
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BuildableName =
"
Runner
.app"
BuildableName =
"
Free App
.app"
BlueprintName =
"
Runner
"
BlueprintName =
"
Free App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildableReference>
</MacroExpansion>
</MacroExpansion>
<
AdditionalOption
s>
<
Testable
s>
</
AdditionalOption
s>
</
Testable
s>
</TestAction>
</TestAction>
<LaunchAction
<LaunchAction
buildConfiguration =
"Debug Paid"
buildConfiguration =
"Debug Paid"
...
@@ -55,14 +53,12 @@
...
@@ -55,14 +53,12 @@
runnableDebuggingMode =
"0"
>
runnableDebuggingMode =
"0"
>
<BuildableReference
<BuildableReference
BuildableIdentifier =
"primary"
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"
97C146ED1CF9000F007C117D
"
BlueprintIdentifier =
"
F723D22E2464E1C10004F0E0
"
BuildableName =
"
Runner
.app"
BuildableName =
"
Paid App
.app"
BlueprintName =
"
Runner
"
BlueprintName =
"
Paid App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildableReference>
</BuildableProductRunnable>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
</LaunchAction>
<ProfileAction
<ProfileAction
buildConfiguration =
"Release Paid"
buildConfiguration =
"Release Paid"
...
@@ -70,16 +66,15 @@
...
@@ -70,16 +66,15 @@
savedToolIdentifier =
""
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
<MacroExpansion>
runnableDebuggingMode =
"0"
>
<BuildableReference
<BuildableReference
BuildableIdentifier =
"primary"
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"
97C146ED1CF9000F007C117D
"
BlueprintIdentifier =
"
F723D22E2464E1C10004F0E0
"
BuildableName =
"
Runner
.app"
BuildableName =
"
Paid App
.app"
BlueprintName =
"
Runner
"
BlueprintName =
"
Paid App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildableReference>
</
BuildableProductRunnable
>
</
MacroExpansion
>
</ProfileAction>
</ProfileAction>
<AnalyzeAction
<AnalyzeAction
buildConfiguration =
"Debug Paid"
>
buildConfiguration =
"Debug Paid"
>
...
...
dev/integration_tests/flavors/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
0 → 100644
View file @
9c87b324
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
IDEDidComputeMac32BitWarning
<
/k
e
y
>
<
tru
e
/
>
<
/
d
i
c
t
>
<
/plist
>
dev/integration_tests/flavors/ios/Runner/Info.plist
→
dev/integration_tests/flavors/ios/Runner/Info
-Free
.plist
View file @
9c87b324
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
flavors
<
/string
>
<
string
>
$
(
PRODUCT_NAME
)
<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
...
@@ -20,14 +20,14 @@
...
@@ -20,14 +20,14 @@
<
string
>
????
<
/string
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1
<
/string
>
<
string
>
1
<
/string
>
<
k
e
y
>
Flavor
<
/k
e
y
>
<
string
>
$
{
PRODUCT_FLAVOR
}<
/string
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
tru
e
/
>
<
tru
e
/
>
<
k
e
y
>
UILaunchStoryboardName
<
/k
e
y
>
<
k
e
y
>
UILaunchStoryboardName
<
/k
e
y
>
<
string
>
LaunchScreen
<
/string
>
<
string
>
LaunchScreen
<
/string
>
<
k
e
y
>
UIMainStoryboardFile
<
/k
e
y
>
<
k
e
y
>
UIMainStoryboardFile
<
/k
e
y
>
<
string
>
Main
<
/string
>
<
string
>
Main
<
/string
>
<
k
e
y
>
Flavor
<
/k
e
y
>
<
string
>
$
{
PRODUCT_FLAVOR
}<
/string
>
<
k
e
y
>
UISupportedInterfaceOrientations
<
/k
e
y
>
<
k
e
y
>
UISupportedInterfaceOrientations
<
/k
e
y
>
<
a
rr
a
y
>
<
a
rr
a
y
>
<
string
>
UIInterfaceOrientationPortrait
<
/string
>
<
string
>
UIInterfaceOrientationPortrait
<
/string
>
...
...
dev/integration_tests/flavors/ios/Runner/Info-Paid.plist
0 → 100644
View file @
9c87b324
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
$
(
DEVELOPMENT_LANGUAGE
)<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
$
(
EXECUTABLE_NAME
)<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
<
string
>
$
(
PRODUCT_BUNDLE_IDENTIFIER
)<
/string
>
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
$
(
PRODUCT_NAME
)<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.0
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1
<
/string
>
<
k
e
y
>
Flavor
<
/k
e
y
>
<
string
>
$
{
PRODUCT_FLAVOR
}<
/string
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
UILaunchStoryboardName
<
/k
e
y
>
<
string
>
LaunchScreen
<
/string
>
<
k
e
y
>
UIMainStoryboardFile
<
/k
e
y
>
<
string
>
Main
<
/string
>
<
k
e
y
>
UISupportedInterfaceOrientations
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
UIInterfaceOrientationPortrait
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeLeft
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeRight
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
UISupportedInterfaceOrientations
~
ipad
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
UIInterfaceOrientationPortrait
<
/string
>
<
string
>
UIInterfaceOrientationPortraitUpsideDown
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeLeft
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeRight
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
UIViewControllerBasedStatusBarAppearance
<
/k
e
y
>
<
fa
ls
e
/
>
<
/
d
i
c
t
>
<
/plist
>
packages/flutter_tools/lib/src/application_package.dart
View file @
9c87b324
...
@@ -31,6 +31,7 @@ class ApplicationPackageFactory {
...
@@ -31,6 +31,7 @@ class ApplicationPackageFactory {
Future
<
ApplicationPackage
>
getPackageForPlatform
(
Future
<
ApplicationPackage
>
getPackageForPlatform
(
TargetPlatform
platform
,
{
TargetPlatform
platform
,
{
BuildInfo
buildInfo
,
File
applicationBinary
,
File
applicationBinary
,
})
async
{
})
async
{
switch
(
platform
)
{
switch
(
platform
)
{
...
@@ -47,7 +48,7 @@ class ApplicationPackageFactory {
...
@@ -47,7 +48,7 @@ class ApplicationPackageFactory {
:
AndroidApk
.
fromApk
(
applicationBinary
);
:
AndroidApk
.
fromApk
(
applicationBinary
);
case
TargetPlatform
.
ios
:
case
TargetPlatform
.
ios
:
return
applicationBinary
==
null
return
applicationBinary
==
null
?
await
IOSApp
.
fromIosProject
(
FlutterProject
.
current
().
ios
)
?
await
IOSApp
.
fromIosProject
(
FlutterProject
.
current
().
ios
,
buildInfo
)
:
IOSApp
.
fromPrebuiltApp
(
applicationBinary
);
:
IOSApp
.
fromPrebuiltApp
(
applicationBinary
);
case
TargetPlatform
.
tester
:
case
TargetPlatform
.
tester
:
return
FlutterTesterApp
.
fromCurrentDirectory
();
return
FlutterTesterApp
.
fromCurrentDirectory
();
...
@@ -327,7 +328,7 @@ abstract class IOSApp extends ApplicationPackage {
...
@@ -327,7 +328,7 @@ abstract class IOSApp extends ApplicationPackage {
);
);
}
}
static
Future
<
IOSApp
>
fromIosProject
(
IosProject
project
)
{
static
Future
<
IOSApp
>
fromIosProject
(
IosProject
project
,
BuildInfo
buildInfo
)
{
if
(
getCurrentHostPlatform
()
!=
HostPlatform
.
darwin_x64
)
{
if
(
getCurrentHostPlatform
()
!=
HostPlatform
.
darwin_x64
)
{
return
null
;
return
null
;
}
}
...
@@ -344,7 +345,7 @@ abstract class IOSApp extends ApplicationPackage {
...
@@ -344,7 +345,7 @@ abstract class IOSApp extends ApplicationPackage {
globals
.
printError
(
'Expected ios/Runner.xcodeproj/project.pbxproj but this file is missing.'
);
globals
.
printError
(
'Expected ios/Runner.xcodeproj/project.pbxproj but this file is missing.'
);
return
null
;
return
null
;
}
}
return
BuildableIOSApp
.
fromProject
(
project
);
return
BuildableIOSApp
.
fromProject
(
project
,
buildInfo
);
}
}
@override
@override
...
@@ -360,9 +361,9 @@ class BuildableIOSApp extends IOSApp {
...
@@ -360,9 +361,9 @@ class BuildableIOSApp extends IOSApp {
:
_hostAppBundleName
=
hostAppBundleName
,
:
_hostAppBundleName
=
hostAppBundleName
,
super
(
projectBundleId:
projectBundleId
);
super
(
projectBundleId:
projectBundleId
);
static
Future
<
BuildableIOSApp
>
fromProject
(
IosProject
project
)
async
{
static
Future
<
BuildableIOSApp
>
fromProject
(
IosProject
project
,
BuildInfo
buildInfo
)
async
{
final
String
projectBundleId
=
await
project
.
productBundleIdentifier
;
final
String
projectBundleId
=
await
project
.
productBundleIdentifier
(
buildInfo
)
;
final
String
hostAppBundleName
=
await
project
.
hostAppBundleName
;
final
String
hostAppBundleName
=
await
project
.
hostAppBundleName
(
buildInfo
)
;
return
BuildableIOSApp
(
project
,
projectBundleId
,
hostAppBundleName
);
return
BuildableIOSApp
(
project
,
projectBundleId
,
hostAppBundleName
);
}
}
...
@@ -416,7 +417,10 @@ class ApplicationPackageStore {
...
@@ -416,7 +417,10 @@ class ApplicationPackageStore {
MacOSApp
macOS
;
MacOSApp
macOS
;
WindowsApp
windows
;
WindowsApp
windows
;
Future
<
ApplicationPackage
>
getPackageForPlatform
(
TargetPlatform
platform
)
async
{
Future
<
ApplicationPackage
>
getPackageForPlatform
(
TargetPlatform
platform
,
BuildInfo
buildInfo
,
)
async
{
switch
(
platform
)
{
switch
(
platform
)
{
case
TargetPlatform
.
android
:
case
TargetPlatform
.
android
:
case
TargetPlatform
.
android_arm
:
case
TargetPlatform
.
android_arm
:
...
@@ -426,7 +430,7 @@ class ApplicationPackageStore {
...
@@ -426,7 +430,7 @@ class ApplicationPackageStore {
android
??=
await
AndroidApk
.
fromAndroidProject
(
FlutterProject
.
current
().
android
);
android
??=
await
AndroidApk
.
fromAndroidProject
(
FlutterProject
.
current
().
android
);
return
android
;
return
android
;
case
TargetPlatform
.
ios
:
case
TargetPlatform
.
ios
:
iOS
??=
await
IOSApp
.
fromIosProject
(
FlutterProject
.
current
().
ios
);
iOS
??=
await
IOSApp
.
fromIosProject
(
FlutterProject
.
current
().
ios
,
buildInfo
);
return
iOS
;
return
iOS
;
case
TargetPlatform
.
fuchsia_arm64
:
case
TargetPlatform
.
fuchsia_arm64
:
case
TargetPlatform
.
fuchsia_x64
:
case
TargetPlatform
.
fuchsia_x64
:
...
...
packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart
View file @
9c87b324
...
@@ -370,6 +370,7 @@ class _ResidentWebRunner extends ResidentWebRunner {
...
@@ -370,6 +370,7 @@ class _ResidentWebRunner extends ResidentWebRunner {
firstBuildTime
=
DateTime
.
now
();
firstBuildTime
=
DateTime
.
now
();
final
ApplicationPackage
package
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
final
ApplicationPackage
package
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
TargetPlatform
.
web_javascript
,
TargetPlatform
.
web_javascript
,
buildInfo:
debuggingOptions
.
buildInfo
,
applicationBinary:
null
,
applicationBinary:
null
,
);
);
if
(
package
==
null
)
{
if
(
package
==
null
)
{
...
...
packages/flutter_tools/lib/src/commands/build_ios.dart
View file @
9c87b324
...
@@ -64,7 +64,11 @@ class BuildIOSCommand extends BuildSubCommand {
...
@@ -64,7 +64,11 @@ class BuildIOSCommand extends BuildSubCommand {
throwToolExit
(
'Building for iOS is only supported on the Mac.'
);
throwToolExit
(
'Building for iOS is only supported on the Mac.'
);
}
}
final
BuildableIOSApp
app
=
await
applicationPackages
.
getPackageForPlatform
(
TargetPlatform
.
ios
)
as
BuildableIOSApp
;
final
BuildInfo
buildInfo
=
getBuildInfo
();
final
BuildableIOSApp
app
=
await
applicationPackages
.
getPackageForPlatform
(
TargetPlatform
.
ios
,
buildInfo
,
)
as
BuildableIOSApp
;
if
(
app
==
null
)
{
if
(
app
==
null
)
{
throwToolExit
(
'Application not configured for iOS'
);
throwToolExit
(
'Application not configured for iOS'
);
...
@@ -76,7 +80,6 @@ class BuildIOSCommand extends BuildSubCommand {
...
@@ -76,7 +80,6 @@ class BuildIOSCommand extends BuildSubCommand {
globals
.
printStatus
(
'Warning: Building for device with codesigning disabled. You will '
globals
.
printStatus
(
'Warning: Building for device with codesigning disabled. You will '
'have to manually codesign before deploying to device.'
);
'have to manually codesign before deploying to device.'
);
}
}
final
BuildInfo
buildInfo
=
getBuildInfo
();
if
(
forSimulator
&&
!
buildInfo
.
supportsSimulator
)
{
if
(
forSimulator
&&
!
buildInfo
.
supportsSimulator
)
{
throwToolExit
(
'
${toTitleCase(buildInfo.friendlyModeName)}
mode is not supported for simulators.'
);
throwToolExit
(
'
${toTitleCase(buildInfo.friendlyModeName)}
mode is not supported for simulators.'
);
}
}
...
...
packages/flutter_tools/lib/src/commands/build_ios_framework.dart
View file @
9c87b324
...
@@ -181,8 +181,8 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
...
@@ -181,8 +181,8 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
final
Directory
outputDirectory
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
absolute
(
globals
.
fs
.
path
.
normalize
(
outputArgument
)));
final
Directory
outputDirectory
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
absolute
(
globals
.
fs
.
path
.
normalize
(
outputArgument
)));
final
String
productBundleIdentifier
=
await
_project
.
ios
.
productBundleIdentifier
;
for
(
final
BuildInfo
buildInfo
in
buildInfos
)
{
for
(
final
BuildInfo
buildInfo
in
buildInfos
)
{
final
String
productBundleIdentifier
=
await
_project
.
ios
.
productBundleIdentifier
(
buildInfo
);
globals
.
printStatus
(
'Building frameworks for
$productBundleIdentifier
in
${getNameForBuildMode(buildInfo.mode)}
mode...'
);
globals
.
printStatus
(
'Building frameworks for
$productBundleIdentifier
in
${getNameForBuildMode(buildInfo.mode)}
mode...'
);
final
String
xcodeBuildConfiguration
=
toTitleCase
(
getNameForBuildMode
(
buildInfo
.
mode
));
final
String
xcodeBuildConfiguration
=
toTitleCase
(
getNameForBuildMode
(
buildInfo
.
mode
));
final
Directory
modeDirectory
=
outputDirectory
.
childDirectory
(
xcodeBuildConfiguration
);
final
Directory
modeDirectory
=
outputDirectory
.
childDirectory
(
xcodeBuildConfiguration
);
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
9c87b324
...
@@ -404,7 +404,7 @@ Future<LaunchResult> _startApp(DriveCommand command, Uri webUri) async {
...
@@ -404,7 +404,7 @@ Future<LaunchResult> _startApp(DriveCommand command, Uri webUri) async {
await
appStopper
(
command
);
await
appStopper
(
command
);
final
ApplicationPackage
package
=
await
command
.
applicationPackages
final
ApplicationPackage
package
=
await
command
.
applicationPackages
.
getPackageForPlatform
(
await
command
.
device
.
targetPlatform
);
.
getPackageForPlatform
(
await
command
.
device
.
targetPlatform
,
command
.
getBuildInfo
()
);
if
(
command
.
shouldBuild
)
{
if
(
command
.
shouldBuild
)
{
globals
.
printTrace
(
'Installing application package.'
);
globals
.
printTrace
(
'Installing application package.'
);
...
@@ -497,7 +497,10 @@ void restoreAppStopper() {
...
@@ -497,7 +497,10 @@ void restoreAppStopper() {
Future
<
bool
>
_stopApp
(
DriveCommand
command
)
async
{
Future
<
bool
>
_stopApp
(
DriveCommand
command
)
async
{
globals
.
printTrace
(
'Stopping application.'
);
globals
.
printTrace
(
'Stopping application.'
);
final
ApplicationPackage
package
=
await
command
.
applicationPackages
.
getPackageForPlatform
(
await
command
.
device
.
targetPlatform
);
final
ApplicationPackage
package
=
await
command
.
applicationPackages
.
getPackageForPlatform
(
await
command
.
device
.
targetPlatform
,
command
.
getBuildInfo
(),
);
final
bool
stopped
=
await
command
.
device
.
stopApp
(
package
);
final
bool
stopped
=
await
command
.
device
.
stopApp
(
package
);
await
command
.
_deviceLogSubscription
?.
cancel
();
await
command
.
_deviceLogSubscription
?.
cancel
();
return
stopped
;
return
stopped
;
...
...
packages/flutter_tools/lib/src/commands/install.dart
View file @
9c87b324
...
@@ -43,7 +43,10 @@ class InstallCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts
...
@@ -43,7 +43,10 @@ class InstallCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts
@override
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
Future
<
FlutterCommandResult
>
runCommand
()
async
{
final
ApplicationPackage
package
=
await
applicationPackages
.
getPackageForPlatform
(
await
device
.
targetPlatform
);
final
ApplicationPackage
package
=
await
applicationPackages
.
getPackageForPlatform
(
await
device
.
targetPlatform
,
null
,
// Build info isn't relevant for install, will use whatever bundle was built last.
);
Cache
.
releaseLockEarly
();
Cache
.
releaseLockEarly
();
...
...
packages/flutter_tools/lib/src/ios/code_signing.dart
View file @
9c87b324
...
@@ -13,6 +13,7 @@ import '../base/common.dart';
...
@@ -13,6 +13,7 @@ import '../base/common.dart';
import
'../base/io.dart'
;
import
'../base/io.dart'
;
import
'../base/logger.dart'
;
import
'../base/logger.dart'
;
import
'../base/process.dart'
;
import
'../base/process.dart'
;
import
'../build_info.dart'
;
import
'../convert.dart'
show
utf8
;
import
'../convert.dart'
show
utf8
;
import
'../globals.dart'
as
globals
;
import
'../globals.dart'
as
globals
;
...
@@ -101,8 +102,9 @@ Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({
...
@@ -101,8 +102,9 @@ Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({
@required
BuildableIOSApp
iosApp
,
@required
BuildableIOSApp
iosApp
,
@required
ProcessManager
processManager
,
@required
ProcessManager
processManager
,
@required
Logger
logger
,
@required
Logger
logger
,
@required
BuildInfo
buildInfo
,
})
async
{
})
async
{
final
Map
<
String
,
String
>
buildSettings
=
await
iosApp
.
project
.
buildSettings
;
final
Map
<
String
,
String
>
buildSettings
=
await
iosApp
.
project
.
buildSettings
ForBuildInfo
(
buildInfo
)
;
if
(
buildSettings
==
null
)
{
if
(
buildSettings
==
null
)
{
return
null
;
return
null
;
}
}
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
9c87b324
...
@@ -111,12 +111,6 @@ Future<XcodeBuildResult> buildXcodeProject({
...
@@ -111,12 +111,6 @@ Future<XcodeBuildResult> buildXcodeProject({
await
removeFinderExtendedAttributes
(
app
.
project
.
hostAppRoot
,
processUtils
,
globals
.
logger
);
await
removeFinderExtendedAttributes
(
app
.
project
.
hostAppRoot
,
processUtils
,
globals
.
logger
);
final
XcodeProjectInfo
projectInfo
=
await
globals
.
xcodeProjectInterpreter
.
getInfo
(
app
.
project
.
hostAppRoot
.
path
);
final
XcodeProjectInfo
projectInfo
=
await
globals
.
xcodeProjectInterpreter
.
getInfo
(
app
.
project
.
hostAppRoot
.
path
);
if
(!
projectInfo
.
targets
.
contains
(
'Runner'
))
{
globals
.
printError
(
'The Xcode project does not define target "Runner" which is needed by Flutter tooling.'
);
globals
.
printError
(
'Open Xcode to fix the problem:'
);
globals
.
printError
(
' open ios/Runner.xcworkspace'
);
return
XcodeBuildResult
(
success:
false
);
}
final
String
scheme
=
projectInfo
.
schemeFor
(
buildInfo
);
final
String
scheme
=
projectInfo
.
schemeFor
(
buildInfo
);
if
(
scheme
==
null
)
{
if
(
scheme
==
null
)
{
globals
.
printError
(
''
);
globals
.
printError
(
''
);
...
@@ -180,7 +174,8 @@ Future<XcodeBuildResult> buildXcodeProject({
...
@@ -180,7 +174,8 @@ Future<XcodeBuildResult> buildXcodeProject({
autoSigningConfigs
=
await
getCodeSigningIdentityDevelopmentTeam
(
autoSigningConfigs
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
,
iosApp:
app
,
processManager:
globals
.
processManager
,
processManager:
globals
.
processManager
,
logger:
globals
.
logger
logger:
globals
.
logger
,
buildInfo:
buildInfo
,
);
);
}
}
...
@@ -229,7 +224,10 @@ Future<XcodeBuildResult> buildXcodeProject({
...
@@ -229,7 +224,10 @@ Future<XcodeBuildResult> buildXcodeProject({
}
}
// Check if the project contains a watchOS companion app.
// Check if the project contains a watchOS companion app.
final
bool
hasWatchCompanion
=
await
app
.
project
.
containsWatchCompanion
(
projectInfo
.
targets
);
final
bool
hasWatchCompanion
=
await
app
.
project
.
containsWatchCompanion
(
projectInfo
.
targets
,
buildInfo
,
);
if
(
hasWatchCompanion
)
{
if
(
hasWatchCompanion
)
{
// The -sdk argument has to be omitted if a watchOS companion app exists.
// The -sdk argument has to be omitted if a watchOS companion app exists.
// Otherwise the build will fail as WatchKit dependencies cannot be build using the iOS SDK.
// Otherwise the build will fail as WatchKit dependencies cannot be build using the iOS SDK.
...
...
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
9c87b324
...
@@ -309,9 +309,12 @@ class XcodeProjectInterpreter {
...
@@ -309,9 +309,12 @@ class XcodeProjectInterpreter {
/// Asynchronously retrieve xcode build settings. This one is preferred for
/// Asynchronously retrieve xcode build settings. This one is preferred for
/// new call-sites.
/// new call-sites.
///
/// If [scheme] is null, xcodebuild will return build settings for the first discovered
/// target (by default this is Runner).
Future
<
Map
<
String
,
String
>>
getBuildSettings
(
Future
<
Map
<
String
,
String
>>
getBuildSettings
(
String
projectPath
,
String
projectPath
,
{
String
target
,
{
String
scheme
,
Duration
timeout
=
const
Duration
(
minutes:
1
),
Duration
timeout
=
const
Duration
(
minutes:
1
),
})
async
{
})
async
{
final
Status
status
=
Status
.
withSpinner
(
final
Status
status
=
Status
.
withSpinner
(
...
@@ -324,8 +327,8 @@ class XcodeProjectInterpreter {
...
@@ -324,8 +327,8 @@ class XcodeProjectInterpreter {
_executable
,
_executable
,
'-project'
,
'-project'
,
_fileSystem
.
path
.
absolute
(
projectPath
),
_fileSystem
.
path
.
absolute
(
projectPath
),
'-target'
,
if
(
scheme
!=
null
)
target
,
...<
String
>[
'-scheme'
,
scheme
]
,
'-showBuildSettings'
,
'-showBuildSettings'
,
...
environmentVariablesAsXcodeBuildSettings
(
_platform
)
...
environmentVariablesAsXcodeBuildSettings
(
_platform
)
];
];
...
@@ -465,7 +468,6 @@ class XcodeProjectInfo {
...
@@ -465,7 +468,6 @@ class XcodeProjectInfo {
final
List
<
String
>
buildConfigurations
;
final
List
<
String
>
buildConfigurations
;
final
List
<
String
>
schemes
;
final
List
<
String
>
schemes
;
bool
get
definesCustomTargets
=>
!(
targets
.
contains
(
'Runner'
)
&&
targets
.
length
==
1
);
bool
get
definesCustomSchemes
=>
!(
schemes
.
contains
(
'Runner'
)
&&
schemes
.
length
==
1
);
bool
get
definesCustomSchemes
=>
!(
schemes
.
contains
(
'Runner'
)
&&
schemes
.
length
==
1
);
bool
get
definesCustomBuildConfigurations
{
bool
get
definesCustomBuildConfigurations
{
return
!(
buildConfigurations
.
contains
(
'Debug'
)
&&
return
!(
buildConfigurations
.
contains
(
'Debug'
)
&&
...
@@ -475,7 +477,7 @@ class XcodeProjectInfo {
...
@@ -475,7 +477,7 @@ class XcodeProjectInfo {
/// The expected scheme for [buildInfo].
/// The expected scheme for [buildInfo].
static
String
expectedSchemeFor
(
BuildInfo
buildInfo
)
{
static
String
expectedSchemeFor
(
BuildInfo
buildInfo
)
{
return
toTitleCase
(
buildInfo
.
flavor
??
'runner'
);
return
toTitleCase
(
buildInfo
?
.
flavor
??
'runner'
);
}
}
/// The expected build configuration for [buildInfo] and [scheme].
/// The expected build configuration for [buildInfo] and [scheme].
...
...
packages/flutter_tools/lib/src/macos/cocoapods.dart
View file @
9c87b324
...
@@ -267,7 +267,6 @@ class CocoaPods {
...
@@ -267,7 +267,6 @@ class CocoaPods {
}
else
{
}
else
{
final
bool
isSwift
=
(
await
_xcodeProjectInterpreter
.
getBuildSettings
(
final
bool
isSwift
=
(
await
_xcodeProjectInterpreter
.
getBuildSettings
(
runnerProject
.
path
,
runnerProject
.
path
,
'Runner'
,
)).
containsKey
(
'SWIFT_VERSION'
);
)).
containsKey
(
'SWIFT_VERSION'
);
podfileTemplateName
=
isSwift
?
'Podfile-ios-swift'
:
'Podfile-ios-objc'
;
podfileTemplateName
=
isSwift
?
'Podfile-ios-swift'
:
'Podfile-ios-objc'
;
}
}
...
...
packages/flutter_tools/lib/src/project.dart
View file @
9c87b324
...
@@ -102,11 +102,14 @@ class FlutterProject {
...
@@ -102,11 +102,14 @@ class FlutterProject {
/// Gradle group ID.
/// Gradle group ID.
Future
<
Set
<
String
>>
get
organizationNames
async
{
Future
<
Set
<
String
>>
get
organizationNames
async
{
final
List
<
String
>
candidates
=
<
String
>[
final
List
<
String
>
candidates
=
<
String
>[
await
ios
.
productBundleIdentifier
,
// Don't require iOS build info, this method is only
// used during create as best-effort, use the
// default target bundle identifier.
await
ios
.
productBundleIdentifier
(
null
),
android
.
applicationId
,
android
.
applicationId
,
android
.
group
,
android
.
group
,
example
.
android
.
applicationId
,
example
.
android
.
applicationId
,
await
example
.
ios
.
productBundleIdentifier
,
await
example
.
ios
.
productBundleIdentifier
(
null
)
,
];
];
return
Set
<
String
>.
of
(
candidates
return
Set
<
String
>.
of
(
candidates
.
map
<
String
>(
_organizationNameFromPackageName
)
.
map
<
String
>(
_organizationNameFromPackageName
)
...
@@ -411,11 +414,11 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
...
@@ -411,11 +414,11 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
/// The product bundle identifier of the host app, or null if not set or if
/// The product bundle identifier of the host app, or null if not set or if
/// iOS tooling needed to read it is not installed.
/// iOS tooling needed to read it is not installed.
Future<String>
get productBundleIdentifier
async =>
Future<String>
productBundleIdentifier(BuildInfo buildInfo)
async =>
_productBundleIdentifier ??= await _parseProductBundleIdentifier();
_productBundleIdentifier ??= await _parseProductBundleIdentifier(
buildInfo
);
String _productBundleIdentifier;
String _productBundleIdentifier;
Future<String> _parseProductBundleIdentifier() async {
Future<String> _parseProductBundleIdentifier(
BuildInfo buildInfo
) async {
String fromPlist;
String fromPlist;
final File defaultInfoPlist = defaultHostInfoPlist;
final File defaultInfoPlist = defaultHostInfoPlist;
// Users can change the location of the Info.plist.
// Users can change the location of the Info.plist.
...
@@ -434,7 +437,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
...
@@ -434,7 +437,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
return fromPlist;
return fromPlist;
}
}
}
}
final Map<String, String> allBuildSettings = await buildSettings;
final Map<String, String> allBuildSettings = await buildSettings
ForBuildInfo(buildInfo)
;
if (allBuildSettings != null) {
if (allBuildSettings != null) {
if (fromPlist != null) {
if (fromPlist != null) {
// Perform variable substitution using build settings.
// Perform variable substitution using build settings.
...
@@ -458,18 +461,18 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
...
@@ -458,18 +461,18 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
}
}
/// The bundle name of the host app, `My App.app`.
/// The bundle name of the host app, `My App.app`.
Future<String>
get hostAppBundleName
async =>
Future<String>
hostAppBundleName(BuildInfo buildInfo)
async =>
_hostAppBundleName ??= await _parseHostAppBundleName();
_hostAppBundleName ??= await _parseHostAppBundleName(
buildInfo
);
String _hostAppBundleName;
String _hostAppBundleName;
Future<String> _parseHostAppBundleName() async {
Future<String> _parseHostAppBundleName(
BuildInfo buildInfo
) async {
// The product name and bundle name are derived from the display name, which the user
// The product name and bundle name are derived from the display name, which the user
// is instructed to change in Xcode as part of deploying to the App Store.
// is instructed to change in Xcode as part of deploying to the App Store.
// https://flutter.dev/docs/deployment/ios#review-xcode-project-settings
// https://flutter.dev/docs/deployment/ios#review-xcode-project-settings
// The only source of truth for the name is Xcode'
s
interpretation
of
the
build
settings
.
// The only source of truth for the name is Xcode'
s
interpretation
of
the
build
settings
.
String
productName
;
String
productName
;
if
(
globals
.
xcodeProjectInterpreter
.
isInstalled
)
{
if
(
globals
.
xcodeProjectInterpreter
.
isInstalled
)
{
final
Map
<
String
,
String
>
xcodeBuildSettings
=
await
buildSettings
;
final
Map
<
String
,
String
>
xcodeBuildSettings
=
await
buildSettings
ForBuildInfo
(
buildInfo
)
;
if
(
xcodeBuildSettings
!=
null
)
{
if
(
xcodeBuildSettings
!=
null
)
{
productName
=
xcodeBuildSettings
[
'FULL_PRODUCT_NAME'
];
productName
=
xcodeBuildSettings
[
'FULL_PRODUCT_NAME'
];
}
}
...
@@ -483,17 +486,20 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
...
@@ -483,17 +486,20 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
/// The build settings for the host app of this project, as a detached map.
/// The build settings for the host app of this project, as a detached map.
///
///
/// Returns null, if iOS tooling is unavailable.
/// Returns null, if iOS tooling is unavailable.
Future
<
Map
<
String
,
String
>>
get
buildSettings
async
=>
Future
<
Map
<
String
,
String
>>
buildSettingsForBuildInfo
(
BuildInfo
buildInfo
)
async
{
_buildSettings
??=
await
_xcodeProjectBuildSettings
();
_buildSettingsByScheme
??=
<
String
,
Map
<
String
,
String
>>{};
Map
<
String
,
String
>
_buildSettings
;
final
String
scheme
=
xcode
.
XcodeProjectInfo
.
expectedSchemeFor
(
buildInfo
);
return
_buildSettingsByScheme
[
scheme
]
??=
await
_xcodeProjectBuildSettings
(
scheme
);
}
Map
<
String
,
Map
<
String
,
String
>>
_buildSettingsByScheme
;
Future
<
Map
<
String
,
String
>>
_xcodeProjectBuildSettings
()
async
{
Future
<
Map
<
String
,
String
>>
_xcodeProjectBuildSettings
(
String
scheme
)
async
{
if
(!
globals
.
xcodeProjectInterpreter
.
isInstalled
)
{
if
(!
globals
.
xcodeProjectInterpreter
.
isInstalled
)
{
return
null
;
return
null
;
}
}
final
Map
<
String
,
String
>
buildSettings
=
await
globals
.
xcodeProjectInterpreter
.
getBuildSettings
(
final
Map
<
String
,
String
>
buildSettings
=
await
globals
.
xcodeProjectInterpreter
.
getBuildSettings
(
xcodeProject
.
path
,
xcodeProject
.
path
,
_hostAppProjectNa
me
,
scheme:
sche
me
,
);
);
if
(
buildSettings
!=
null
&&
buildSettings
.
isNotEmpty
)
{
if
(
buildSettings
!=
null
&&
buildSettings
.
isNotEmpty
)
{
// No timeouts, flakes, or errors.
// No timeouts, flakes, or errors.
...
@@ -511,8 +517,8 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
...
@@ -511,8 +517,8 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
}
}
/// Check if one the [targets] of the project is a watchOS companion app target.
/// Check if one the [targets] of the project is a watchOS companion app target.
Future
<
bool
>
containsWatchCompanion
(
List
<
String
>
targets
)
async
{
Future
<
bool
>
containsWatchCompanion
(
List
<
String
>
targets
,
BuildInfo
buildInfo
)
async
{
final
String
bundleIdentifier
=
await
productBundleIdentifier
;
final
String
bundleIdentifier
=
await
productBundleIdentifier
(
buildInfo
)
;
// A bundle identifier is required for a companion app.
// A bundle identifier is required for a companion app.
if
(
bundleIdentifier
==
null
)
{
if
(
bundleIdentifier
==
null
)
{
return
false
;
return
false
;
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
9c87b324
...
@@ -469,6 +469,7 @@ class FlutterDevice {
...
@@ -469,6 +469,7 @@ class FlutterDevice {
final
TargetPlatform
targetPlatform
=
await
device
.
targetPlatform
;
final
TargetPlatform
targetPlatform
=
await
device
.
targetPlatform
;
package
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
package
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
targetPlatform
,
targetPlatform
,
buildInfo:
hotRunner
.
debuggingOptions
.
buildInfo
,
applicationBinary:
hotRunner
.
applicationBinary
,
applicationBinary:
hotRunner
.
applicationBinary
,
);
);
...
@@ -524,6 +525,7 @@ class FlutterDevice {
...
@@ -524,6 +525,7 @@ class FlutterDevice {
final
TargetPlatform
targetPlatform
=
await
device
.
targetPlatform
;
final
TargetPlatform
targetPlatform
=
await
device
.
targetPlatform
;
package
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
package
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
targetPlatform
,
targetPlatform
,
buildInfo:
coldRunner
.
debuggingOptions
.
buildInfo
,
applicationBinary:
coldRunner
.
applicationBinary
,
applicationBinary:
coldRunner
.
applicationBinary
,
);
);
...
...
packages/flutter_tools/test/commands.shard/permeable/create_test.dart
View file @
9c87b324
...
@@ -11,6 +11,7 @@ import 'package:flutter_tools/src/base/file_system.dart';
...
@@ -11,6 +11,7 @@ import 'package:flutter_tools/src/base/file_system.dart';
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/net.dart'
;
import
'package:flutter_tools/src/base/net.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/create.dart'
;
import
'package:flutter_tools/src/commands/create.dart'
;
import
'package:flutter_tools/src/dart/pub.dart'
;
import
'package:flutter_tools/src/dart/pub.dart'
;
...
@@ -996,7 +997,19 @@ void main() {
...
@@ -996,7 +997,19 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--template=app'
,
'--no-pub'
,
'--org'
,
'com.example'
,
tmpProjectDir
]);
await
runner
.
run
(<
String
>[
'create'
,
'--template=app'
,
'--no-pub'
,
'--org'
,
'com.example'
,
tmpProjectDir
]);
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
globals
.
fs
.
directory
(
tmpProjectDir
));
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
globals
.
fs
.
directory
(
tmpProjectDir
));
expect
(
expect
(
await
project
.
ios
.
productBundleIdentifier
,
await
project
.
ios
.
productBundleIdentifier
(
BuildInfo
.
debug
),
'com.example.helloFlutter'
,
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
BuildInfo
.
profile
),
'com.example.helloFlutter'
,
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
BuildInfo
.
release
),
'com.example.helloFlutter'
,
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
null
),
'com.example.helloFlutter'
,
'com.example.helloFlutter'
,
);
);
expect
(
expect
(
...
@@ -1008,7 +1021,7 @@ void main() {
...
@@ -1008,7 +1021,7 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--template=app'
,
'--no-pub'
,
'--org'
,
'abc^*.1#@'
,
tmpProjectDir
]);
await
runner
.
run
(<
String
>[
'create'
,
'--template=app'
,
'--no-pub'
,
'--org'
,
'abc^*.1#@'
,
tmpProjectDir
]);
project
=
FlutterProject
.
fromDirectory
(
globals
.
fs
.
directory
(
tmpProjectDir
));
project
=
FlutterProject
.
fromDirectory
(
globals
.
fs
.
directory
(
tmpProjectDir
));
expect
(
expect
(
await
project
.
ios
.
productBundleIdentifier
,
await
project
.
ios
.
productBundleIdentifier
(
BuildInfo
.
debug
)
,
'abc.1.testAbc'
,
'abc.1.testAbc'
,
);
);
expect
(
expect
(
...
@@ -1020,7 +1033,7 @@ void main() {
...
@@ -1020,7 +1033,7 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--template=app'
,
'--no-pub'
,
'--org'
,
'#+^%'
,
tmpProjectDir
]);
await
runner
.
run
(<
String
>[
'create'
,
'--template=app'
,
'--no-pub'
,
'--org'
,
'#+^%'
,
tmpProjectDir
]);
project
=
FlutterProject
.
fromDirectory
(
globals
.
fs
.
directory
(
tmpProjectDir
));
project
=
FlutterProject
.
fromDirectory
(
globals
.
fs
.
directory
(
tmpProjectDir
));
expect
(
expect
(
await
project
.
ios
.
productBundleIdentifier
,
await
project
.
ios
.
productBundleIdentifier
(
BuildInfo
.
debug
)
,
'flutterProject.untitled'
,
'flutterProject.untitled'
,
);
);
expect
(
expect
(
...
@@ -1154,7 +1167,7 @@ void main() {
...
@@ -1154,7 +1167,7 @@ void main() {
await
_createProject
(
projectDir
,
<
String
>[],
<
String
>[]);
await
_createProject
(
projectDir
,
<
String
>[],
<
String
>[]);
final
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
projectDir
);
final
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
projectDir
);
expect
(
expect
(
await
project
.
ios
.
productBundleIdentifier
,
await
project
.
ios
.
productBundleIdentifier
(
BuildInfo
.
debug
)
,
'com.bar.foo.flutterProject'
,
'com.bar.foo.flutterProject'
,
);
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
...
@@ -1203,7 +1216,7 @@ void main() {
...
@@ -1203,7 +1216,7 @@ void main() {
await
_createProject
(
projectDir
,
<
String
>[
'--no-pub'
],
<
String
>[]);
await
_createProject
(
projectDir
,
<
String
>[
'--no-pub'
],
<
String
>[]);
final
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
projectDir
);
final
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
projectDir
);
expect
(
expect
(
await
project
.
ios
.
productBundleIdentifier
,
await
project
.
ios
.
productBundleIdentifier
(
BuildInfo
.
debug
)
,
'com.bar.foo.flutterProject'
,
'com.bar.foo.flutterProject'
,
);
);
});
});
...
@@ -1236,7 +1249,7 @@ void main() {
...
@@ -1236,7 +1249,7 @@ void main() {
);
);
final
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
projectDir
);
final
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
projectDir
);
expect
(
expect
(
await
project
.
example
.
ios
.
productBundleIdentifier
,
await
project
.
example
.
ios
.
productBundleIdentifier
(
BuildInfo
.
debug
)
,
'com.bar.foo.flutterProjectExample'
,
'com.bar.foo.flutterProjectExample'
,
);
);
});
});
...
...
packages/flutter_tools/test/general.shard/application_package_test.dart
View file @
9c87b324
...
@@ -91,6 +91,7 @@ void main() {
...
@@ -91,6 +91,7 @@ void main() {
final
ApplicationPackage
applicationPackage
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
final
ApplicationPackage
applicationPackage
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
TargetPlatform
.
android_arm
,
TargetPlatform
.
android_arm
,
buildInfo:
null
,
applicationBinary:
apkFile
,
applicationBinary:
apkFile
,
);
);
expect
(
applicationPackage
.
name
,
'app.apk'
);
expect
(
applicationPackage
.
name
,
'app.apk'
);
...
@@ -117,6 +118,7 @@ void main() {
...
@@ -117,6 +118,7 @@ void main() {
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
TargetPlatform
.
android_arm
,
TargetPlatform
.
android_arm
,
buildInfo:
null
,
applicationBinary:
globals
.
fs
.
file
(
'app.apk'
),
applicationBinary:
globals
.
fs
.
file
(
'app.apk'
),
);
);
verify
(
verify
(
...
@@ -134,6 +136,7 @@ void main() {
...
@@ -134,6 +136,7 @@ void main() {
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
TargetPlatform
.
android_arm
,
TargetPlatform
.
android_arm
,
buildInfo:
null
,
);
);
verifyNever
(
verifyNever
(
mockProcessManager
.
run
(
mockProcessManager
.
run
(
...
@@ -328,7 +331,7 @@ void main() {
...
@@ -328,7 +331,7 @@ void main() {
globals
.
fs
.
file
(
'pubspec.yaml'
).
createSync
();
globals
.
fs
.
file
(
'pubspec.yaml'
).
createSync
();
globals
.
fs
.
file
(
'.packages'
).
createSync
();
globals
.
fs
.
file
(
'.packages'
).
createSync
();
final
BuildableIOSApp
iosApp
=
await
IOSApp
.
fromIosProject
(
final
BuildableIOSApp
iosApp
=
await
IOSApp
.
fromIosProject
(
FlutterProject
.
fromDirectory
(
globals
.
fs
.
currentDirectory
).
ios
)
as
BuildableIOSApp
;
FlutterProject
.
fromDirectory
(
globals
.
fs
.
currentDirectory
).
ios
,
null
)
as
BuildableIOSApp
;
expect
(
iosApp
,
null
);
expect
(
iosApp
,
null
);
},
overrides:
overrides
);
},
overrides:
overrides
);
...
@@ -338,7 +341,7 @@ void main() {
...
@@ -338,7 +341,7 @@ void main() {
globals
.
fs
.
file
(
'.packages'
).
createSync
();
globals
.
fs
.
file
(
'.packages'
).
createSync
();
globals
.
fs
.
file
(
'ios/FooBar.xcodeproj'
).
createSync
(
recursive:
true
);
globals
.
fs
.
file
(
'ios/FooBar.xcodeproj'
).
createSync
(
recursive:
true
);
final
BuildableIOSApp
iosApp
=
await
IOSApp
.
fromIosProject
(
final
BuildableIOSApp
iosApp
=
await
IOSApp
.
fromIosProject
(
FlutterProject
.
fromDirectory
(
globals
.
fs
.
currentDirectory
).
ios
)
as
BuildableIOSApp
;
FlutterProject
.
fromDirectory
(
globals
.
fs
.
currentDirectory
).
ios
,
null
)
as
BuildableIOSApp
;
expect
(
iosApp
,
null
);
expect
(
iosApp
,
null
);
},
overrides:
overrides
);
},
overrides:
overrides
);
...
@@ -348,7 +351,7 @@ void main() {
...
@@ -348,7 +351,7 @@ void main() {
globals
.
fs
.
file
(
'.packages'
).
createSync
();
globals
.
fs
.
file
(
'.packages'
).
createSync
();
globals
.
fs
.
file
(
'ios/Runner.xcodeproj'
).
createSync
(
recursive:
true
);
globals
.
fs
.
file
(
'ios/Runner.xcodeproj'
).
createSync
(
recursive:
true
);
final
BuildableIOSApp
iosApp
=
await
IOSApp
.
fromIosProject
(
final
BuildableIOSApp
iosApp
=
await
IOSApp
.
fromIosProject
(
FlutterProject
.
fromDirectory
(
globals
.
fs
.
currentDirectory
).
ios
)
as
BuildableIOSApp
;
FlutterProject
.
fromDirectory
(
globals
.
fs
.
currentDirectory
).
ios
,
null
)
as
BuildableIOSApp
;
expect
(
iosApp
,
null
);
expect
(
iosApp
,
null
);
},
overrides:
overrides
);
},
overrides:
overrides
);
...
...
packages/flutter_tools/test/general.shard/ios/code_signing_test.dart
View file @
9c87b324
...
@@ -6,6 +6,7 @@ import 'dart:async';
...
@@ -6,6 +6,7 @@ import 'dart:async';
import
'dart:convert'
;
import
'dart:convert'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:flutter_tools/src/application_package.dart'
;
import
'package:flutter_tools/src/application_package.dart'
;
...
@@ -36,28 +37,32 @@ void main() {
...
@@ -36,28 +37,32 @@ void main() {
when
(
mockProcessManager
.
canRun
(
any
)).
thenReturn
(
true
);
when
(
mockProcessManager
.
canRun
(
any
)).
thenReturn
(
true
);
mockConfig
=
MockConfig
();
mockConfig
=
MockConfig
();
mockIosProject
=
MockIosProject
();
mockIosProject
=
MockIosProject
();
when
(
mockIosProject
.
buildSettings
).
thenAnswer
((
_
)
{
when
(
mockIosProject
.
buildSettings
ForBuildInfo
(
any
)
).
thenAnswer
((
_
)
{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
'For our purposes'
:
'a non-empty build settings map is valid'
,
'For our purposes'
:
'a non-empty build settings map is valid'
,
});
});
});
});
testTerminal
=
TestTerminal
();
testTerminal
=
TestTerminal
();
testTerminal
.
usesTerminalUi
=
true
;
testTerminal
.
usesTerminalUi
=
true
;
app
=
await
BuildableIOSApp
.
fromProject
(
mockIosProject
);
app
=
await
BuildableIOSApp
.
fromProject
(
mockIosProject
,
null
);
});
});
testWithoutContext
(
'No auto-sign if Xcode project settings are not available'
,
()
async
{
testWithoutContext
(
'No auto-sign if Xcode project settings are not available'
,
()
async
{
when
(
mockIosProject
.
buildSettings
).
thenReturn
(
null
);
const
BuildInfo
buildInfo
=
BuildInfo
.
debug
;
when
(
mockIosProject
.
buildSettingsForBuildInfo
(
any
)).
thenReturn
(
null
);
final
Map
<
String
,
String
>
signingConfigs
=
await
getCodeSigningIdentityDevelopmentTeam
(
final
Map
<
String
,
String
>
signingConfigs
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
buildInfo
,
);
);
expect
(
signingConfigs
,
isNull
);
expect
(
signingConfigs
,
isNull
);
verify
(
mockIosProject
.
buildSettingsForBuildInfo
(
buildInfo
));
});
});
testWithoutContext
(
'No discovery if development team specified in Xcode project'
,
()
async
{
testWithoutContext
(
'No discovery if development team specified in Xcode project'
,
()
async
{
when
(
mockIosProject
.
buildSettings
).
thenAnswer
((
_
)
{
const
BuildInfo
buildInfo
=
BuildInfo
.
debug
;
when
(
mockIosProject
.
buildSettingsForBuildInfo
(
any
)).
thenAnswer
((
_
)
{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
'DEVELOPMENT_TEAM'
:
'abc'
,
'DEVELOPMENT_TEAM'
:
'abc'
,
});
});
...
@@ -66,11 +71,13 @@ void main() {
...
@@ -66,11 +71,13 @@ void main() {
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
buildInfo
,
);
);
expect
(
signingConfigs
,
isNull
);
expect
(
signingConfigs
,
isNull
);
expect
(
logger
.
statusText
,
equals
(
expect
(
logger
.
statusText
,
equals
(
'Automatically signing iOS for device deployment using specified development team in Xcode project: abc
\n
'
'Automatically signing iOS for device deployment using specified development team in Xcode project: abc
\n
'
));
));
verify
(
mockIosProject
.
buildSettingsForBuildInfo
(
buildInfo
));
});
});
testWithoutContext
(
'No auto-sign if security or openssl not available'
,
()
async
{
testWithoutContext
(
'No auto-sign if security or openssl not available'
,
()
async
{
...
@@ -80,12 +87,14 @@ void main() {
...
@@ -80,12 +87,14 @@ void main() {
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
null
,
);
);
expect
(
signingConfigs
,
isNull
);
expect
(
signingConfigs
,
isNull
);
});
});
testUsingContext
(
'No valid code signing certificates shows instructions'
,
()
async
{
testUsingContext
(
'No valid code signing certificates shows instructions'
,
()
async
{
when
(
mockIosProject
.
buildSettings
).
thenAnswer
((
_
)
{
const
BuildInfo
buildInfo
=
BuildInfo
.
debug
;
when
(
mockIosProject
.
buildSettingsForBuildInfo
(
any
)).
thenAnswer
((
_
)
{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{});
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{});
});
});
when
(
mockProcessManager
.
run
(
when
(
mockProcessManager
.
run
(
...
@@ -108,7 +117,9 @@ void main() {
...
@@ -108,7 +117,9 @@ void main() {
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
buildInfo
,
),
throwsToolExit
(
message:
'No development certificates available to code sign app for device deployment'
));
),
throwsToolExit
(
message:
'No development certificates available to code sign app for device deployment'
));
verify
(
mockIosProject
.
buildSettingsForBuildInfo
(
buildInfo
));
},
},
overrides:
<
Type
,
Generator
>{
overrides:
<
Type
,
Generator
>{
OutputPreferences:
()
=>
OutputPreferences
(
wrapText:
false
),
OutputPreferences:
()
=>
OutputPreferences
(
wrapText:
false
),
...
@@ -172,6 +183,7 @@ void main() {
...
@@ -172,6 +183,7 @@ void main() {
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
null
,
);
);
expect
(
logger
.
statusText
,
contains
(
'iPhone Developer: Profile 1 (1111AAAA11)'
));
expect
(
logger
.
statusText
,
contains
(
'iPhone Developer: Profile 1 (1111AAAA11)'
));
...
@@ -240,6 +252,7 @@ void main() {
...
@@ -240,6 +252,7 @@ void main() {
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
null
,
);
);
}
on
Exception
catch
(
e
)
{
}
on
Exception
catch
(
e
)
{
// This should not throw
// This should not throw
...
@@ -314,6 +327,7 @@ void main() {
...
@@ -314,6 +327,7 @@ void main() {
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
null
,
);
);
expect
(
expect
(
...
@@ -399,6 +413,7 @@ void main() {
...
@@ -399,6 +413,7 @@ void main() {
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
null
,
);
);
expect
(
expect
(
...
@@ -476,6 +491,7 @@ void main() {
...
@@ -476,6 +491,7 @@ void main() {
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
null
,
);
);
expect
(
expect
(
...
@@ -559,6 +575,7 @@ void main() {
...
@@ -559,6 +575,7 @@ void main() {
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
null
,
);
);
expect
(
expect
(
...
@@ -600,6 +617,7 @@ void main() {
...
@@ -600,6 +617,7 @@ void main() {
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
null
,
);
);
expect
(
signingConfigs
,
isNull
);
expect
(
signingConfigs
,
isNull
);
});
});
...
@@ -643,6 +661,7 @@ void main() {
...
@@ -643,6 +661,7 @@ void main() {
iosApp:
app
,
iosApp:
app
,
processManager:
mockProcessManager
,
processManager:
mockProcessManager
,
logger:
logger
,
logger:
logger
,
buildInfo:
null
,
);
);
expect
(
signingConfigs
,
isNull
);
expect
(
signingConfigs
,
isNull
);
},
},
...
...
packages/flutter_tools/test/general.shard/ios/mac_test.dart
View file @
9c87b324
...
@@ -395,7 +395,7 @@ Exited (sigterm)''',
...
@@ -395,7 +395,7 @@ Exited (sigterm)''',
final MockFile pbxprojFile = MockFile();
final MockFile pbxprojFile = MockFile();
when(project.xcodeProjectInfoFile).thenReturn(pbxprojFile);
when(project.xcodeProjectInfoFile).thenReturn(pbxprojFile);
when(project.hostAppBundleName).thenAnswer((_) => Future<String>.value('UnitTestRunner.app'));
when(project.hostAppBundleName
(any)
).thenAnswer((_) => Future<String>.value('UnitTestRunner.app'));
when(pbxprojFile.readAsLinesSync())
when(pbxprojFile.readAsLinesSync())
.thenAnswer((_) => flutterAssetPbxProjLines);
.thenAnswer((_) => flutterAssetPbxProjLines);
when(pbxprojFile.existsSync())
when(pbxprojFile.existsSync())
...
...
packages/flutter_tools/test/general.shard/ios/simulators_test.dart
View file @
9c87b324
...
@@ -553,7 +553,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
...
@@ -553,7 +553,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
xcode:
mockXcode
,
xcode:
mockXcode
,
);
);
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
),
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
,
null
),
);
);
final
List
<
String
>
lines
=
await
logReader
.
logLines
.
toList
();
final
List
<
String
>
lines
=
await
logReader
.
logLines
.
toList
();
...
@@ -587,7 +587,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
...
@@ -587,7 +587,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
xcode:
mockXcode
,
xcode:
mockXcode
,
);
);
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
),
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
,
null
),
);
);
final
List
<
String
>
lines
=
await
logReader
.
logLines
.
toList
();
final
List
<
String
>
lines
=
await
logReader
.
logLines
.
toList
();
...
@@ -634,7 +634,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
...
@@ -634,7 +634,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
xcode:
mockXcode
,
xcode:
mockXcode
,
);
);
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
),
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
,
null
),
);
);
final
List
<
String
>
lines
=
await
logReader
.
logLines
.
toList
();
final
List
<
String
>
lines
=
await
logReader
.
logLines
.
toList
();
...
@@ -699,7 +699,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
...
@@ -699,7 +699,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
xcode:
mockXcode
,
xcode:
mockXcode
,
);
);
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
),
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
,
null
),
);
);
final
List
<
String
>
lines
=
await
logReader
.
logLines
.
toList
();
final
List
<
String
>
lines
=
await
logReader
.
logLines
.
toList
();
...
...
packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart
View file @
9c87b324
...
@@ -68,7 +68,7 @@ void main() {
...
@@ -68,7 +68,7 @@ void main() {
platform
.
environment
=
const
<
String
,
String
>{};
platform
.
environment
=
const
<
String
,
String
>{};
expect
(
await
xcodeProjectInterpreter
.
getBuildSettings
(
expect
(
await
xcodeProjectInterpreter
.
getBuildSettings
(
''
,
'
'
,
timeout:
delay
),
''
,
scheme:
'Runner
'
,
timeout:
delay
),
const
<
String
,
String
>{});
const
<
String
,
String
>{});
// build settings times out and is killed once, then succeeds.
// build settings times out and is killed once, then succeeds.
verify
(
processManager
.
killPid
(
any
)).
called
(
1
);
verify
(
processManager
.
killPid
(
any
)).
called
(
1
);
...
@@ -246,14 +246,31 @@ void main() {
...
@@ -246,14 +246,31 @@ void main() {
'/usr/bin/xcodebuild'
,
'/usr/bin/xcodebuild'
,
'-project'
,
'-project'
,
'/'
,
'/'
,
'-
target
'
,
'-
scheme
'
,
'
Runner
'
,
'
Free
'
,
'-showBuildSettings'
'-showBuildSettings'
],
],
exitCode:
1
,
exitCode:
1
,
));
));
expect
(
await
xcodeProjectInterpreter
.
getBuildSettings
(
''
,
'Runner'
),
const
<
String
,
String
>{});
expect
(
await
xcodeProjectInterpreter
.
getBuildSettings
(
''
,
scheme:
'Free'
),
const
<
String
,
String
>{});
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
});
testWithoutContext
(
'build settings accepts an empty scheme'
,
()
async
{
platform
.
environment
=
const
<
String
,
String
>{};
fakeProcessManager
.
addCommand
(
const
FakeCommand
(
command:
<
String
>[
'/usr/bin/xcodebuild'
,
'-project'
,
'/'
,
'-showBuildSettings'
],
exitCode:
1
,
));
expect
(
await
xcodeProjectInterpreter
.
getBuildSettings
(
''
),
const
<
String
,
String
>{});
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
});
});
...
@@ -267,14 +284,14 @@ void main() {
...
@@ -267,14 +284,14 @@ void main() {
xcodebuild
,
xcodebuild
,
'-project'
,
'-project'
,
fileSystem
.
path
.
separator
,
fileSystem
.
path
.
separator
,
'-
target
'
,
'-
scheme
'
,
'
Runner
'
,
'
Free
'
,
'-showBuildSettings'
,
'-showBuildSettings'
,
'CODE_SIGN_STYLE=Manual'
,
'CODE_SIGN_STYLE=Manual'
,
'ARCHS=arm64'
'ARCHS=arm64'
],
],
));
));
expect
(
await
xcodeProjectInterpreter
.
getBuildSettings
(
''
,
'Runner
'
),
const
<
String
,
String
>{});
expect
(
await
xcodeProjectInterpreter
.
getBuildSettings
(
''
,
scheme:
'Free
'
),
const
<
String
,
String
>{});
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
});
});
...
@@ -290,7 +307,7 @@ void main() {
...
@@ -290,7 +307,7 @@ void main() {
'-workspace'
,
'-workspace'
,
'workspace_path'
,
'workspace_path'
,
'-scheme'
,
'-scheme'
,
'
Runner
'
,
'
Free
'
,
'-quiet'
,
'-quiet'
,
'clean'
,
'clean'
,
'CODE_SIGN_STYLE=Manual'
,
'CODE_SIGN_STYLE=Manual'
,
...
@@ -298,7 +315,7 @@ void main() {
...
@@ -298,7 +315,7 @@ void main() {
],
],
));
));
await
xcodeProjectInterpreter
.
cleanWorkspace
(
'workspace_path'
,
'
Runner
'
);
await
xcodeProjectInterpreter
.
cleanWorkspace
(
'workspace_path'
,
'
Free
'
);
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
});
});
...
...
packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart
View file @
9c87b324
...
@@ -208,7 +208,7 @@ void main() {
...
@@ -208,7 +208,7 @@ void main() {
});
});
testWithoutContext
(
'creates objective-c Podfile when not present'
,
()
async
{
testWithoutContext
(
'creates objective-c Podfile when not present'
,
()
async
{
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
any
))
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
scheme:
null
,
timeout:
anyNamed
(
'timeout'
)
))
.
thenAnswer
((
_
)
async
=>
<
String
,
String
>{});
.
thenAnswer
((
_
)
async
=>
<
String
,
String
>{});
await
cocoaPodsUnderTest
.
setupPodfile
(
projectUnderTest
.
ios
);
await
cocoaPodsUnderTest
.
setupPodfile
(
projectUnderTest
.
ios
);
...
@@ -216,7 +216,7 @@ void main() {
...
@@ -216,7 +216,7 @@ void main() {
});
});
testUsingContext
(
'creates swift Podfile if swift'
,
()
async
{
testUsingContext
(
'creates swift Podfile if swift'
,
()
async
{
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
any
))
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
scheme:
null
,
timeout:
anyNamed
(
'timeout'
)
))
.
thenAnswer
((
_
)
async
=>
<
String
,
String
>{
.
thenAnswer
((
_
)
async
=>
<
String
,
String
>{
'SWIFT_VERSION'
:
'5.0'
,
'SWIFT_VERSION'
:
'5.0'
,
});
});
...
...
packages/flutter_tools/test/general.shard/project_test.dart
View file @
9c87b324
...
@@ -386,19 +386,19 @@ apply plugin: 'kotlin-android'
...
@@ -386,19 +386,19 @@ apply plugin: 'kotlin-android'
testWithMocks
(
'null, if no build settings or plist entries'
,
()
async
{
testWithMocks
(
'null, if no build settings or plist entries'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
expect
(
await
project
.
ios
.
productBundleIdentifier
,
isNull
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
null
)
,
isNull
);
});
});
testWithMocks
(
'from build settings, if no plist'
,
()
async
{
testWithMocks
(
'from build settings, if no plist'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
any
)).
thenAnswer
(
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
scheme:
anyNamed
(
'scheme'
)
)).
thenAnswer
(
(
_
)
{
(
_
)
{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
});
});
}
}
);
);
expect
(
await
project
.
ios
.
productBundleIdentifier
,
'io.flutter.someProject'
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
null
)
,
'io.flutter.someProject'
);
});
});
testWithMocks
(
'from project file, if no plist or build settings'
,
()
async
{
testWithMocks
(
'from project file, if no plist or build settings'
,
()
async
{
...
@@ -406,19 +406,19 @@ apply plugin: 'kotlin-android'
...
@@ -406,19 +406,19 @@ apply plugin: 'kotlin-android'
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
return
projectFileWithBundleId
(
'io.flutter.someProject'
);
return
projectFileWithBundleId
(
'io.flutter.someProject'
);
});
});
expect
(
await
project
.
ios
.
productBundleIdentifier
,
'io.flutter.someProject'
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
null
)
,
'io.flutter.someProject'
);
});
});
testWithMocks
(
'from plist, if no variables'
,
()
async
{
testWithMocks
(
'from plist, if no variables'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
project
.
ios
.
defaultHostInfoPlist
.
createSync
(
recursive:
true
);
project
.
ios
.
defaultHostInfoPlist
.
createSync
(
recursive:
true
);
when
(
mockPlistUtils
.
getValueFromFile
(
any
,
any
)).
thenReturn
(
'io.flutter.someProject'
);
when
(
mockPlistUtils
.
getValueFromFile
(
any
,
any
)).
thenReturn
(
'io.flutter.someProject'
);
expect
(
await
project
.
ios
.
productBundleIdentifier
,
'io.flutter.someProject'
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
null
)
,
'io.flutter.someProject'
);
});
});
testWithMocks
(
'from build settings and plist, if default variable'
,
()
async
{
testWithMocks
(
'from build settings and plist, if default variable'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
any
)).
thenAnswer
(
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
scheme:
anyNamed
(
'scheme'
)
)).
thenAnswer
(
(
_
)
{
(
_
)
{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
...
@@ -426,13 +426,13 @@ apply plugin: 'kotlin-android'
...
@@ -426,13 +426,13 @@ apply plugin: 'kotlin-android'
}
}
);
);
when
(
mockPlistUtils
.
getValueFromFile
(
any
,
any
)).
thenReturn
(
r'$(PRODUCT_BUNDLE_IDENTIFIER)'
);
when
(
mockPlistUtils
.
getValueFromFile
(
any
,
any
)).
thenReturn
(
r'$(PRODUCT_BUNDLE_IDENTIFIER)'
);
expect
(
await
project
.
ios
.
productBundleIdentifier
,
'io.flutter.someProject'
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
null
)
,
'io.flutter.someProject'
);
});
});
testWithMocks
(
'from build settings and plist, by substitution'
,
()
async
{
testWithMocks
(
'from build settings and plist, by substitution'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
project
.
ios
.
defaultHostInfoPlist
.
createSync
(
recursive:
true
);
project
.
ios
.
defaultHostInfoPlist
.
createSync
(
recursive:
true
);
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
any
)).
thenAnswer
(
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
scheme:
anyNamed
(
'scheme'
)
)).
thenAnswer
(
(
_
)
{
(
_
)
{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
...
@@ -441,28 +441,28 @@ apply plugin: 'kotlin-android'
...
@@ -441,28 +441,28 @@ apply plugin: 'kotlin-android'
}
}
);
);
when
(
mockPlistUtils
.
getValueFromFile
(
any
,
any
)).
thenReturn
(
r'$(PRODUCT_BUNDLE_IDENTIFIER).$(SUFFIX)'
);
when
(
mockPlistUtils
.
getValueFromFile
(
any
,
any
)).
thenReturn
(
r'$(PRODUCT_BUNDLE_IDENTIFIER).$(SUFFIX)'
);
expect
(
await
project
.
ios
.
productBundleIdentifier
,
'io.flutter.someProject.suffix'
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
null
)
,
'io.flutter.someProject.suffix'
);
});
});
testWithMocks
(
'empty surrounded by quotes'
,
()
async
{
testWithMocks
(
'empty surrounded by quotes'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
return
projectFileWithBundleId
(
''
,
qualifier:
'"'
);
return
projectFileWithBundleId
(
''
,
qualifier:
'"'
);
});
});
expect
(
await
project
.
ios
.
productBundleIdentifier
,
''
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
null
)
,
''
);
});
});
testWithMocks
(
'surrounded by double quotes'
,
()
async
{
testWithMocks
(
'surrounded by double quotes'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
return
projectFileWithBundleId
(
'io.flutter.someProject'
,
qualifier:
'"'
);
return
projectFileWithBundleId
(
'io.flutter.someProject'
,
qualifier:
'"'
);
});
});
expect
(
await
project
.
ios
.
productBundleIdentifier
,
'io.flutter.someProject'
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
null
)
,
'io.flutter.someProject'
);
});
});
testWithMocks
(
'surrounded by single quotes'
,
()
async
{
testWithMocks
(
'surrounded by single quotes'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
return
projectFileWithBundleId
(
'io.flutter.someProject'
,
qualifier:
"'"
);
return
projectFileWithBundleId
(
'io.flutter.someProject'
,
qualifier:
"'"
);
});
});
expect
(
await
project
.
ios
.
productBundleIdentifier
,
'io.flutter.someProject'
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
null
)
,
'io.flutter.someProject'
);
});
});
});
});
...
@@ -476,7 +476,7 @@ apply plugin: 'kotlin-android'
...
@@ -476,7 +476,7 @@ apply plugin: 'kotlin-android'
testUsingContext
(
'app product name defaults to Runner.app'
,
()
async
{
testUsingContext
(
'app product name defaults to Runner.app'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
expect
(
await
project
.
ios
.
hostAppBundleName
,
'Runner.app'
);
expect
(
await
project
.
ios
.
hostAppBundleName
(
null
)
,
'Runner.app'
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
@@ -485,13 +485,13 @@ apply plugin: 'kotlin-android'
...
@@ -485,13 +485,13 @@ apply plugin: 'kotlin-android'
testUsingContext
(
'app product name xcodebuild settings'
,
()
async
{
testUsingContext
(
'app product name xcodebuild settings'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
any
)).
thenAnswer
((
_
)
{
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
scheme:
anyNamed
(
'scheme'
)
)).
thenAnswer
((
_
)
{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
'FULL_PRODUCT_NAME'
:
'My App.app'
'FULL_PRODUCT_NAME'
:
'My App.app'
});
});
});
});
expect
(
await
project
.
ios
.
hostAppBundleName
,
'My App.app'
);
expect
(
await
project
.
ios
.
hostAppBundleName
(
null
)
,
'My App.app'
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
@@ -630,7 +630,7 @@ name: foo_bar
...
@@ -630,7 +630,7 @@ name: foo_bar
testUsingContext
(
'cannot find bundle identifier'
,
()
async
{
testUsingContext
(
'cannot find bundle identifier'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
expect
(
await
project
.
ios
.
containsWatchCompanion
(<
String
>[
'WatchTarget'
]),
isFalse
);
expect
(
await
project
.
ios
.
containsWatchCompanion
(<
String
>[
'WatchTarget'
]
,
null
),
isFalse
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
@@ -641,7 +641,7 @@ name: foo_bar
...
@@ -641,7 +641,7 @@ name: foo_bar
group
(
'with bundle identifier'
,
()
{
group
(
'with bundle identifier'
,
()
{
setUp
(()
{
setUp
(()
{
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
any
)).
thenAnswer
(
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
scheme:
anyNamed
(
'scheme'
)
)).
thenAnswer
(
(
_
)
{
(
_
)
{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
...
@@ -652,7 +652,7 @@ name: foo_bar
...
@@ -652,7 +652,7 @@ name: foo_bar
testUsingContext
(
'no Info.plist in target'
,
()
async
{
testUsingContext
(
'no Info.plist in target'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
expect
(
await
project
.
ios
.
containsWatchCompanion
(<
String
>[
'WatchTarget'
]),
isFalse
);
expect
(
await
project
.
ios
.
containsWatchCompanion
(<
String
>[
'WatchTarget'
]
,
null
),
isFalse
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
@@ -665,7 +665,7 @@ name: foo_bar
...
@@ -665,7 +665,7 @@ name: foo_bar
final
FlutterProject
project
=
await
someProject
();
final
FlutterProject
project
=
await
someProject
();
project
.
ios
.
hostAppRoot
.
childDirectory
(
'WatchTarget'
).
childFile
(
'Info.plist'
).
createSync
(
recursive:
true
);
project
.
ios
.
hostAppRoot
.
childDirectory
(
'WatchTarget'
).
childFile
(
'Info.plist'
).
createSync
(
recursive:
true
);
expect
(
await
project
.
ios
.
containsWatchCompanion
(<
String
>[
'WatchTarget'
]),
isFalse
);
expect
(
await
project
.
ios
.
containsWatchCompanion
(<
String
>[
'WatchTarget'
]
,
null
),
isFalse
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
@@ -679,7 +679,7 @@ name: foo_bar
...
@@ -679,7 +679,7 @@ name: foo_bar
project
.
ios
.
hostAppRoot
.
childDirectory
(
'WatchTarget'
).
childFile
(
'Info.plist'
).
createSync
(
recursive:
true
);
project
.
ios
.
hostAppRoot
.
childDirectory
(
'WatchTarget'
).
childFile
(
'Info.plist'
).
createSync
(
recursive:
true
);
when
(
mockPlistUtils
.
getValueFromFile
(
any
,
'WKCompanionAppBundleIdentifier'
)).
thenReturn
(
'io.flutter.someOTHERproject'
);
when
(
mockPlistUtils
.
getValueFromFile
(
any
,
'WKCompanionAppBundleIdentifier'
)).
thenReturn
(
'io.flutter.someOTHERproject'
);
expect
(
await
project
.
ios
.
containsWatchCompanion
(<
String
>[
'WatchTarget'
]),
isFalse
);
expect
(
await
project
.
ios
.
containsWatchCompanion
(<
String
>[
'WatchTarget'
]
,
null
),
isFalse
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
@@ -693,7 +693,7 @@ name: foo_bar
...
@@ -693,7 +693,7 @@ name: foo_bar
project
.
ios
.
hostAppRoot
.
childDirectory
(
'WatchTarget'
).
childFile
(
'Info.plist'
).
createSync
(
recursive:
true
);
project
.
ios
.
hostAppRoot
.
childDirectory
(
'WatchTarget'
).
childFile
(
'Info.plist'
).
createSync
(
recursive:
true
);
when
(
mockPlistUtils
.
getValueFromFile
(
any
,
'WKCompanionAppBundleIdentifier'
)).
thenReturn
(
'io.flutter.someProject'
);
when
(
mockPlistUtils
.
getValueFromFile
(
any
,
'WKCompanionAppBundleIdentifier'
)).
thenReturn
(
'io.flutter.someProject'
);
expect
(
await
project
.
ios
.
containsWatchCompanion
(<
String
>[
'WatchTarget'
]),
isTrue
);
expect
(
await
project
.
ios
.
containsWatchCompanion
(<
String
>[
'WatchTarget'
]
,
null
),
isTrue
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
packages/flutter_tools/test/src/context.dart
View file @
9c87b324
...
@@ -397,8 +397,8 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
...
@@ -397,8 +397,8 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
@override
@override
Future
<
Map
<
String
,
String
>>
getBuildSettings
(
Future
<
Map
<
String
,
String
>>
getBuildSettings
(
String
projectPath
,
String
projectPath
,
{
String
target
,
{
String
scheme
,
Duration
timeout
=
const
Duration
(
minutes:
1
),
Duration
timeout
=
const
Duration
(
minutes:
1
),
})
async
{
})
async
{
return
<
String
,
String
>{};
return
<
String
,
String
>{};
...
...
packages/flutter_tools/test/src/mocks.dart
View file @
9c87b324
...
@@ -54,9 +54,10 @@ class MockApplicationPackageFactory extends Mock implements ApplicationPackageFa
...
@@ -54,9 +54,10 @@ class MockApplicationPackageFactory extends Mock implements ApplicationPackageFa
@override
@override
Future
<
ApplicationPackage
>
getPackageForPlatform
(
Future
<
ApplicationPackage
>
getPackageForPlatform
(
TargetPlatform
platform
,
{
TargetPlatform
platform
,
{
BuildInfo
buildInfo
,
File
applicationBinary
,
File
applicationBinary
,
})
async
{
})
async
{
return
_store
.
getPackageForPlatform
(
platform
);
return
_store
.
getPackageForPlatform
(
platform
,
buildInfo
);
}
}
}
}
...
@@ -531,10 +532,10 @@ class MockIosProject extends Mock implements IosProject {
...
@@ -531,10 +532,10 @@ class MockIosProject extends Mock implements IosProject {
static
const
String
appBundleName
=
'My Super Awesome App.app'
;
static
const
String
appBundleName
=
'My Super Awesome App.app'
;
@override
@override
Future
<
String
>
get
productBundleIdentifier
async
=>
bundleId
;
Future
<
String
>
productBundleIdentifier
(
BuildInfo
buildInfo
)
async
=>
bundleId
;
@override
@override
Future
<
String
>
get
hostAppBundleName
async
=>
appBundleName
;
Future
<
String
>
hostAppBundleName
(
BuildInfo
buildInfo
)
async
=>
appBundleName
;
}
}
class
MockAndroidDevice
extends
Mock
implements
AndroidDevice
{
class
MockAndroidDevice
extends
Mock
implements
AndroidDevice
{
...
...
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