Adjust required_version with minimum platform version of profile 05/55905/1 accepted/tizen/mobile/20151230.115824 accepted/tizen/tv/20151230.115903 accepted/tizen/wearable/20151230.115931 submit/tizen/20151230.055037
authorWonYoung Choi <wy80.choi@samsung.com>
Wed, 30 Dec 2015 05:40:38 +0000 (14:40 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Wed, 30 Dec 2015 05:40:38 +0000 (14:40 +0900)
The minimum platform versions of each profile are different. So
the required_version of config.xml should be adjusted with different
value for each profile.
Currently, the required_version will be changed if it has lower value
than the minimum platform version with below values.
- TV: 2.3
- Others: 2.2.1

Change-Id: If487bae32b9e8941dba5ca300e9f404cf57a647c

CMakeLists.txt
packaging/manifest-parser.spec
src/manifest_handlers/platform_version.cc
src/manifest_handlers/platform_version.h
src/manifest_handlers/tizen_application_handler.cc

index 780ed5021c4db1ae2ac66e5ff1bdad9933d88a78..37fa8c886638a1f0875ecdef4e2df562e4c1548d 100644 (file)
@@ -36,6 +36,13 @@ ADD_DEFINITIONS("-fPIE")
 ADD_DEFINITIONS("-fPIC")
 
 ADD_DEFINITIONS("-DTIZEN_VERSION=\"${TIZEN_VERSION}\"")
+IF(TIZEN_PROFILE STREQUAL "tv")
+  ADD_DEFINITIONS("-DTIZEN_TV")
+ELSEIF(TIZEN_PROFILE STREQUAL "mobile")
+  ADD_DEFINITIONS("-DTIZEN_MOBILE")
+ELSEIF(TIZEN_PROFILE STREQUAL "wearable")
+  ADD_DEFINITIONS("-DTIZEN_WEARABLE")
+ENDIF()
 
 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
 INCLUDE(FindPkgConfig)
index b4f8bb5bc974fb2b77cf40795a08aa434fc5c381..52c3cf7d31db5883cf2b6c93fc415364518e4e08 100644 (file)
@@ -57,7 +57,9 @@ cp %{SOURCE100} .
 # is used in CMakeLists.txt files to distinguish, which project
 # is currently being build.
 %cmake . -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
-         -DTIZEN_VERSION=%{tizen_version}
+         -DTIZEN_VERSION=%{tizen_version} \
+         -DTIZEN_PROFILE=%{profile}
+
 make %{?_smp_mflags}
 
 %install
@@ -111,7 +113,7 @@ make %{?_smp_mflags}
 - TPK handlers added
 
 * Tue Aug 18 2015 Pawel Sikorski <p.sikorski@samsung.com> 1.2-1
-- ConfigParsing and StartFile validation separation; 
+- ConfigParsing and StartFile validation separation;
 - AlwaysValidate removed, version checking improved
 
 * Fri Aug 14 2015 Pawel Sikorski <p.sikorski@samsung.com> 1.1-1
index 7f05afc5230212db8bc7c035afb886e85fe01465..3de49d436b9a972ad00e123c8f52dcfe077ab0b0 100644 (file)
@@ -10,4 +10,14 @@ utils::VersionNumber GetCurrentPlatformVersion() {
   return utils::VersionNumber(TIZEN_VERSION);
 }
 
+utils::VersionNumber GetMinimumPlatformVersion() {
+#ifdef TIZEN_TV
+  return utils::VersionNumber("2.3");
+#elif TIZEN_WEARABLE
+  return utils::VersionNumber("2.3.1");
+#else
+  return utils::VersionNumber("2.2.1");
+#endif
+}
+
 }  // namespace parser
index f8b8c5b0b932ecf5428007bbc0ce386d5e388321..e6469f9b50fea1aabb25907140f65455cc00acab 100644 (file)
@@ -16,6 +16,12 @@ namespace parser {
  */
 utils::VersionNumber GetCurrentPlatformVersion();
 
+/**
+ * @brief GetMinimumPlatformVersion
+ * @return number version of the minimum platform for current profile
+ */
+utils::VersionNumber GetMinimumPlatformVersion();
+
 }  // namespace parser
 
 #endif  // MANIFEST_HANDLERS_PLATFORM_VERSION_H_
index aeecc6346c5b94d72652a1c6e0a1ca07ac8f6c9f..272d7391a3ee0019c5f413bf2367367e681084b4 100644 (file)
@@ -21,14 +21,13 @@ namespace parse {
 namespace {
 
 const char kTizenApplicationKey[] = "widget.application";
-const utils::VersionNumber kMinimumAPIVersion("2.2.1");
-const utils::VersionNumber kLaunchModeRequiredVersion("2.4");
 const char kTizenNamespacePrefix[] = "http://tizen.org/ns/widgets";
 const char kNamespaceKey[] = "@namespace";
 const char kTizenApplicationIdKey[] = "@id";
 const char kTizenApplicationPackageKey[] = "@package";
 const char kTizenApplicationLaunchModeKey[] = "@launch_mode";
 const char kTizenApplicationRequiredVersionKey[] = "@required_version";
+const utils::VersionNumber kLaunchModeRequiredVersion("2.4");
 }  // namespace
 
 TizenApplicationInfo::TizenApplicationInfo() {}
@@ -84,10 +83,10 @@ bool TizenApplicationHandler::Parse(
   }
   if (app_dict->GetString(kTizenApplicationRequiredVersionKey, &value)) {
     if (!value.empty()) {
-      // TODO(wy80.choi): should consider minimum API version for each profile.
       utils::VersionNumber req_version(value);
-      if (req_version < kMinimumAPIVersion) {
-        app_info->set_required_version(kMinimumAPIVersion.ToString());
+      utils::VersionNumber min_version = parser::GetMinimumPlatformVersion();
+      if (req_version < min_version) {
+        app_info->set_required_version(min_version.ToString());
       } else {
         app_info->set_required_version(value);
       }