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
bce1706f
Unverified
Commit
bce1706f
authored
3 years ago
by
Mirko Mucaria
Committed by
GitHub
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix watchOS build when companion app is configured with xcode variable (#84519)
parent
e57d97af
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
4 deletions
+41
-4
AUTHORS
AUTHORS
+1
-0
project.pbxproj
..._app_with_extensions/ios/Runner.xcodeproj/project.pbxproj
+3
-0
Info.plist
...ts/ios_app_with_extensions/ios/watch Extension/Info.plist
+1
-1
Info.plist
...ration_tests/ios_app_with_extensions/ios/watch/Info.plist
+1
-1
project.dart
packages/flutter_tools/lib/src/project.dart
+17
-2
project_test.dart
packages/flutter_tools/test/general.shard/project_test.dart
+18
-0
No files found.
AUTHORS
View file @
bce1706f
...
...
@@ -79,3 +79,4 @@ Seongyun Kim <helloworld@cau.ac.kr>
Ludwik Trammer <ludwik@gmail.com>
Marian Triebe <m.triebe@live.de>
Alexis Rouillard <contact@arouillard.fr>
Mirko Mucaria <skogsfrae@gmail.com>
This diff is collapsed.
Click to expand it.
dev/integration_tests/ios_app_with_extensions/ios/Runner.xcodeproj/project.pbxproj
View file @
bce1706f
...
...
@@ -570,6 +570,7 @@
isa
=
XCBuildConfiguration
;
buildSettings
=
{
ALWAYS_SEARCH_USER_PATHS
=
NO
;
APP_BUNDLE_IDENTIFIER
=
io.flutter.extensionTest
;
CLANG_ANALYZER_NONNULL
=
YES
;
CLANG_CXX_LANGUAGE_STANDARD
=
"gnu++0x"
;
CLANG_CXX_LIBRARY
=
"libc++"
;
...
...
@@ -828,6 +829,7 @@
isa
=
XCBuildConfiguration
;
buildSettings
=
{
ALWAYS_SEARCH_USER_PATHS
=
NO
;
APP_BUNDLE_IDENTIFIER
=
io.flutter.extensionTest
;
CLANG_ANALYZER_NONNULL
=
YES
;
CLANG_CXX_LANGUAGE_STANDARD
=
"gnu++0x"
;
CLANG_CXX_LIBRARY
=
"libc++"
;
...
...
@@ -883,6 +885,7 @@
isa
=
XCBuildConfiguration
;
buildSettings
=
{
ALWAYS_SEARCH_USER_PATHS
=
NO
;
APP_BUNDLE_IDENTIFIER
=
io.flutter.extensionTest
;
CLANG_ANALYZER_NONNULL
=
YES
;
CLANG_CXX_LANGUAGE_STANDARD
=
"gnu++0x"
;
CLANG_CXX_LIBRARY
=
"libc++"
;
...
...
This diff is collapsed.
Click to expand it.
dev/integration_tests/ios_app_with_extensions/ios/watch Extension/Info.plist
View file @
bce1706f
...
...
@@ -25,7 +25,7 @@
<
k
e
y
>
NSExtensionAttributes
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
WKAppBundleIdentifier
<
/k
e
y
>
<
string
>
io.flutter.extensionTest
.watchkitapp
<
/string
>
<
string
>
$
(
APP_BUNDLE_IDENTIFIER
)
.watchkitapp
<
/string
>
<
/
d
i
c
t
>
<
k
e
y
>
NSExtensionPointIdentifier
<
/k
e
y
>
<
string
>
com.apple.watchkit
<
/string
>
...
...
This diff is collapsed.
Click to expand it.
dev/integration_tests/ios_app_with_extensions/ios/watch/Info.plist
View file @
bce1706f
...
...
@@ -26,7 +26,7 @@
<
string
>
UIInterfaceOrientationPortraitUpsideDown
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
WKCompanionAppBundleIdentifier
<
/k
e
y
>
<
string
>
io.flutter.extensionTest
<
/string
>
<
string
>
$
(
APP_BUNDLE_IDENTIFIER
)
<
/string
>
<
k
e
y
>
WKWatchKitApp
<
/k
e
y
>
<
tru
e
/
>
<
/
d
i
c
t
>
...
...
This diff is collapsed.
Click to expand it.
packages/flutter_tools/lib/src/project.dart
View file @
bce1706f
...
...
@@ -689,8 +689,23 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
final
File
infoFile
=
hostAppRoot
.
childDirectory
(
target
).
childFile
(
'Info.plist'
);
// The Info.plist file of a target contains the key WKCompanionAppBundleIdentifier,
// if it is a watchOS companion app.
if
(
infoFile
.
existsSync
()
&&
globals
.
plistParser
.
getValueFromFile
(
infoFile
.
path
,
'WKCompanionAppBundleIdentifier'
)
==
bundleIdentifier
)
{
return
true
;
if
(
infoFile
.
existsSync
())
{
final
String
?
fromPlist
=
globals
.
plistParser
.
getValueFromFile
(
infoFile
.
path
,
'WKCompanionAppBundleIdentifier'
);
if
(
bundleIdentifier
==
fromPlist
)
{
return
true
;
}
// The key WKCompanionAppBundleIdentifier might contain an xcode variable
// that needs to be substituted before comparing it with bundle id
if
(
fromPlist
!=
null
&&
fromPlist
.
contains
(
r'$'
))
{
final
Map
<
String
,
String
>?
allBuildSettings
=
await
buildSettingsForBuildInfo
(
buildInfo
);
if
(
allBuildSettings
!=
null
)
{
final
String
substituedVariable
=
substituteXcodeVariables
(
fromPlist
,
allBuildSettings
);
if
(
substituedVariable
==
bundleIdentifier
)
{
return
true
;
}
}
}
}
}
return
false
;
...
...
This diff is collapsed.
Click to expand it.
packages/flutter_tools/test/general.shard/project_test.dart
View file @
bce1706f
...
...
@@ -697,6 +697,24 @@ apply plugin: 'kotlin-android'
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
FlutterProjectFactory:
()
=>
flutterProjectFactory
,
});
testUsingContext
(
'has watch companion with build settings'
,
()
async
{
final
FlutterProject
project
=
await
someProject
();
project
.
ios
.
xcodeProject
.
createSync
();
mockXcodeProjectInterpreter
.
buildSettings
=
<
String
,
String
>{
'PRODUCT_BUNDLE_IDENTIFIER'
:
'io.flutter.someProject'
,
};
project
.
ios
.
hostAppRoot
.
childDirectory
(
'WatchTarget'
).
childFile
(
'Info.plist'
).
createSync
(
recursive:
true
);
testPlistParser
.
setProperty
(
'WKCompanionAppBundleIdentifier'
,
r'$(PRODUCT_BUNDLE_IDENTIFIER)'
);
expect
(
await
project
.
ios
.
containsWatchCompanion
(<
String
>[
'WatchTarget'
],
null
),
isTrue
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
PlistParser:
()
=>
testPlistParser
,
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
FlutterProjectFactory:
()
=>
flutterProjectFactory
,
});
});
});
}
...
...
This diff is collapsed.
Click to expand it.
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