| 92 | } // unnamed namespace |
| 93 | |
| 94 | KJob* FlatpakRuntime::createBuildDirectory(const Path& buildDirectory, const Path& file, const QString& arch, |
| 95 | CreationMode creationMode) |
| 96 | { |
| 97 | const auto sourceDirectory = file.parent(); |
| 98 | |
| 99 | auto identifyingName = file.lastPathSegment(); |
| 100 | if (identifyingName == kdeFlatpakManifestFileName) { |
| 101 | // The file name is a standard name that does not identify the application. |
| 102 | // Display the hopefully more useful name of the containing directory. |
| 103 | identifyingName = sourceDirectory.lastPathSegment(); |
| 104 | } else { |
| 105 | constexpr QLatin1String standardExtension(".json"); |
| 106 | if (identifyingName.endsWith(standardExtension)) { |
| 107 | identifyingName.chop(standardExtension.size()); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | QStringList program{QStringLiteral("flatpak-builder"), |
| 112 | QLatin1String("--arch=") + arch, |
| 113 | QStringLiteral("--build-only"), |
| 114 | QStringLiteral("--force-clean"), |
| 115 | QStringLiteral("--ccache"), |
| 116 | buildDirectory.toLocalFile(), |
| 117 | file.toLocalFile()}; |
| 118 | if (creationMode == CreationMode::DisableUpdates) { |
| 119 | program << QStringLiteral("--disable-updates"); |
| 120 | } |
| 121 | |
| 122 | auto* const job = |
| 123 | createExecuteJob(program, i18nc("%1 - application ID or name", "Flatpak Create %1", identifyingName)); |
| 124 | job->setWorkingDirectory(sourceDirectory.toUrl()); |
| 125 | return job; |
| 126 | } |
| 127 | |
| 128 | FlatpakRuntime::FlatpakRuntime(const KDevelop::Path &buildDirectory, const KDevelop::Path &file, const QString &arch) |
| 129 | : KDevelop::IRuntime() |
nothing calls this directly
no test coverage detected