Skip to content

Commit

Permalink
New module for new style project configuration files
Browse files Browse the repository at this point in the history
This defines the new cabal.project files and introduces the notion of a
project root (and the logic for finding it). Also has support for
implicit projects when no cabal.project file is defined.

Supports both reading and writing project files or fragments. The
printing & parsing round trips correctly. QC tests to follow.

This is a key part of the new nix-local-build branch approach, based
around projects with clear configuration state held in a project file
(or extra files).

This has support for file and dirs as packages within a project,
including by glob. It supports both globs that much match a target, and
optional globs that are allowed to match nothing. It has partial support
for local tarball, remote http tarball and remote source repo packages.

(cherry picked from commit 324b324)
  • Loading branch information
dcoutts authored and 23Skidoo committed Mar 17, 2016
1 parent fe3596b commit 92f018c
Show file tree
Hide file tree
Showing 8 changed files with 2,272 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cabal-install/Distribution/Client/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ module Distribution.Client.Config (
withProgramOptionsFields,
userConfigDiff,
userConfigUpdate,
createDefaultConfigFile
createDefaultConfigFile,

remoteRepoFields
) where

import Distribution.Client.Types
Expand Down
5 changes: 5 additions & 0 deletions cabal-install/Distribution/Client/Dependency/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ data ConstraintSource =
-- | Main config file, which is ~/.cabal/config by default.
ConstraintSourceMainConfig FilePath

-- | Local cabal.project file
| ConstraintSourceProjectConfig FilePath

-- | Sandbox config file, which is ./cabal.sandbox.config by default.
| ConstraintSourceSandboxConfig FilePath

Expand Down Expand Up @@ -298,6 +301,8 @@ instance Binary ConstraintSource
showConstraintSource :: ConstraintSource -> String
showConstraintSource (ConstraintSourceMainConfig path) =
"main config " ++ path
showConstraintSource (ConstraintSourceProjectConfig path) =
"project config " ++ path
showConstraintSource (ConstraintSourceSandboxConfig path) =
"sandbox config " ++ path
showConstraintSource (ConstraintSourceUserConfig path)= "user config " ++ path
Expand Down

0 comments on commit 92f018c

Please sign in to comment.