* limitations under the License.
*/
-#include "dotnet_launcher.h"
+#include "core_runtime.h"
#include "utils.h"
#include "log.h"
#define APPID_MAX_LENGTH (25 + 105)
#define PRC_NAME_LENGTH 16
+static const char* KEY_TIZEN_UIFW = "TIZEN_UIFW";
static std::string StandaloneOption("--standalone");
static std::string PaddingOption("--PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE");
+static std::string AppTypeOption("--appType");
+static std::string UIFWOption(KEY_TIZEN_UIFW);
+static std::string ProfileOption("--profile");
+static std::string GlobalizationInvariantOption("--invariant");
int main(int argc, char *argv[])
{
+ printHWClockLog("[dotnet-launcher] launcher main!");
_INFO("##### Run in standalone mode #####");
char* standalonePath = nullptr;
bool paddingExist = false;
+ bool profile = false;
+ const char* appType = "dotnet";
+ const char* UIFWType = "NUI";
const char* appRootPath = NULL;
char appId[APPID_MAX_LENGTH] = {0,};
// start index 1 to avoid passing executable name "dotnet-launcher" as a parameter
for (int i = 1; i < argc; i++) {
- if (StandaloneOption.compare(argv[i]) == 0) {
+
+ if (GlobalizationInvariantOption.compare(argv[i]) == 0) {
+ setenv("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT", "1", 1);
+ setenv("DOTNET_SYSTEM_GLOBALIZATION_PREDEFINED_CULTURES_ONLY", "false", 1);
+ } else if (StandaloneOption.compare(argv[i]) == 0) {
if (i > argc - 1) {
- _ERR("Assembly path must be after \"--standalone\" option");
+ _ERR("Assembly path must be after %s option", StandaloneOption.c_str());
return -1;
}
i++;
standalonePath = argv[i];
} else if (PaddingOption.compare(argv[i]) == 0) {
paddingExist = true;
+ } else if (ProfileOption.compare(argv[i]) == 0) {
+ profile = true;
+ } else if (AppTypeOption.compare(argv[i]) == 0) {
+ if (i > argc - 1) {
+ _ERR("app type for launchpad must be after %s option", AppTypeOption.c_str());
+ return -1;
+ }
+ i++;
+ appType = argv[i];
+ } else if (UIFWOption.compare(argv[i]) == 0) {
+ if (i > argc - 1) {
+ _ERR("UIFW type for launchpad must be after %s option", UIFWOption.c_str());
+ return -1;
+ }
+ i++;
+ UIFWType = argv[i];
} else {
vargs.push_back(argv[i]);
}
}
- std::unique_ptr<CoreRuntime> runtime(new CoreRuntime("standalone"));
-
// get app ID and app root path
if (AUL_R_OK == aul_app_get_appid_bypid(getpid(), appId, sizeof(appId))) {
_INFO("AUL_APPID : %s", appId);
memset(argv[0], '\0', cmdlineSize);
snprintf(argv[0], cmdlineSize - 1, "%s", standalonePath);
- // initialize CoreRuntime (standalone mode enable, dlog redirection enable, root path NULL)
- if (runtime->initialize(LaunchMode::launcher) != 0) {
+ setenv(KEY_TIZEN_UIFW, UIFWType, 1);
+ _INFO("TIZEN_UIFW is set to %s", UIFWType);
+
+ // initialize CoreRuntime
+ int err = CoreRuntime::initialize(appType, LaunchMode::launcher);
+ if (err) {
_ERR("Failed to initialize");
- return -1;
+ } else {
+ // launch application
+ err = CoreRuntime::launch(appId, appRootPath, standalonePath, vargs.size(), &vargs[0], profile);
+ if (err) {
+ _ERR("Failed to launch");
+ }
}
- // launch application
- if (runtime->launch(appId, appRootPath, standalonePath, vargs.size(), &vargs[0])) {
- _ERR("Failed to launch");
- return -1;
- }
+ // finalize CoreRuntime
+ CoreRuntime::finalize();
- return 0;
+ return err;
}