Skip to content
Snippets Groups Projects
Unverified Commit 21f67d0a authored by Marcin Szamotulski's avatar Marcin Szamotulski
Browse files

haddock-project: fixed main library name

The main library must use the package name rather than `UnitId`,
otherwise the links from other sublibraries will not work.
parent e7657ad3
No related branches found
No related tags found
No related merge requests found
......@@ -284,27 +284,34 @@ haddockProjectAction flags _extraArgs globalFlags = do
unitId = unUnitId (elabUnitId package)
buildDir = distBuildDirectory distLayout distDirParams
packageName = unPackageName (pkgName $ elabPkgSourceId package)
-- TODO: is there a better way to recognise if the library
-- is the main library?
mainLib =
prettyShow (elabPkgSourceId package) ++ "-inplace"
== prettyShow (elabUnitId package)
name = if mainLib then packageName else unitId
let docDir =
buildDir
</> "doc"
</> "html"
</> packageName
destDir = outputDir </> unitId
destDir = outputDir </> name
interfacePath =
destDir
</> packageName
<.> "haddock"
a <- doesDirectoryExist docDir
case a of
True ->
True -> do
copyDirectoryRecursive verbosity docDir destDir
>> return
[
( unitId
, interfacePath
, Visible
)
]
return
[
( name
, interfacePath
, Visible
)
]
False -> do
warn
verbosity
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment