feat(install): generate NuGet packages
This commit is contained in:
1 parent
97709d37a5
commit
b7c224cf67
7 files changed
+172
-5
No files matched your search
@@ -1137,6 +1137,29 @@ void build(Void::Build::Project &p) {
|
||||
Void::Testing::expect_eq(read_be64(koly, 492), (data_fork_length + 511) / 512);
|
||||
Void::Testing::expect(dmg_bytes->substr(257, 5) == "ustar"); // tar payload
|
||||
|
||||
// NuGet package (.nupkg): OPC ZIP with the nuspec and native runtime assets.
|
||||
const auto nupkg_archive = tmp / "cli_hi.nupkg";
|
||||
auto nuget_req = inst_req;
|
||||
for (auto &arg : nuget_req.arguments) {
|
||||
if (arg == installer_archive.string()) {
|
||||
arg = nupkg_archive.string();
|
||||
}
|
||||
}
|
||||
nuget_req.arguments.push_back("--archive-format");
|
||||
nuget_req.arguments.push_back("nuget");
|
||||
auto nuget_res = Platform::run_supervised(nuget_req);
|
||||
Void::Testing::expect(nuget_res.has_value() && nuget_res->succeeded());
|
||||
auto nupkg_bytes = Void::FileSystem::read_file(nupkg_archive);
|
||||
Void::Testing::require(nupkg_bytes.has_value());
|
||||
Void::Testing::expect(nupkg_bytes->starts_with(std::string("PK\x03\x04", 4)));
|
||||
Void::Testing::expect(nupkg_bytes->find("CliHiPkg.nuspec") != std::string::npos);
|
||||
Void::Testing::expect(nupkg_bytes->find("<id>CliHiPkg</id>") != std::string::npos);
|
||||
Void::Testing::expect(nupkg_bytes->find("<version>0.1.0</version>") != std::string::npos);
|
||||
Void::Testing::expect(nupkg_bytes->find("[Content_Types].xml") != std::string::npos);
|
||||
Void::Testing::expect(nupkg_bytes->find("_rels/.rels") != std::string::npos);
|
||||
Void::Testing::expect(nupkg_bytes->find("runtimes/") != std::string::npos);
|
||||
Void::Testing::expect(nupkg_bytes->find("/native/bin/cli_hi") != std::string::npos);
|
||||
|
||||
// RPM package generator: lead + header magic + newc cpio payload.
|
||||
const auto rpm_archive = tmp / "cli_hi.rpm";
|
||||
auto rpm_req = inst_req;
|
||||
|
||||
Reference in new issue
Block a user