generate native image files in the .native_image folder for the pkg aot.
[platform/core/dotnet/launcher.git] / NativeLauncher / installer-plugin / tpatool.cc
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <fstream>
18 #include <string>
19 #include <iostream>
20
21 #include "utils.h"
22
23 const char* __RUNTIME_DIR = "/usr/share/dotnet.tizen/netcoreapp";
24 const char* __TIZENFX_DIR = "/usr/share/dotnet.tizen/framework";
25 const char* __TIZENFX_REF_DIR = "/usr/share/dotnet.tizen/framework/ref";
26 const char* __PLATFORM_TPA_CACHE = "/usr/share/dotnet.tizen/lib/platform_tpa_cache";
27
28 int main(int argc, char* argv[])
29 {
30     std::string tpaList;
31     std::vector<std::string> tpaDir;
32
33     tpaDir.push_back(__RUNTIME_DIR);
34     tpaDir.push_back(__TIZENFX_DIR);
35     tpaDir.push_back(__TIZENFX_REF_DIR);
36
37     assembliesInDirectory(tpaDir, tpaList);
38
39     std::ofstream out(__PLATFORM_TPA_CACHE);
40     out << tpaList;
41     out.close();
42     
43     return 0;
44 }
45