| 68 | } |
| 69 | |
| 70 | void ExtractNatives::executeTask() |
| 71 | { |
| 72 | auto instance = m_parent->instance(); |
| 73 | auto toExtract = instance->getNativeJars(); |
| 74 | if (toExtract.isEmpty()) { |
| 75 | emitSucceeded(); |
| 76 | return; |
| 77 | } |
| 78 | auto settings = instance->settings(); |
| 79 | |
| 80 | auto outputPath = instance->getNativePath(); |
| 81 | FS::ensureFolderPathExists(outputPath); |
| 82 | auto javaVersion = instance->getJavaVersion(); |
| 83 | bool jniHackEnabled = javaVersion.major() >= 8; |
| 84 | for (const auto& source : toExtract) { |
| 85 | if (!unzipNatives(source, outputPath, jniHackEnabled)) { |
| 86 | const char* reason = QT_TR_NOOP("Couldn't extract native jar '%1' to destination '%2'"); |
| 87 | emit logLine(QString(reason).arg(source, outputPath), MessageLevel::Fatal); |
| 88 | emitFailed(tr(reason).arg(source, outputPath)); |
| 89 | } |
| 90 | } |
| 91 | emitSucceeded(); |
| 92 | } |
| 93 | |
| 94 | void ExtractNatives::finalize() |
| 95 | { |
nothing calls this directly
no test coverage detected