diff --git a/tools/winscope/README.md b/tools/winscope/README.md index dc4c2ea6f..8821601f0 100644 --- a/tools/winscope/README.md +++ b/tools/winscope/README.md @@ -19,5 +19,4 @@ contain the proto definitions for their internal states. ### Building with internal extensions Internal paths in vendor/ which are not available in AOSP must be replaced by -stub files. Actual path can be optionally picked up using env args. For -example, to pick up Wayland support, run `WAYLAND=yes yarn run dev` +stub files. See getWaylandSafePath for an example diff --git a/tools/winscope/webpack.config.js b/tools/winscope/webpack.config.js index 2dcb43809..ff31ff361 100644 --- a/tools/winscope/webpack.config.js +++ b/tools/winscope/webpack.config.js @@ -14,14 +14,16 @@ * limitations under the License. */ +const fs = require('fs'); var path = require('path') var webpack = require('webpack') var HtmlWebpackPlugin = require('html-webpack-plugin') var HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin') function getWaylandSafePath() { - if (process.env.WAYLAND) { - return path.resolve(__dirname, '../../../vendor/google_arc/libs/wayland_service'); + waylandPath = path.resolve(__dirname, '../../../vendor/google_arc/libs/wayland_service'); + if (fs.existsSync(waylandPath)) { + return waylandPath; } return path.resolve(__dirname, 'src/stubs'); }