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
Hide 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 @@
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BuildableName =
"
Runner
.app"
BlueprintName =
"
Runner
"
BuildableName =
"
Free App
.app"
BlueprintName =
"
Free App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
...
...
@@ -27,19 +27,17 @@
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BuildableName =
"
Runner
.app"
BlueprintName =
"
Runner
"
BuildableName =
"
Free App
.app"
BlueprintName =
"
Free App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</MacroExpansion>
<
AdditionalOption
s>
</
AdditionalOption
s>
<
Testable
s>
</
Testable
s>
</TestAction>
<LaunchAction
buildConfiguration =
"Debug Free"
...
...
@@ -56,13 +54,11 @@
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BuildableName =
"
Runner
.app"
BlueprintName =
"
Runner
"
BuildableName =
"
Free App
.app"
BlueprintName =
"
Free App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release Free"
...
...
@@ -75,8 +71,8 @@
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BuildableName =
"
Runner
.app"
BlueprintName =
"
Runner
"
BuildableName =
"
Free App
.app"
BlueprintName =
"
Free App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
...
...
dev/integration_tests/flavors/ios/Runner.xcodeproj/xcshareddata/xcschemes/Paid.xcscheme
View file @
9c87b324
...
...
@@ -14,9 +14,9 @@
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"
97C146ED1CF9000F007C117D
"
BuildableName =
"
Runner
.app"
BlueprintName =
"
Runner
"
BlueprintIdentifier =
"
F723D22E2464E1C10004F0E0
"
BuildableName =
"
Paid App
.app"
BlueprintName =
"
Paid App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
...
...
@@ -27,19 +27,17 @@
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"97C146ED1CF9000F007C117D"
BuildableName =
"
Runner
.app"
BlueprintName =
"
Runner
"
BuildableName =
"
Free App
.app"
BlueprintName =
"
Free App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</MacroExpansion>
<
AdditionalOption
s>
</
AdditionalOption
s>
<
Testable
s>
</
Testable
s>
</TestAction>
<LaunchAction
buildConfiguration =
"Debug Paid"
...
...
@@ -55,14 +53,12 @@
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"
97C146ED1CF9000F007C117D
"
BuildableName =
"
Runner
.app"
BlueprintName =
"
Runner
"
BlueprintIdentifier =
"
F723D22E2464E1C10004F0E0
"
BuildableName =
"
Paid App
.app"
BlueprintName =
"
Paid App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release Paid"
...
...
@@ -70,16 +66,15 @@
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<MacroExpansion>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"
97C146ED1CF9000F007C117D
"
BuildableName =
"
Runner
.app"
BlueprintName =
"
Runner
"
BlueprintIdentifier =
"
F723D22E2464E1C10004F0E0
"
BuildableName =
"
Paid App
.app"
BlueprintName =
"
Paid App
"
ReferencedContainer =
"container:Runner.xcodeproj"
>
</BuildableReference>
</
BuildableProductRunnable
>
</
MacroExpansion
>
</ProfileAction>
<AnalyzeAction
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 @@
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
flavors
<
/string
>
<
string
>
$
(
PRODUCT_NAME
)
<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
...
...
@@ -20,14 +20,14 @@
<
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
>
Flavor
<
/k
e
y
>
<
string
>
$
{
PRODUCT_FLAVOR
}<
/string
>
<
k
e
y
>
UISupportedInterfaceOrientations
<
/k
e
y
>
<
a
rr
a
y
>
<
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 {
Future
<
ApplicationPackage
>
getPackageForPlatform
(
TargetPlatform
platform
,
{
BuildInfo
buildInfo
,
File
applicationBinary
,
})
async
{
switch
(
platform
)
{
...
...
@@ -47,7 +48,7 @@ class ApplicationPackageFactory {
:
AndroidApk
.
fromApk
(
applicationBinary
);
case
TargetPlatform
.
ios
:
return
applicationBinary
==
null
?
await
IOSApp
.
fromIosProject
(
FlutterProject
.
current
().
ios
)
?
await
IOSApp
.
fromIosProject
(
FlutterProject
.
current
().
ios
,
buildInfo
)
:
IOSApp
.
fromPrebuiltApp
(
applicationBinary
);
case
TargetPlatform
.
tester
:
return
FlutterTesterApp
.
fromCurrentDirectory
();
...
...
@@ -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
)
{
return
null
;
}
...
...
@@ -344,7 +345,7 @@ abstract class IOSApp extends ApplicationPackage {
globals
.
printError
(
'Expected ios/Runner.xcodeproj/project.pbxproj but this file is missing.'
);
return
null
;
}
return
BuildableIOSApp
.
fromProject
(
project
);
return
BuildableIOSApp
.
fromProject
(
project
,
buildInfo
);
}
@override
...
...
@@ -360,9 +361,9 @@ class BuildableIOSApp extends IOSApp {
:
_hostAppBundleName
=
hostAppBundleName
,
super
(
projectBundleId:
projectBundleId
);
static
Future
<
BuildableIOSApp
>
fromProject
(
IosProject
project
)
async
{
final
String
projectBundleId
=
await
project
.
productBundleIdentifier
;
final
String
hostAppBundleName
=
await
project
.
hostAppBundleName
;
static
Future
<
BuildableIOSApp
>
fromProject
(
IosProject
project
,
BuildInfo
buildInfo
)
async
{
final
String
projectBundleId
=
await
project
.
productBundleIdentifier
(
buildInfo
)
;
final
String
hostAppBundleName
=
await
project
.
hostAppBundleName
(
buildInfo
)
;
return
BuildableIOSApp
(
project
,
projectBundleId
,
hostAppBundleName
);
}
...
...
@@ -416,7 +417,10 @@ class ApplicationPackageStore {
MacOSApp
macOS
;
WindowsApp
windows
;
Future
<
ApplicationPackage
>
getPackageForPlatform
(
TargetPlatform
platform
)
async
{
Future
<
ApplicationPackage
>
getPackageForPlatform
(
TargetPlatform
platform
,
BuildInfo
buildInfo
,
)
async
{
switch
(
platform
)
{
case
TargetPlatform
.
android
:
case
TargetPlatform
.
android_arm
:
...
...
@@ -426,7 +430,7 @@ class ApplicationPackageStore {
android
??=
await
AndroidApk
.
fromAndroidProject
(
FlutterProject
.
current
().
android
);
return
android
;
case
TargetPlatform
.
ios
:
iOS
??=
await
IOSApp
.
fromIosProject
(
FlutterProject
.
current
().
ios
);
iOS
??=
await
IOSApp
.
fromIosProject
(
FlutterProject
.
current
().
ios
,
buildInfo
);
return
iOS
;
case
TargetPlatform
.
fuchsia_arm64
:
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 {
firstBuildTime
=
DateTime
.
now
();
final
ApplicationPackage
package
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
TargetPlatform
.
web_javascript
,
buildInfo:
debuggingOptions
.
buildInfo
,
applicationBinary:
null
,
);
if
(
package
==
null
)
{
...
...
packages/flutter_tools/lib/src/commands/build_ios.dart
View file @
9c87b324
...
...
@@ -64,7 +64,11 @@ class BuildIOSCommand extends BuildSubCommand {
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
)
{
throwToolExit
(
'Application not configured for iOS'
);
...
...
@@ -76,7 +80,6 @@ class BuildIOSCommand extends BuildSubCommand {
globals
.
printStatus
(
'Warning: Building for device with codesigning disabled. You will '
'have to manually codesign before deploying to device.'
);
}
final
BuildInfo
buildInfo
=
getBuildInfo
();
if
(
forSimulator
&&
!
buildInfo
.
supportsSimulator
)
{
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 {
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
)
{
final
String
productBundleIdentifier
=
await
_project
.
ios
.
productBundleIdentifier
(
buildInfo
);
globals
.
printStatus
(
'Building frameworks for
$productBundleIdentifier
in
${getNameForBuildMode(buildInfo.mode)}
mode...'
);
final
String
xcodeBuildConfiguration
=
toTitleCase
(
getNameForBuildMode
(
buildInfo
.
mode
));
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 {
await
appStopper
(
command
);
final
ApplicationPackage
package
=
await
command
.
applicationPackages
.
getPackageForPlatform
(
await
command
.
device
.
targetPlatform
);
.
getPackageForPlatform
(
await
command
.
device
.
targetPlatform
,
command
.
getBuildInfo
()
);
if
(
command
.
shouldBuild
)
{
globals
.
printTrace
(
'Installing application package.'
);
...
...
@@ -497,7 +497,10 @@ void restoreAppStopper() {
Future
<
bool
>
_stopApp
(
DriveCommand
command
)
async
{
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
);
await
command
.
_deviceLogSubscription
?.
cancel
();
return
stopped
;
...
...
packages/flutter_tools/lib/src/commands/install.dart
View file @
9c87b324
...
...
@@ -43,7 +43,10 @@ class InstallCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts
@override
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
();
...
...
packages/flutter_tools/lib/src/ios/code_signing.dart
View file @
9c87b324
...
...
@@ -13,6 +13,7 @@ import '../base/common.dart';
import
'../base/io.dart'
;
import
'../base/logger.dart'
;
import
'../base/process.dart'
;
import
'../build_info.dart'
;
import
'../convert.dart'
show
utf8
;
import
'../globals.dart'
as
globals
;
...
...
@@ -101,8 +102,9 @@ Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({
@required
BuildableIOSApp
iosApp
,
@required
ProcessManager
processManager
,
@required
Logger
logger
,
@required
BuildInfo
buildInfo
,
})
async
{
final
Map
<
String
,
String
>
buildSettings
=
await
iosApp
.
project
.
buildSettings
;
final
Map
<
String
,
String
>
buildSettings
=
await
iosApp
.
project
.
buildSettings
ForBuildInfo
(
buildInfo
)
;
if
(
buildSettings
==
null
)
{
return
null
;
}
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
9c87b324
...
...
@@ -111,12 +111,6 @@ Future<XcodeBuildResult> buildXcodeProject({
await
removeFinderExtendedAttributes
(
app
.
project
.
hostAppRoot
,
processUtils
,
globals
.
logger
);
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
);
if
(
scheme
==
null
)
{
globals
.
printError
(
''
);
...
...
@@ -180,7 +174,8 @@ Future<XcodeBuildResult> buildXcodeProject({
autoSigningConfigs
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
,
processManager:
globals
.
processManager
,
logger:
globals
.
logger
logger:
globals
.
logger
,
buildInfo:
buildInfo
,
);
}
...
...
@@ -229,7 +224,10 @@ Future<XcodeBuildResult> buildXcodeProject({
}
// 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
)
{
// 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.
...
...
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
9c87b324
...
...
@@ -309,9 +309,12 @@ class XcodeProjectInterpreter {
/// Asynchronously retrieve xcode build settings. This one is preferred for
/// 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
(
String
projectPath
,
String
target
,
{
String
projectPath
,
{
String
scheme
,
Duration
timeout
=
const
Duration
(
minutes:
1
),
})
async
{
final
Status
status
=
Status
.
withSpinner
(
...
...
@@ -324,8 +327,8 @@ class XcodeProjectInterpreter {
_executable
,
'-project'
,
_fileSystem
.
path
.
absolute
(
projectPath
),
'-target'
,
target
,
if
(
scheme
!=
null
)
...<
String
>[
'-scheme'
,
scheme
]
,
'-showBuildSettings'
,
...
environmentVariablesAsXcodeBuildSettings
(
_platform
)
];
...
...
@@ -465,7 +468,6 @@ class XcodeProjectInfo {
final
List
<
String
>
buildConfigurations
;
final
List
<
String
>
schemes
;
bool
get
definesCustomTargets
=>
!(
targets
.
contains
(
'Runner'
)
&&
targets
.
length
==
1
);
bool
get
definesCustomSchemes
=>
!(
schemes
.
contains
(
'Runner'
)
&&
schemes
.
length
==
1
);
bool
get
definesCustomBuildConfigurations
{
return
!(
buildConfigurations
.
contains
(
'Debug'
)
&&
...
...
@@ -475,7 +477,7 @@ class XcodeProjectInfo {
/// The expected scheme for [buildInfo].
static
String
expectedSchemeFor
(
BuildInfo
buildInfo
)
{
return
toTitleCase
(
buildInfo
.
flavor
??
'runner'
);
return
toTitleCase
(
buildInfo
?
.
flavor
??
'runner'
);
}
/// 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 {
}
else
{
final
bool
isSwift
=
(
await
_xcodeProjectInterpreter
.
getBuildSettings
(
runnerProject
.
path
,
'Runner'
,
)).
containsKey
(
'SWIFT_VERSION'
);
podfileTemplateName
=
isSwift
?
'Podfile-ios-swift'
:
'Podfile-ios-objc'
;
}
...
...
packages/flutter_tools/lib/src/project.dart
View file @
9c87b324
...
...
@@ -102,11 +102,14 @@ class FlutterProject {
/// Gradle group ID.
Future
<
Set
<
String
>>
get
organizationNames
async
{
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
.
group
,
example
.
android
.
applicationId
,
await
example
.
ios
.
productBundleIdentifier
,
await
example
.
ios
.
productBundleIdentifier
(
null
)
,
];
return
Set
<
String
>.
of
(
candidates
.
map
<
String
>(
_organizationNameFromPackageName
)
...
...
@@ -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
/// iOS tooling needed to read it is not installed.
Future<String>
get productBundleIdentifier
async =>
_productBundleIdentifier ??= await _parseProductBundleIdentifier();
Future<String>
productBundleIdentifier(BuildInfo buildInfo)
async =>
_productBundleIdentifier ??= await _parseProductBundleIdentifier(
buildInfo
);
String _productBundleIdentifier;
Future<String> _parseProductBundleIdentifier() async {
Future<String> _parseProductBundleIdentifier(
BuildInfo buildInfo
) async {
String fromPlist;
final File defaultInfoPlist = defaultHostInfoPlist;
// Users can change the location of the Info.plist.
...
...
@@ -434,7 +437,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
return fromPlist;
}
}
final Map<String, String> allBuildSettings = await buildSettings;
final Map<String, String> allBuildSettings = await buildSettings
ForBuildInfo(buildInfo)
;
if (allBuildSettings != null) {
if (fromPlist != null) {
// Perform variable substitution using build settings.
...
...
@@ -458,18 +461,18 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
}
/// The bundle name of the host app, `My App.app`.
Future<String>
get hostAppBundleName
async =>
_hostAppBundleName ??= await _parseHostAppBundleName();
Future<String>
hostAppBundleName(BuildInfo buildInfo)
async =>
_hostAppBundleName ??= await _parseHostAppBundleName(
buildInfo
);
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
// is instructed to change in Xcode as part of deploying to the App Store.
// 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
.
String
productName
;
if
(
globals
.
xcodeProjectInterpreter
.
isInstalled
)
{
final
Map
<
String
,
String
>
xcodeBuildSettings
=
await
buildSettings
;
final
Map
<
String
,
String
>
xcodeBuildSettings
=
await
buildSettings
ForBuildInfo
(
buildInfo
)
;
if
(
xcodeBuildSettings
!=
null
)
{
productName
=
xcodeBuildSettings
[
'FULL_PRODUCT_NAME'
];
}
...
...
@@ -483,17 +486,20 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
/// The build settings for the host app of this project, as a detached map.
///
/// Returns null, if iOS tooling is unavailable.
Future
<
Map
<
String
,
String
>>
get
buildSettings
async
=>
_buildSettings
??=
await
_xcodeProjectBuildSettings
();
Map
<
String
,
String
>
_buildSettings
;
Future
<
Map
<
String
,
String
>>
buildSettingsForBuildInfo
(
BuildInfo
buildInfo
)
async
{
_buildSettingsByScheme
??=
<
String
,
Map
<
String
,
String
>>{};
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
)
{
return
null
;
}
final
Map
<
String
,
String
>
buildSettings
=
await
globals
.
xcodeProjectInterpreter
.
getBuildSettings
(
xcodeProject
.
path
,
_hostAppProjectNa
me
,
scheme:
sche
me
,
);
if
(
buildSettings
!=
null
&&
buildSettings
.
isNotEmpty
)
{
// No timeouts, flakes, or errors.
...
...
@@ -511,8 +517,8 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
}
/// Check if one the [targets] of the project is a watchOS companion app target.
Future
<
bool
>
containsWatchCompanion
(
List
<
String
>
targets
)
async
{
final
String
bundleIdentifier
=
await
productBundleIdentifier
;
Future
<
bool
>
containsWatchCompanion
(
List
<
String
>
targets
,
BuildInfo
buildInfo
)
async
{
final
String
bundleIdentifier
=
await
productBundleIdentifier
(
buildInfo
)
;
// A bundle identifier is required for a companion app.
if
(
bundleIdentifier
==
null
)
{
return
false
;
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
9c87b324
...
...
@@ -469,6 +469,7 @@ class FlutterDevice {
final
TargetPlatform
targetPlatform
=
await
device
.
targetPlatform
;
package
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
targetPlatform
,
buildInfo:
hotRunner
.
debuggingOptions
.
buildInfo
,
applicationBinary:
hotRunner
.
applicationBinary
,
);
...
...
@@ -524,6 +525,7 @@ class FlutterDevice {
final
TargetPlatform
targetPlatform
=
await
device
.
targetPlatform
;
package
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
targetPlatform
,
buildInfo:
coldRunner
.
debuggingOptions
.
buildInfo
,
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';
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/net.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/commands/create.dart'
;
import
'package:flutter_tools/src/dart/pub.dart'
;
...
...
@@ -996,8 +997,20 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--template=app'
,
'--no-pub'
,
'--org'
,
'com.example'
,
tmpProjectDir
]);
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
globals
.
fs
.
directory
(
tmpProjectDir
));
expect
(
await
project
.
ios
.
productBundleIdentifier
,
'com.example.helloFlutter'
,
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'
,
);
expect
(
project
.
android
.
applicationId
,
...
...
@@ -1008,7 +1021,7 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--template=app'
,
'--no-pub'
,
'--org'
,
'abc^*.1#@'
,
tmpProjectDir
]);
project
=
FlutterProject
.
fromDirectory
(
globals
.
fs
.
directory
(
tmpProjectDir
));
expect
(
await
project
.
ios
.
productBundleIdentifier
,
await
project
.
ios
.
productBundleIdentifier
(
BuildInfo
.
debug
)
,
'abc.1.testAbc'
,
);
expect
(
...
...
@@ -1020,7 +1033,7 @@ void main() {
await
runner
.
run
(<
String
>[
'create'
,
'--template=app'
,
'--no-pub'
,
'--org'
,
'#+^%'
,
tmpProjectDir
]);
project
=
FlutterProject
.
fromDirectory
(
globals
.
fs
.
directory
(
tmpProjectDir
));
expect
(
await
project
.
ios
.
productBundleIdentifier
,
await
project
.
ios
.
productBundleIdentifier
(
BuildInfo
.
debug
)
,
'flutterProject.untitled'
,
);
expect
(
...
...
@@ -1154,7 +1167,7 @@ void main() {
await
_createProject
(
projectDir
,
<
String
>[],
<
String
>[]);
final
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
projectDir
);
expect
(
await
project
.
ios
.
productBundleIdentifier
,
await
project
.
ios
.
productBundleIdentifier
(
BuildInfo
.
debug
)
,
'com.bar.foo.flutterProject'
,
);
},
overrides:
<
Type
,
Generator
>{
...
...
@@ -1203,7 +1216,7 @@ void main() {
await
_createProject
(
projectDir
,
<
String
>[
'--no-pub'
],
<
String
>[]);
final
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
projectDir
);
expect
(
await
project
.
ios
.
productBundleIdentifier
,
await
project
.
ios
.
productBundleIdentifier
(
BuildInfo
.
debug
)
,
'com.bar.foo.flutterProject'
,
);
});
...
...
@@ -1236,7 +1249,7 @@ void main() {
);
final
FlutterProject
project
=
FlutterProject
.
fromDirectory
(
projectDir
);
expect
(
await
project
.
example
.
ios
.
productBundleIdentifier
,
await
project
.
example
.
ios
.
productBundleIdentifier
(
BuildInfo
.
debug
)
,
'com.bar.foo.flutterProjectExample'
,
);
});
...
...
packages/flutter_tools/test/general.shard/application_package_test.dart
View file @
9c87b324
...
...
@@ -91,6 +91,7 @@ void main() {
final
ApplicationPackage
applicationPackage
=
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
TargetPlatform
.
android_arm
,
buildInfo:
null
,
applicationBinary:
apkFile
,
);
expect
(
applicationPackage
.
name
,
'app.apk'
);
...
...
@@ -117,6 +118,7 @@ void main() {
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
TargetPlatform
.
android_arm
,
buildInfo:
null
,
applicationBinary:
globals
.
fs
.
file
(
'app.apk'
),
);
verify
(
...
...
@@ -134,6 +136,7 @@ void main() {
await
ApplicationPackageFactory
.
instance
.
getPackageForPlatform
(
TargetPlatform
.
android_arm
,
buildInfo:
null
,
);
verifyNever
(
mockProcessManager
.
run
(
...
...
@@ -328,7 +331,7 @@ void main() {
globals
.
fs
.
file
(
'pubspec.yaml'
).
createSync
();
globals
.
fs
.
file
(
'.packages'
).
createSync
();
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
);
},
overrides:
overrides
);
...
...
@@ -338,7 +341,7 @@ void main() {
globals
.
fs
.
file
(
'.packages'
).
createSync
();
globals
.
fs
.
file
(
'ios/FooBar.xcodeproj'
).
createSync
(
recursive:
true
);
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
);
},
overrides:
overrides
);
...
...
@@ -348,7 +351,7 @@ void main() {
globals
.
fs
.
file
(
'.packages'
).
createSync
();
globals
.
fs
.
file
(
'ios/Runner.xcodeproj'
).
createSync
(
recursive:
true
);
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
);
},
overrides:
overrides
);
...
...
packages/flutter_tools/test/general.shard/ios/code_signing_test.dart
View file @
9c87b324
...
...
@@ -6,6 +6,7 @@ import 'dart:async';
import
'dart:convert'
;
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:mockito/mockito.dart'
;
import
'package:flutter_tools/src/application_package.dart'
;
...
...
@@ -36,28 +37,32 @@ void main() {
when
(
mockProcessManager
.
canRun
(
any
)).
thenReturn
(
true
);
mockConfig
=
MockConfig
();
mockIosProject
=
MockIosProject
();
when
(
mockIosProject
.
buildSettings
).
thenAnswer
((
_
)
{
when
(
mockIosProject
.
buildSettings
ForBuildInfo
(
any
)
).
thenAnswer
((
_
)
{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
'For our purposes'
:
'a non-empty build settings map is valid'
,
});
});
testTerminal
=
TestTerminal
();
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
{
when
(
mockIosProject
.
buildSettings
).
thenReturn
(
null
);
const
BuildInfo
buildInfo
=
BuildInfo
.
debug
;
when
(
mockIosProject
.
buildSettingsForBuildInfo
(
any
)).
thenReturn
(
null
);
final
Map
<
String
,
String
>
signingConfigs
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
buildInfo
,
);
expect
(
signingConfigs
,
isNull
);
verify
(
mockIosProject
.
buildSettingsForBuildInfo
(
buildInfo
));
});
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
>{
'DEVELOPMENT_TEAM'
:
'abc'
,
});
...
...
@@ -66,11 +71,13 @@ void main() {
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
buildInfo
,
);
expect
(
signingConfigs
,
isNull
);
expect
(
logger
.
statusText
,
equals
(
'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
{
...
...
@@ -80,12 +87,14 @@ void main() {
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
null
,
);
expect
(
signingConfigs
,
isNull
);
});
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
>{});
});
when
(
mockProcessManager
.
run
(
...
...
@@ -108,7 +117,9 @@ void main() {
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
buildInfo
,
),
throwsToolExit
(
message:
'No development certificates available to code sign app for device deployment'
));
verify
(
mockIosProject
.
buildSettingsForBuildInfo
(
buildInfo
));
},
overrides:
<
Type
,
Generator
>{
OutputPreferences:
()
=>
OutputPreferences
(
wrapText:
false
),
...
...
@@ -172,6 +183,7 @@ void main() {
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
null
,
);
expect
(
logger
.
statusText
,
contains
(
'iPhone Developer: Profile 1 (1111AAAA11)'
));
...
...
@@ -240,6 +252,7 @@ void main() {
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
null
,
);
}
on
Exception
catch
(
e
)
{
// This should not throw
...
...
@@ -314,6 +327,7 @@ void main() {
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
null
,
);
expect
(
...
...
@@ -399,6 +413,7 @@ void main() {
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
null
,
);
expect
(
...
...
@@ -476,6 +491,7 @@ void main() {
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
null
,
);
expect
(
...
...
@@ -559,6 +575,7 @@ void main() {
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
null
,
);
expect
(
...
...
@@ -600,6 +617,7 @@ void main() {
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
null
,
);
expect
(
signingConfigs
,
isNull
);
});
...
...
@@ -643,6 +661,7 @@ void main() {
iosApp:
app
,
processManager:
mockProcessManager
,
logger:
logger
,
buildInfo:
null
,
);
expect
(
signingConfigs
,
isNull
);
},
...
...
packages/flutter_tools/test/general.shard/ios/mac_test.dart
View file @
9c87b324
...
...
@@ -395,7 +395,7 @@ Exited (sigterm)''',
final MockFile pbxprojFile = MockFile();
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())
.thenAnswer((_) => flutterAssetPbxProjLines);
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'''
xcode:
mockXcode
,
);
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
),
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
,
null
),
);
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'''
xcode:
mockXcode
,
);
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
),
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
,
null
),
);
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'''
xcode:
mockXcode
,
);
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
),
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
,
null
),
);
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'''
xcode:
mockXcode
,
);
final
DeviceLogReader
logReader
=
device
.
getLogReader
(
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
),
app:
await
BuildableIOSApp
.
fromProject
(
mockIosProject
,
null
),
);
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() {
platform
.
environment
=
const
<
String
,
String
>{};
expect
(
await
xcodeProjectInterpreter
.
getBuildSettings
(
''
,
'
'
,
timeout:
delay
),
''
,
scheme:
'Runner
'
,
timeout:
delay
),
const
<
String
,
String
>{});
// build settings times out and is killed once, then succeeds.
verify
(
processManager
.
killPid
(
any
)).
called
(
1
);
...
...
@@ -246,14 +246,31 @@ void main() {
'/usr/bin/xcodebuild'
,
'-project'
,
'/'
,
'-
target
'
,
'
Runner
'
,
'-
scheme
'
,
'
Free
'
,
'-showBuildSettings'
],
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
);
});
...
...
@@ -267,14 +284,14 @@ void main() {
xcodebuild
,
'-project'
,
fileSystem
.
path
.
separator
,
'-
target
'
,
'
Runner
'
,
'-
scheme
'
,
'
Free
'
,
'-showBuildSettings'
,
'CODE_SIGN_STYLE=Manual'
,
'ARCHS=arm64'
],
));
expect
(
await
xcodeProjectInterpreter
.
getBuildSettings
(
''
,
'Runner
'
),
const
<
String
,
String
>{});
expect
(
await
xcodeProjectInterpreter
.
getBuildSettings
(
''
,
scheme:
'Free
'
),
const
<
String
,
String
>{});
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
});
...
...
@@ -290,7 +307,7 @@ void main() {
'-workspace'
,
'workspace_path'
,
'-scheme'
,
'
Runner
'
,
'
Free
'
,
'-quiet'
,
'clean'
,
'CODE_SIGN_STYLE=Manual'
,
...
...
@@ -298,7 +315,7 @@ void main() {
],
));
await
xcodeProjectInterpreter
.
cleanWorkspace
(
'workspace_path'
,
'
Runner
'
);
await
xcodeProjectInterpreter
.
cleanWorkspace
(
'workspace_path'
,
'
Free
'
);
expect
(
fakeProcessManager
.
hasRemainingExpectations
,
isFalse
);
});
...
...
packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart
View file @
9c87b324
...
...
@@ -208,7 +208,7 @@ void main() {
});
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
>{});
await
cocoaPodsUnderTest
.
setupPodfile
(
projectUnderTest
.
ios
);
...
...
@@ -216,7 +216,7 @@ void main() {
});
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
>{
'SWIFT_VERSION'
:
'5.0'
,
});
...
...
packages/flutter_tools/test/general.shard/project_test.dart
View file @
9c87b324
...
...
@@ -386,19 +386,19 @@ apply plugin: 'kotlin-android'
testWithMocks
(
'null, if no build settings or plist entries'
,
()
async
{
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
{
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
>{
'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
{
...
...
@@ -406,19 +406,19 @@ apply plugin: 'kotlin-android'
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
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
{
final
FlutterProject
project
=
await
someProject
();
project
.
ios
.
defaultHostInfoPlist
.
createSync
(
recursive:
true
);
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
{
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
>{
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
...
...
@@ -426,13 +426,13 @@ apply plugin: 'kotlin-android'
}
);
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
{
final
FlutterProject
project
=
await
someProject
();
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
>{
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
...
...
@@ -441,28 +441,28 @@ apply plugin: 'kotlin-android'
}
);
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
{
final
FlutterProject
project
=
await
someProject
();
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
return
projectFileWithBundleId
(
''
,
qualifier:
'"'
);
});
expect
(
await
project
.
ios
.
productBundleIdentifier
,
''
);
expect
(
await
project
.
ios
.
productBundleIdentifier
(
null
)
,
''
);
});
testWithMocks
(
'surrounded by double quotes'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
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
{
final
FlutterProject
project
=
await
someProject
();
addIosProjectFile
(
project
.
directory
,
projectFileContent:
()
{
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'
testUsingContext
(
'app product name defaults to Runner.app'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
expect
(
await
project
.
ios
.
hostAppBundleName
,
'Runner.app'
);
expect
(
await
project
.
ios
.
hostAppBundleName
(
null
)
,
'Runner.app'
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
@@ -485,13 +485,13 @@ apply plugin: 'kotlin-android'
testUsingContext
(
'app product name xcodebuild settings'
,
()
async
{
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
>{
'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
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
@@ -630,7 +630,7 @@ name: foo_bar
testUsingContext
(
'cannot find bundle identifier'
,
()
async
{
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
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
@@ -641,7 +641,7 @@ name: foo_bar
group
(
'with bundle identifier'
,
()
{
setUp
(()
{
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
any
)).
thenAnswer
(
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
scheme:
anyNamed
(
'scheme'
)
)).
thenAnswer
(
(
_
)
{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
...
...
@@ -652,7 +652,7 @@ name: foo_bar
testUsingContext
(
'no Info.plist in target'
,
()
async
{
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
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
@@ -665,7 +665,7 @@ name: foo_bar
final
FlutterProject
project
=
await
someProject
();
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
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
@@ -679,7 +679,7 @@ name: foo_bar
project
.
ios
.
hostAppRoot
.
childDirectory
(
'WatchTarget'
).
childFile
(
'Info.plist'
).
createSync
(
recursive:
true
);
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
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
@@ -693,7 +693,7 @@ name: foo_bar
project
.
ios
.
hostAppRoot
.
childDirectory
(
'WatchTarget'
).
childFile
(
'Info.plist'
).
createSync
(
recursive:
true
);
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
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
...
...
packages/flutter_tools/test/src/context.dart
View file @
9c87b324
...
...
@@ -397,8 +397,8 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
@override
Future
<
Map
<
String
,
String
>>
getBuildSettings
(
String
projectPath
,
String
target
,
{
String
projectPath
,
{
String
scheme
,
Duration
timeout
=
const
Duration
(
minutes:
1
),
})
async
{
return
<
String
,
String
>{};
...
...
packages/flutter_tools/test/src/mocks.dart
View file @
9c87b324
...
...
@@ -54,9 +54,10 @@ class MockApplicationPackageFactory extends Mock implements ApplicationPackageFa
@override
Future
<
ApplicationPackage
>
getPackageForPlatform
(
TargetPlatform
platform
,
{
BuildInfo
buildInfo
,
File
applicationBinary
,
})
async
{
return
_store
.
getPackageForPlatform
(
platform
);
return
_store
.
getPackageForPlatform
(
platform
,
buildInfo
);
}
}
...
...
@@ -531,10 +532,10 @@ class MockIosProject extends Mock implements IosProject {
static
const
String
appBundleName
=
'My Super Awesome App.app'
;
@override
Future
<
String
>
get
productBundleIdentifier
async
=>
bundleId
;
Future
<
String
>
productBundleIdentifier
(
BuildInfo
buildInfo
)
async
=>
bundleId
;
@override
Future
<
String
>
get
hostAppBundleName
async
=>
appBundleName
;
Future
<
String
>
hostAppBundleName
(
BuildInfo
buildInfo
)
async
=>
appBundleName
;
}
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