Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
c5d29319
Commit
c5d29319
authored
9 years ago
by
Mikhail Glushenkov
Browse files
Options
Downloads
Plain Diff
Merge pull request #2746 from randen/haddock2
Support haddock response files
parents
c14ba817
e61d8dd2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Cabal/Distribution/Simple/Haddock.hs
+15
-2
15 additions, 2 deletions
Cabal/Distribution/Simple/Haddock.hs
with
15 additions
and
2 deletions
Cabal/Distribution/Simple/Haddock.hs
+
15
−
2
View file @
c5d29319
...
...
@@ -466,15 +466,28 @@ renderArgs :: Verbosity
->
(([
String
],
FilePath
)
->
IO
a
)
->
IO
a
renderArgs
verbosity
tmpFileOpts
version
comp
args
k
=
do
let
haddockSupportsUTF8
=
version
>=
Version
[
2
,
14
,
4
]
[]
haddockSupportsResponseFiles
=
version
>
Version
[
2
,
16
,
1
]
[]
createDirectoryIfMissingVerbose
verbosity
True
outputDir
withTempFileEx
tmpFileOpts
outputDir
"haddock-prologue.txt"
$
\
prologueFileName
h
->
do
do
when
(
version
>=
Version
[
2
,
14
,
4
]
[]
)
(
hSetEncoding
h
utf8
)
when
haddockSupportsUTF8
(
hSetEncoding
h
utf8
)
hPutStrLn
h
$
fromFlag
$
argPrologue
args
hClose
h
let
pflag
=
"--prologue="
++
prologueFileName
k
(
pflag
:
renderPureArgs
version
comp
args
,
result
)
renderedArgs
=
pflag
:
renderPureArgs
version
comp
args
if
haddockSupportsResponseFiles
then
withTempFileEx
tmpFileOpts
outputDir
"haddock-response.txt"
$
\
responseFileName
hf
->
do
when
haddockSupportsUTF8
(
hSetEncoding
hf
utf8
)
mapM_
(
hPutStrLn
hf
)
renderedArgs
hClose
hf
let
respFile
=
"@"
++
responseFileName
k
([
respFile
],
result
)
else
k
(
renderedArgs
,
result
)
where
outputDir
=
(
unDir
$
argOutputDir
args
)
result
=
intercalate
", "
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment