diff options
Diffstat (limited to 'pkgs/build-support/dart')
-rw-r--r-- | pkgs/build-support/dart/build-dart-application/default.nix | 2 | ||||
-rw-r--r-- | pkgs/build-support/dart/build-dart-application/hooks/dart-install-hook.sh | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/pkgs/build-support/dart/build-dart-application/default.nix b/pkgs/build-support/dart/build-dart-application/default.nix index f9a49fec3a2d8..c99b8bbf325e9 100644 --- a/pkgs/build-support/dart/build-dart-application/default.nix +++ b/pkgs/build-support/dart/build-dart-application/default.nix @@ -87,7 +87,7 @@ let dartCompileCommand dartOutputType dartRuntimeCommand dartCompileFlags dartJitFlags; - outputs = args.outputs or [ ] ++ [ "out" "pubcache" ]; + outputs = [ "out" "pubcache" ] ++ args.outputs or [ ]; dartEntryPoints = if (dartEntryPoints != null) diff --git a/pkgs/build-support/dart/build-dart-application/hooks/dart-install-hook.sh b/pkgs/build-support/dart/build-dart-application/hooks/dart-install-hook.sh index 888e12a07d83e..349a0dfdef0e0 100644 --- a/pkgs/build-support/dart/build-dart-application/hooks/dart-install-hook.sh +++ b/pkgs/build-support/dart/build-dart-application/hooks/dart-install-hook.sh @@ -19,15 +19,25 @@ dartInstallHook() { fi done < <(_getDartEntryPoints) + runHook postInstall + + echo "Finished dartInstallHook" +} + +dartInstallCacheHook() { + echo "Executing dartInstallCacheHook" + # Install the package_config.json file. mkdir -p "$pubcache" cp .dart_tool/package_config.json "$pubcache/package_config.json" - runHook postInstall - - echo "Finished dartInstallHook" + echo "Finished dartInstallCacheHook" } if [ -z "${dontDartInstall-}" ] && [ -z "${installPhase-}" ]; then installPhase=dartInstallHook fi + +if [ -z "${dontDartInstallCache-}" ]; then + postInstallHooks+=(dartInstallCacheHook) +fi |