MCPcopy Create free account
hub / github.com/KDE/kdevelop / createBuildDirectory

Method createBuildDirectory

plugins/flatpak/flatpakruntime.cpp:94–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92} // unnamed namespace
93
94KJob* 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
128FlatpakRuntime::FlatpakRuntime(const KDevelop::Path &buildDirectory, const KDevelop::Path &file, const QString &arch)
129 : KDevelop::IRuntime()

Callers

nothing calls this directly

Calls 8

createExecuteJobFunction · 0.85
lastPathSegmentMethod · 0.80
endsWithMethod · 0.80
toLocalFileMethod · 0.80
parentMethod · 0.45
sizeMethod · 0.45
setWorkingDirectoryMethod · 0.45
toUrlMethod · 0.45

Tested by

no test coverage detected