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
1cfdac4b
Unverified
Commit
1cfdac4b
authored
Nov 02, 2022
by
Jonah Williams
Committed by
GitHub
Nov 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always invoke impeller ios shader target (#114451)
parent
db381d75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
11 deletions
+75
-11
ios.dart
packages/flutter_tools/lib/src/build_system/targets/ios.dart
+3
-11
ios_test.dart
...ols/test/general.shard/build_system/targets/ios_test.dart
+72
-0
No files found.
packages/flutter_tools/lib/src/build_system/targets/ios.dart
View file @
1cfdac4b
...
...
@@ -511,22 +511,14 @@ abstract class IosAssetBundle extends Target {
final
FlutterProject
flutterProject
=
FlutterProject
.
fromDirectory
(
environment
.
projectDir
);
bool
isImpellerEnabled
()
{
if
(!
flutterProject
.
ios
.
infoPlist
.
existsSync
())
{
return
false
;
}
final
Map
<
String
,
Object
>
info
=
globals
.
plistParser
.
parseFile
(
flutterProject
.
ios
.
infoPlist
.
path
);
final
Object
?
enableImpeller
=
info
[
'FLTEnableImpeller'
];
return
enableImpeller
is
bool
&&
enableImpeller
;
}
// Copy the assets.
final
Depfile
assetDepfile
=
await
copyAssets
(
environment
,
assetDirectory
,
targetPlatform:
TargetPlatform
.
ios
,
shaderTarget:
isImpellerEnabled
()
?
ShaderTarget
.
impelleriOS
:
ShaderTarget
.
sksl
,
// Always specify an impeller shader target so that we support runtime toggling and
// the --enable-impeller debug flag.
shaderTarget:
ShaderTarget
.
impelleriOS
,
additionalInputs:
<
File
>[
flutterProject
.
ios
.
infoPlist
,
flutterProject
.
ios
.
appFrameworkInfoPlist
,
...
...
packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart
View file @
1cfdac4b
...
...
@@ -217,6 +217,78 @@ void main() {
expect
(
assetDirectory
.
childFile
(
'isolate_snapshot_data'
),
exists
);
expect
(
assetDirectory
.
childFile
(
'io.flutter.shaders.json'
),
exists
);
expect
(
assetDirectory
.
childFile
(
'io.flutter.shaders.json'
).
readAsStringSync
(),
'{"data":{"A":"B"}}'
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
Platform:
()
=>
macPlatform
,
});
testUsingContext
(
'DebugIosApplicationBundle with impeller and shader compilation'
,
()
async
{
// Create impellerc to work around fallback detection logic.
fileSystem
.
file
(
artifacts
.
getHostArtifact
(
HostArtifact
.
impellerc
)).
createSync
(
recursive:
true
);
environment
.
defines
[
kBuildMode
]
=
'debug'
;
environment
.
defines
[
kCodesignIdentity
]
=
'ABC123'
;
// Precompiled dart data
fileSystem
.
file
(
artifacts
.
getArtifactPath
(
Artifact
.
vmSnapshotData
,
mode:
BuildMode
.
debug
))
.
createSync
();
fileSystem
.
file
(
artifacts
.
getArtifactPath
(
Artifact
.
isolateSnapshotData
,
mode:
BuildMode
.
debug
))
.
createSync
();
// Project info
fileSystem
.
file
(
'pubspec.yaml'
).
writeAsStringSync
(
'name: hello
\n
flutter:
\n
shaders:
\n
- shader.glsl'
);
fileSystem
.
file
(
'.packages'
).
writeAsStringSync
(
'
\n
'
);
// Plist file
fileSystem
.
file
(
fileSystem
.
path
.
join
(
'ios'
,
'Flutter'
,
'AppFrameworkInfo.plist'
))
.
createSync
(
recursive:
true
);
// Shader file
fileSystem
.
file
(
'shader.glsl'
).
writeAsStringSync
(
'test'
);
// App kernel
environment
.
buildDir
.
childFile
(
'app.dill'
).
createSync
(
recursive:
true
);
// Stub framework
environment
.
buildDir
.
childDirectory
(
'App.framework'
)
.
childFile
(
'App'
)
.
createSync
(
recursive:
true
);
final
Directory
frameworkDirectory
=
environment
.
outputDir
.
childDirectory
(
'App.framework'
);
final
File
frameworkDirectoryBinary
=
frameworkDirectory
.
childFile
(
'App'
);
processManager
.
addCommands
(<
FakeCommand
>[
const
FakeCommand
(
command:
<
String
>[
'HostArtifact.impellerc'
,
'--runtime-stage-metal'
,
'--iplr'
,
'--sl=/App.framework/flutter_assets/shader.glsl'
,
'--spirv=/App.framework/flutter_assets/shader.glsl.spirv'
,
'--input=/shader.glsl'
,
'--input-type=frag'
,
'--include=/'
]),
FakeCommand
(
command:
<
String
>[
'codesign'
,
'--force'
,
'--sign'
,
'ABC123'
,
'--timestamp=none'
,
frameworkDirectoryBinary
.
path
,
]),
]);
await
const
DebugIosApplicationBundle
().
build
(
environment
);
expect
(
processManager
,
hasNoRemainingExpectations
);
expect
(
frameworkDirectoryBinary
,
exists
);
expect
(
frameworkDirectory
.
childFile
(
'Info.plist'
),
exists
);
final
Directory
assetDirectory
=
frameworkDirectory
.
childDirectory
(
'flutter_assets'
);
expect
(
assetDirectory
.
childFile
(
'kernel_blob.bin'
),
exists
);
expect
(
assetDirectory
.
childFile
(
'AssetManifest.json'
),
exists
);
expect
(
assetDirectory
.
childFile
(
'vm_snapshot_data'
),
exists
);
expect
(
assetDirectory
.
childFile
(
'isolate_snapshot_data'
),
exists
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
Platform:
()
=>
macPlatform
,
});
testUsingContext
(
'ReleaseIosApplicationBundle build'
,
()
async
{
...
...
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