| 77 | } |
| 78 | |
| 79 | bool CodePorting::start(const QString &projectSrcPath, const QString &srcCPU, const QString &buildDir, const QString &destCPU) |
| 80 | { |
| 81 | if (status == kRuning) |
| 82 | return false; |
| 83 | |
| 84 | // check script and source dirctory is exists. |
| 85 | QString scriptPath = CustomPaths::global(CustomPaths::Scripts); |
| 86 | QString portingCli = scriptPath + "/porting-script/code_porting.py"; |
| 87 | QDir dir; |
| 88 | if (!QFile::exists(portingCli) || !dir.exists(projectSrcPath)) |
| 89 | return false; |
| 90 | |
| 91 | projSrcPath = projectSrcPath; |
| 92 | |
| 93 | process.setProgram(getPython()); |
| 94 | QStringList args; |
| 95 | args.append(portingCli); |
| 96 | args.append("-S"); |
| 97 | args.append(projectSrcPath); |
| 98 | args.append("-B"); |
| 99 | args.append(buildDir); |
| 100 | args.append("--scpu"); |
| 101 | args.append(srcCPU); |
| 102 | args.append("--dcpu"); |
| 103 | args.append(destCPU); |
| 104 | process.setArguments(args); |
| 105 | process.start(); |
| 106 | process.waitForFinished(-1); |
| 107 | |
| 108 | return true; |
| 109 | } |
| 110 | |
| 111 | bool CodePorting::abort() |
| 112 | { |
no test coverage detected