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.
  • Loading branch information
dcoutts committed Mar 13, 2016
1 parent d0fb249 commit 324b324
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 @@ -258,6 +258,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 @@ -295,6 +298,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
Loading

0 comments on commit 324b324

Please sign in to comment.