forked from facebook/redex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDetectBundle.h
29 lines (24 loc) · 824 Bytes
/
DetectBundle.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <boost/filesystem.hpp>
#include <boost/filesystem/operations.hpp>
#include "JsonWrapper.h"
inline bool has_bundle_config(const std::string& dir) {
std::string bundle_config =
(boost::filesystem::path(dir) / "BundleConfig.pb").string();
return boost::filesystem::exists(bundle_config);
}
inline bool is_apk_or_new_bundle_support_enabled(const std::string& dir,
const JsonWrapper& config) {
if (!has_bundle_config(dir)) {
return true;
}
bool result;
config.get("enable_bleeding_edge_app_bundle_support", true, result);
return result;
}