From ca593fb04c9da55067611d094bf59c6d33daf485 Mon Sep 17 00:00:00 2001 From: godofredoc Date: Thu, 8 Sep 2022 17:37:03 -0700 Subject: [PATCH] Add relative directory support to symbols validation script. (flutter/engine#35936) --- .../src/flutter/testing/symbols/verify_exported.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/testing/symbols/verify_exported.dart b/engine/src/flutter/testing/symbols/verify_exported.dart index d61bed3d8b8..9075aed06a6 100644 --- a/engine/src/flutter/testing/symbols/verify_exported.dart +++ b/engine/src/flutter/testing/symbols/verify_exported.dart @@ -28,7 +28,17 @@ void main(List 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];