Moving step_generate_xml to wgt directory 95/46495/3
authorWojciech Kosowicz <w.kosowicz@samsung.com>
Fri, 21 Aug 2015 07:05:29 +0000 (09:05 +0200)
committerPawel Sikorski <p.sikorski@samsung.com>
Fri, 21 Aug 2015 13:00:22 +0000 (06:00 -0700)
Change-Id: I07a279f2ca3dc03547808fbfa6d1a96866794b42

src/common/CMakeLists.txt
src/tpk/tpk_installer.cc
src/wgt/CMakeLists.txt
src/wgt/step/step_generate_xml.cc [moved from src/common/step/step_generate_xml.cc with 97% similarity]
src/wgt/step/step_generate_xml.h [moved from src/common/step/step_generate_xml.h with 79% similarity]
src/wgt/wgt_installer.cc

index 4d2869c..78eb24e 100644 (file)
@@ -20,7 +20,6 @@ SET(SRCS
   step/step_copy_storage_directories.cc
   step/step_create_storage_directories.cc
   step/step_fail.cc
-  step/step_generate_xml.cc
   step/step_recover_application.cc
   step/step_recover_files.cc
   step/step_recover_icons.cc
index d56325a..586290a 100644 (file)
@@ -10,7 +10,6 @@
 #include "common/step/step_copy_backup.h"
 #include "common/step/step_check_old_certificate.h"
 #include "common/step/step_fail.h"
-#include "common/step/step_generate_xml.h"
 #include "common/step/step_old_manifest.h"
 #include "common/step/step_open_recovery_file.h"
 #include "common/step/step_parse.h"
index ec050d8..3b52fdf 100644 (file)
@@ -4,6 +4,7 @@ SET(SRCS
   step/step_check_settings_level.cc
   step/step_create_symbolic_link.cc
   step/step_encrypt_resources.cc
+  step/step_generate_xml.cc
   step/step_parse.cc
   step/step_remove_encryption_data.cc
   step/step_parse_recovery.cc
similarity index 97%
rename from src/common/step/step_generate_xml.cc
rename to src/wgt/step/step_generate_xml.cc
index 273dd76..2ea8d66 100755 (executable)
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a apache 2.0 license that can be
 // found in the LICENSE file.
 
-#include "common/step/step_generate_xml.h"
+#include "wgt/step/step_generate_xml.h"
 
 #include <boost/filesystem/path.hpp>
 #include <boost/system/error_code.hpp>
@@ -24,7 +24,7 @@
 namespace bs = boost::system;
 namespace fs = boost::filesystem;
 
-namespace common_installer {
+namespace wgt {
 namespace pkgmgr {
 
 static void _writeUIApplicationAttributes(
@@ -44,7 +44,7 @@ static void _writeServiceApplicationAttributes(
 }
 
 template <typename T>
-Step::Status StepGenerateXml::GenerateApplicationCommonXml(T* app,
+common_installer::Step::Status StepGenerateXml::GenerateApplicationCommonXml(T* app,
     xmlTextWriterPtr writer) {
   // common appributes among uiapplication_x and serviceapplication_x
   xmlTextWriterWriteAttribute(writer, BAD_CAST "appid", BAD_CAST app->appid);
@@ -142,7 +142,7 @@ Step::Status StepGenerateXml::GenerateApplicationCommonXml(T* app,
   return Step::Status::OK;
 }
 
-Step::Status StepGenerateXml::precheck() {
+common_installer::Step::Status StepGenerateXml::precheck() {
   if (!context_->manifest_data.get()) {
     LOG(ERROR) << "manifest_data attribute is empty";
     return Step::Status::INVALID_VALUE;
@@ -162,7 +162,7 @@ Step::Status StepGenerateXml::precheck() {
   return Step::Status::OK;
 }
 
-Step::Status StepGenerateXml::process() {
+common_installer::Step::Status StepGenerateXml::process() {
   fs::path xml_path = fs::path(getUserManifestPath(context_->uid.get()))
       / fs::path(context_->pkgid.get());
   xml_path += ".xml";
@@ -350,7 +350,7 @@ Step::Status StepGenerateXml::process() {
   return Status::OK;
 }
 
-Step::Status StepGenerateXml::undo() {
+common_installer::Step::Status StepGenerateXml::undo() {
   bs::error_code error;
   if (fs::exists(context_->xml_path.get()))
     fs::remove_all(context_->xml_path.get(), error);
@@ -358,4 +358,4 @@ Step::Status StepGenerateXml::undo() {
 }
 
 }  // namespace pkgmgr
-}  // namespace common_installer
+}  // namespace wgt
similarity index 79%
rename from src/common/step/step_generate_xml.h
rename to src/wgt/step/step_generate_xml.h
index 19b46f0..bb1bd23 100644 (file)
@@ -3,8 +3,8 @@
 // Use of this source code is governed by a apache 2.0 license that can be
 // found in the LICENSE file.
 
-#ifndef  COMMON_STEP_STEP_GENERATE_XML_H_
-#define  COMMON_STEP_STEP_GENERATE_XML_H_
+#ifndef  WGT_STEP_STEP_GENERATE_XML_H_
+#define  WGT_STEP_STEP_GENERATE_XML_H_
 
 #include <libxml/xmlwriter.h>
 
 #include "common/step/step.h"
 #include "common/utils/logging.h"
 
-namespace common_installer {
+namespace wgt {
 namespace pkgmgr {
 
-class StepGenerateXml : public Step {
+class StepGenerateXml : public common_installer::Step {
  public:
   using Step::Step;
 
@@ -35,6 +35,6 @@ class StepGenerateXml : public Step {
 };
 
 }  // namespace pkgmgr
-}  // namespace common_installer
+}  // namespace wgt
 
-#endif  // COMMON_STEP_STEP_GENERATE_XML_H_
+#endif  // WGT_STEP_STEP_GENERATE_XML_H_
index c900cad..b56b148 100644 (file)
@@ -14,7 +14,6 @@
 #include "common/step/step_copy_backup.h"
 #include "common/step/step_copy_storage_directories.h"
 #include "common/step/step_fail.h"
-#include "common/step/step_generate_xml.h"
 #include "common/step/step_open_recovery_file.h"
 #include "common/step/step_parse.h"
 #include "common/step/step_register_app.h"
@@ -42,6 +41,7 @@
 #include "wgt/step/step_create_symbolic_link.h"
 #include "wgt/step/step_check_settings_level.h"
 #include "wgt/step/step_encrypt_resources.h"
+#include "wgt/step/step_generate_xml.h"
 #include "wgt/step/step_parse.h"
 #include "wgt/step/step_parse_recovery.h"
 #include "wgt/step/step_remove_encryption_data.h"
@@ -73,7 +73,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<wgt::filesystem::StepWgtCreateStorageDirectories>();
       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
       AddStep<wgt::filesystem::StepWgtCreateIcons>();
-      AddStep<ci::pkgmgr::StepGenerateXml>();
+      AddStep<wgt::pkgmgr::StepGenerateXml>();
       AddStep<ci::pkgmgr::StepRegisterApplication>();
       AddStep<ci::security::StepRegisterSecurity>();
       break;
@@ -94,7 +94,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
       AddStep<wgt::filesystem::StepWgtCreateIcons>();
       AddStep<ci::security::StepUpdateSecurity>();
-      AddStep<ci::pkgmgr::StepGenerateXml>();
+      AddStep<wgt::pkgmgr::StepGenerateXml>();
       AddStep<ci::pkgmgr::StepUpdateApplication>();
       break;
     }