Bug fix: description generator for lazy loading
authorpius.lee <pius.lee@samsung.com>
Thu, 9 Jul 2015 08:27:15 +0000 (17:27 +0900)
committerpius.lee <pius.lee@samsung.com>
Thu, 9 Jul 2015 08:29:15 +0000 (17:29 +0900)
Add missed xwalk namespace from json

Change-Id: I4fc77d58f9e808d2811114d3e1ae03d146a0ecaa

src/tool/desc_gentool.cc

index 1af6a198f0c580c7fac89cfca82eeced2debc917..094f2eaed19bccc9ce1afed62745242a520578f5 100644 (file)
@@ -12,7 +12,7 @@
 static std::string prefix_ = "libtizen";
 static std::string postfix_ = ".so";
 static std::string target_path_ = "/usr/lib/tizen-extensions-crosswalk/";
-static std::string apinamespace = "tizen";
+static std::vector<std::string> apinamespaces = {"tizen", "xwalk"};
 
 typedef common::Extension *(*CreateExtensionFunc)(void);
 
@@ -36,9 +36,16 @@ void print_json() {
   std::cout << "[" << std::endl;
   for (const auto& kv : descriptions) {
     const module_description &desc = kv.second;
-    if (desc.name.compare(0, apinamespace.size(), apinamespace)) {
+
+    std::string::size_type n = desc.name.find('.');
+    std::string ns =
+        n == std::string::npos ? desc.name : desc.name.substr(0, n);
+
+    if (std::find(apinamespaces.begin(), apinamespaces.end(), ns) ==
+        apinamespaces.end()) {
       continue;
     }
+
     PRINT_TAB();
     std::cout << "{" << std::endl;
     PRINT_TAB();