buildDotnetModule: format with nixpkgs-fmt

This commit is contained in:
Ivar Scholten 2022-09-08 23:30:11 +02:00
parent 4f9f63fb88
commit e100b74627
No known key found for this signature in database
GPG key ID: E22887AD87C33E3C

View file

@ -1,18 +1,18 @@
{ lib
, stdenvNoCC
, callPackage
, writeShellScript
, writeText
, srcOnly
, linkFarmFromDrvs
, symlinkJoin
, makeWrapper
, dotnetCorePackages
, dotnetPackages
, mkNugetSource
, mkNugetDeps
, srcOnly
, writeShellScript
, writeText
, makeWrapper
, nuget-to-nix
, cacert
, symlinkJoin
, coreutils
}:
@ -79,7 +79,8 @@
, dotnet-runtime ? dotnetCorePackages.runtime_6_0
# The dotnet SDK to run tests against. This can differentiate from the SDK compiled against.
, dotnet-test-sdk ? dotnet-sdk
, ... } @ args:
, ...
} @ args:
assert projectFile == null -> throw "Defining the `projectFile` attribute is required. This is usually an `.csproj`, or `.sln` file.";
@ -92,11 +93,13 @@ let
inherit dotnet-sdk dotnet-test-sdk disabledTests nuget-source dotnet-runtime runtimeDeps buildType;
}) dotnetConfigureHook dotnetBuildHook dotnetCheckHook dotnetInstallHook dotnetFixupHook;
localDeps = if (projectReferences != [])
localDeps =
if (projectReferences != [ ])
then linkFarmFromDrvs "${name}-project-references" projectReferences
else null;
_nugetDeps = if lib.isDerivation nugetDeps
_nugetDeps =
if lib.isDerivation nugetDeps
then nugetDeps
else mkNugetDeps { inherit name; nugetDeps = import nugetDeps; };
@ -124,7 +127,8 @@ let
name = "${name}-nuget-source";
paths = [ _dependenciesSource _sdkSource ];
};
in stdenvNoCC.mkDerivation (args // {
in
stdenvNoCC.mkDerivation (args // {
nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [
dotnetConfigureHook
dotnetBuildHook
@ -150,7 +154,8 @@ in stdenvNoCC.mkDerivation (args // {
passthru = {
inherit nuget-source;
fetch-deps = let
fetch-deps =
let
# Because this list is rather long its put in its own store path to maintain readability of the generated script
exclusions = writeText "nuget-package-exclusions" (lib.concatStringsSep "\n" (dotnet-sdk.passthru.packages { fetchNuGet = attrs: attrs.pname; }));
@ -166,7 +171,8 @@ in stdenvNoCC.mkDerivation (args // {
in
builtins.filter (flag: !(hasRid flag)) (dotnetFlags ++ dotnetRestoreFlags);
in writeShellScript "fetch-${pname}-deps" ''
in
writeShellScript "fetch-${pname}-deps" ''
set -euo pipefail
export PATH="${lib.makeBinPath [ coreutils dotnet-sdk nuget-to-nix ]}"