Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
7d01c2e6
Commit
7d01c2e6
authored
Dec 15, 2015
by
Duncan Coutts
Browse files
Export a few more BuildTarget utils
parent
89fd3e09
Changes
1
Show whitespace changes
Inline
Side-by-side
Cabal/Distribution/Simple/BuildTarget.hs
View file @
7d01c2e6
...
...
@@ -14,10 +14,14 @@ module Distribution.Simple.BuildTarget (
-- * Build targets
BuildTarget
(
..
),
readBuildTargets
,
showBuildTarget
,
QualLevel
(
..
),
buildTargetComponentName
,
-- * Parsing user build targets
UserBuildTarget
,
readUserBuildTargets
,
showUserBuildTarget
,
UserBuildTargetProblem
(
..
),
reportUserBuildTargetProblems
,
...
...
@@ -130,6 +134,11 @@ data BuildTarget =
instance
Binary
BuildTarget
buildTargetComponentName
::
BuildTarget
->
ComponentName
buildTargetComponentName
(
BuildTargetComponent
cn
)
=
cn
buildTargetComponentName
(
BuildTargetModule
cn
_
)
=
cn
buildTargetComponentName
(
BuildTargetFile
cn
_
)
=
cn
-- | Read a list of user-supplied build target strings and resolve them to
-- 'BuildTarget's according to a 'PackageDescription'. If there are problems
-- with any of the targets e.g. they don't exist or are misformatted, throw an
...
...
@@ -232,6 +241,10 @@ showUserBuildTarget = intercalate ":" . components
components
(
UserBuildTargetDouble
s1
s2
)
=
[
s1
,
s2
]
components
(
UserBuildTargetTriple
s1
s2
s3
)
=
[
s1
,
s2
,
s3
]
showBuildTarget
::
QualLevel
->
PackageId
->
BuildTarget
->
String
showBuildTarget
ql
pkgid
bt
=
showUserBuildTarget
(
renderBuildTarget
ql
bt
pkgid
)
-- ------------------------------------------------------------
-- * Resolving user targets to build targets
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment