Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
40 lines
1.1 KiB
Nix
40 lines
1.1 KiB
Nix
{
|
||
lib,
|
||
dotnet-sdk,
|
||
buildPackages, # buildDotnetModule
|
||
testers,
|
||
runCommand,
|
||
}:
|
||
let
|
||
# Note: without structured attributes, we can’t use derivation arguments that
|
||
# contain spaces unambiguously because arguments are passed as space-separated
|
||
# environment variables.
|
||
copyrightString = "Public domain 🅮";
|
||
|
||
inherit (buildPackages) buildDotnetModule;
|
||
|
||
app = buildDotnetModule {
|
||
name = "structured-attrs-test-application";
|
||
src = ./src;
|
||
nugetDeps = ./nuget-deps.json;
|
||
dotnetFlags = [ "--property:Copyright=${copyrightString}" ];
|
||
env.TargetFramework = "net${lib.versions.majorMinor (lib.getVersion dotnet-sdk)}";
|
||
__structuredAttrs = true;
|
||
};
|
||
in
|
||
{
|
||
no-structured-attrs = testers.testBuildFailure (
|
||
app.overrideAttrs {
|
||
__structuredAttrs = false;
|
||
}
|
||
);
|
||
|
||
check-output = testers.testEqualContents {
|
||
assertion = "buildDotnetModule sets AssemblyCopyrightAttribute with structured attributes";
|
||
expected = builtins.toFile "expected-copyright.txt" copyrightString;
|
||
actual = runCommand "dotnet-structured-attrs-test" { } ''
|
||
${app}/bin/Application >"$out"
|
||
'';
|
||
};
|
||
}
|