Commit 321f6db3 authored by Oleg Grenrus's avatar Oleg Grenrus

Output flib binfile location in plan.json

Also output extension for executables.
parent b9eeda19
...@@ -44,6 +44,8 @@ import Distribution.Simple.GHC ...@@ -44,6 +44,8 @@ import Distribution.Simple.GHC
( getImplInfo, GhcImplInfo(supportsPkgEnvFiles) ( getImplInfo, GhcImplInfo(supportsPkgEnvFiles)
, GhcEnvironmentFileEntry(..), simpleGhcEnvironmentFile , GhcEnvironmentFileEntry(..), simpleGhcEnvironmentFile
, writeGhcEnvironmentFile ) , writeGhcEnvironmentFile )
import Distribution.Simple.BuildPaths
( dllExtension, exeExtension )
import qualified Distribution.Compat.Graph as Graph import qualified Distribution.Compat.Graph as Graph
import Distribution.Compat.Graph (Graph, Node) import Distribution.Compat.Graph (Graph, Node)
import qualified Distribution.Compat.Binary as Binary import qualified Distribution.Compat.Binary as Binary
...@@ -98,7 +100,7 @@ encodePlanAsJson distDirLayout elaboratedInstallPlan elaboratedSharedConfig = ...@@ -98,7 +100,7 @@ encodePlanAsJson distDirLayout elaboratedInstallPlan elaboratedSharedConfig =
, "install-plan" J..= installPlanToJ elaboratedInstallPlan , "install-plan" J..= installPlanToJ elaboratedInstallPlan
] ]
where where
Platform arch os = pkgConfigPlatform elaboratedSharedConfig plat@(Platform arch os) = pkgConfigPlatform elaboratedSharedConfig
installPlanToJ :: ElaboratedInstallPlan -> [J.Value] installPlanToJ :: ElaboratedInstallPlan -> [J.Value]
installPlanToJ = map planPackageToJ . InstallPlan.toList installPlanToJ = map planPackageToJ . InstallPlan.toList
...@@ -230,13 +232,21 @@ encodePlanAsJson distDirLayout elaboratedInstallPlan elaboratedSharedConfig = ...@@ -230,13 +232,21 @@ encodePlanAsJson distDirLayout elaboratedInstallPlan elaboratedSharedConfig =
ComponentDeps.ComponentExe s -> bin_file' s ComponentDeps.ComponentExe s -> bin_file' s
ComponentDeps.ComponentTest s -> bin_file' s ComponentDeps.ComponentTest s -> bin_file' s
ComponentDeps.ComponentBench s -> bin_file' s ComponentDeps.ComponentBench s -> bin_file' s
ComponentDeps.ComponentFLib s -> flib_file' s
_ -> [] _ -> []
bin_file' s = bin_file' s =
["bin-file" J..= J.String bin] ["bin-file" J..= J.String bin]
where where
bin = if elabBuildStyle elab == BuildInplaceOnly bin = if elabBuildStyle elab == BuildInplaceOnly
then dist_dir </> "build" </> prettyShow s </> prettyShow s then dist_dir </> "build" </> prettyShow s </> prettyShow s <.> exeExtension plat
else InstallDirs.bindir (elabInstallDirs elab) </> prettyShow s else InstallDirs.bindir (elabInstallDirs elab) </> prettyShow s <.> exeExtension plat
flib_file' s =
["bin-file" J..= J.String bin]
where
bin = if elabBuildStyle elab == BuildInplaceOnly
then dist_dir </> "build" </> prettyShow s </> ("lib" ++ prettyShow s) <.> dllExtension plat
else InstallDirs.bindir (elabInstallDirs elab) </> ("lib" ++ prettyShow s) <.> dllExtension plat
comp2str :: ComponentDeps.Component -> String comp2str :: ComponentDeps.Component -> String
comp2str = prettyShow comp2str = prettyShow
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment