Add relative directory support to symbols validation script. (flutter/engine#35936)

This commit is contained in:
godofredoc 2022-09-08 17:37:03 -07:00 committed by GitHub
parent ce10462a1d
commit ca593fb04c

View File

@ -28,7 +28,17 @@ void main(List<String> arguments) {
print('usage: dart verify_exported.dart OUT_DIR [BUILDTOOLS]');
exit(1);
}
final String outPath = arguments.first;
String outPath = arguments.first;
if (p.isRelative(outPath)) {
/// If path is relative then create a full path starting from the engine checkout
/// repository.
if (!Platform.environment.containsKey('ENGINE_CHECKOUT_PATH')) {
print('ENGINE_CHECKOUT_PATH env variable is mandatory when using relative destination path');
exit(1);
}
final String engineCheckoutPath = Platform.environment['ENGINE_CHECKOUT_PATH']!;
outPath = p.join(engineCheckoutPath, outPath);
}
final String buildToolsPath = arguments.length == 1
? p.join(p.dirname(outPath), 'buildtools')
: arguments[1];