Safe Haskell | None |
---|---|
Language | Haskell2010 |
BDCS.API.Recipe
Description
Recipe is used to store information about what packages are included in a composition.
It can be converted to and from TOML and JSON when needed.
- bumpVersion :: Maybe String -> Maybe String -> Either String String
- getAllRecipeProjects :: Recipe -> [String]
- parseRecipe :: Text -> Either String Recipe
- recipeTOML :: Recipe -> Text
- recipeTomlFilename :: String -> Text
- recipeBumpVersion :: Recipe -> Maybe String -> Either String Recipe
- data Recipe = Recipe {}
- data RecipeModule = RecipeModule {}
Documentation
bumpVersion :: Maybe String -> Maybe String -> Either String String Source #
semver recipe version number bump
prev_ver
- Previous version
new_ver
- New version
- If neither have a version 0.0.1 is returned
- If there is no previous version the new version is checked and returned
- If there is no new version, but there is a previous one, bump its patch level
- If the previous and new versions are the same, bump the patch level
- If they are different, check and return the new version
Errors will be returned in the Left
getAllRecipeProjects :: Recipe -> [String] Source #
Return a sorted list of the unique module+packages in a recipe
parseRecipe :: Text -> Either String Recipe Source #
Parse a TOML formatted recipe string and return a Recipe
If there is an error the details will be returned in the Left
recipeTOML :: Recipe -> Text Source #
Convert a Recipe to a TOML string
recipeTomlFilename :: String -> Text Source #
Convert a recipe name to a toml filename
name
- The recipe name (not filename)
Replaces spaces with - and append .toml
recipeBumpVersion :: Recipe -> Maybe String -> Either String Recipe Source #
Bump or replace a Recipe Version with a new one
recipe
- The Recipe to bump
prev_version
- Previous version of the recipe
Pass the new recipe and the version from the previous recipe Returns a new recipe with the correct version
Errors will be returned in the Left
Recipe data structure
Note that at this time there is no real distinction between package and modules.
Constructors
Recipe | |
Fields
|
data RecipeModule Source #
Name and Version glob of a package or module
Constructors
RecipeModule | |
Instances