Skip to content

Commit 337e420

Browse files
ice909dengbo11
authored andcommitted
feat: support don't export the develop module
When exporting layer, add --no-develop to avoid exporting the develop module. Signed-off-by: ice909 <[email protected]>
1 parent 6bfebe8 commit 337e420

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

apps/ll-builder/src/main.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ You can report bugs to the linyaps team under this project: https://github.com/O
286286

287287
// build export
288288
bool layerMode = false;
289-
linglong::builder::ExportOption ExportOption{ .exportDevelop = false, .exportI18n = true };
289+
linglong::builder::ExportOption ExportOption{ .exportI18n = true };
290290
auto *buildExport = commandParser.add_subcommand("export", _("Export to linyaps layer or uab"));
291291
buildExport->usage(_("Usage: ll-builder export [OPTIONS]"));
292292

@@ -311,6 +311,8 @@ You can report bugs to the linyaps team under this project: https://github.com/O
311311
->type_name("FILE")
312312
->check(CLI::ExistingFile)
313313
->excludes(layerFlag, fullOpt);
314+
buildExport->add_flag("--no-develop", ExportOption.noExportDevelop, _("Don't export the develop module"))
315+
->needs(layerFlag);
314316

315317
// build push
316318
std::string pushModule;
@@ -814,7 +816,7 @@ You can report bugs to the linyaps team under this project: https://github.com/O
814816
if (!ExportOption.compressor.empty()) {
815817
compressor = ExportOption.compressor.c_str();
816818
}
817-
auto result = builder.exportLayer(QDir::currentPath(), compressor);
819+
auto result = builder.exportLayer(QDir::currentPath(), compressor, ExportOption.noExportDevelop);
818820
if (!result) {
819821
qCritical() << result.error();
820822
return -1;

libs/linglong/src/linglong/builder/linglong_builder.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,8 @@ utils::error::Result<void> Builder::exportUAB(const QString &destination,
14381438
}
14391439

14401440
utils::error::Result<void> Builder::exportLayer(const QString &destination,
1441-
const QString &compressor)
1441+
const QString &compressor,
1442+
const bool &noExportDevelop)
14421443
{
14431444
LINGLONG_TRACE("export layer file");
14441445

@@ -1461,6 +1462,10 @@ utils::error::Result<void> Builder::exportLayer(const QString &destination,
14611462
pkger.setCompressor(compressor);
14621463
}
14631464
for (const auto &module : modules) {
1465+
if (noExportDevelop && module == "develop") {
1466+
continue;
1467+
}
1468+
14641469
auto layerDir = this->repo.getLayerDir(*ref, module);
14651470
if (!layerDir) {
14661471
qCritical().nospace() << "resolve layer " << ref->toString() << "/" << module.c_str()

libs/linglong/src/linglong/builder/linglong_builder.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct ExportOption
2121
std::string iconPath;
2222
std::string loader;
2323
std::string compressor;
24-
bool exportDevelop{ false };
24+
bool noExportDevelop{ false };
2525
bool exportI18n{ false };
2626
bool full{ false };
2727
};
@@ -63,7 +63,7 @@ class Builder
6363

6464
auto exportUAB(const QString &destination, const ExportOption &option)
6565
-> utils::error::Result<void>;
66-
auto exportLayer(const QString &destination, const QString &compressor)
66+
auto exportLayer(const QString &destination, const QString &compressor, const bool &noExportDevelop)
6767
-> utils::error::Result<void>;
6868

6969
static auto extractLayer(const QString &layerPath, const QString &destination)

0 commit comments

Comments
 (0)