Unverified Commit f777c9f6 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] use absolute path for shader lib (#116123)

* [flutter_tools] use absolute path for shader lib

* update tests
parent 4c3b642f
...@@ -175,8 +175,7 @@ class ShaderCompiler { ...@@ -175,8 +175,7 @@ class ShaderCompiler {
); );
} }
final String shaderLibPath = _fs.path.join(_fs.path.dirname(impellerc.path), 'shader_lib'); final String shaderLibPath = _fs.path.join(impellerc.parent.absolute.path, 'shader_lib');
final List<String> cmd = <String>[ final List<String> cmd = <String>[
impellerc.path, impellerc.path,
target.target, target.target,
...@@ -190,6 +189,7 @@ class ShaderCompiler { ...@@ -190,6 +189,7 @@ class ShaderCompiler {
'--include=${input.parent.path}', '--include=${input.parent.path}',
'--include=$shaderLibPath', '--include=$shaderLibPath',
]; ];
_logger.printTrace('shaderc command: $cmd');
final Process impellercProcess = await _processManager.start(cmd); final Process impellercProcess = await _processManager.start(cmd);
final int code = await impellercProcess.exitCode; final int code = await impellercProcess.exitCode;
if (code != 0) { if (code != 0) {
......
...@@ -17,7 +17,7 @@ import 'package:flutter_tools/src/globals.dart' as globals; ...@@ -17,7 +17,7 @@ import 'package:flutter_tools/src/globals.dart' as globals;
import '../src/common.dart'; import '../src/common.dart';
import '../src/context.dart'; import '../src/context.dart';
const String shaderLibDir = './shader_lib'; const String shaderLibDir = '/./shader_lib';
void main() { void main() {
group('AssetBundle.build', () { group('AssetBundle.build', () {
......
...@@ -263,7 +263,7 @@ void main() { ...@@ -263,7 +263,7 @@ void main() {
'--input=/shader.glsl', '--input=/shader.glsl',
'--input-type=frag', '--input-type=frag',
'--include=/', '--include=/',
'--include=./shader_lib', '--include=/./shader_lib',
]), ]),
FakeCommand(command: <String>[ FakeCommand(command: <String>[
'codesign', 'codesign',
......
...@@ -16,7 +16,7 @@ import '../../../src/common.dart'; ...@@ -16,7 +16,7 @@ import '../../../src/common.dart';
import '../../../src/fake_process_manager.dart'; import '../../../src/fake_process_manager.dart';
const String fragDir = '/shaders'; const String fragDir = '/shaders';
const String shaderLibDir = './shader_lib'; const String shaderLibDir = '/./shader_lib';
const String fragPath = '/shaders/my_shader.frag'; const String fragPath = '/shaders/my_shader.frag';
const String notFragPath = '/shaders/not_a_frag.file'; const String notFragPath = '/shaders/not_a_frag.file';
const String outputSpirvPath = '/output/shaders/my_shader.frag.spirv'; const String outputSpirvPath = '/output/shaders/my_shader.frag.spirv';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment