From 98917dc1867c5583878c335f923feeb073dc793d Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Thu, 3 Dec 2015 09:52:40 +0100 Subject: [PATCH] Generate deviceprofile list for tpk Requires: - https://review.tizen.org/gerrit/53280 - https://review.tizen.org/gerrit/53288 Change-Id: Ic166436b24531b42166328e5651876db7f938850 --- src/common/step/step_generate_xml.cc | 8 ++++++++ src/tpk/step/step_parse.cc | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/common/step/step_generate_xml.cc b/src/common/step/step_generate_xml.cc index 53629d8..565257a 100644 --- a/src/common/step/step_generate_xml.cc +++ b/src/common/step/step_generate_xml.cc @@ -356,6 +356,14 @@ common_installer::Step::Status StepGenerateXml::process() { xmlTextWriterEndElement(writer); } + for (const char* profile : + GListRange(context_->manifest_data.get()->deviceprofile)) { + xmlTextWriterStartElement(writer, BAD_CAST "profile"); + xmlTextWriterWriteAttribute(writer, BAD_CAST "name", + BAD_CAST profile); + xmlTextWriterEndElement(writer); + } + const auto& shortcuts = context_->manifest_plugins_data.get().shortcut_info.get(); if (!shortcuts.empty()) { diff --git a/src/tpk/step/step_parse.cc b/src/tpk/step/step_parse.cc index 850858a..228ded5 100644 --- a/src/tpk/step/step_parse.cc +++ b/src/tpk/step/step_parse.cc @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -129,6 +130,16 @@ bool StepParse::FillPackageInfo(manifest_x* manifest) { manifest->installlocation = strdup(app_info->install_location().c_str()); manifest->api_version = strdup(app_info->api_version().c_str()); + std::shared_ptr profile_info = + std::static_pointer_cast( + parser_->GetManifestData(ProfileInfo::Key())); + if (profile_info) { + for (auto& profile : profile_info->profiles()) { + manifest->deviceprofile = g_list_append(manifest->deviceprofile, + strdup(profile.c_str())); + } + } + if (ui_application_list) { manifest->mainapp_id = strdup(ui_application_list->items[0].ui_info.appid().c_str()); -- 2.7.4