Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed Jul 11, 2024
1 parent efd9b7d commit 7be426f
Show file tree
Hide file tree
Showing 19 changed files with 502 additions and 333,731 deletions.
21 changes: 15 additions & 6 deletions bench/cardano-profile/app/cardano-profile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import qualified Cardano.Benchmarking.Profile.Types as Types

--------------------------------------------------------------------------------

data Cli = Names | All | Make String | ToJson String | FromJson String
data Cli = Names | All | ByName String | LibMK | ToJson String | FromJson String

--------------------------------------------------------------------------------

Expand All @@ -38,13 +38,16 @@ main = do
obj <- lookupOverlay
BSL8.putStrLn $ Aeson.encode $ Profiles.profiles obj
-- Print a single profiles, with an optional overlay.
(Make profileName) -> do
(ByName profileName) -> do
obj <- lookupOverlay
case Profiles.byName profileName obj of
Nothing -> error $ "No profile named \"" ++ profileName ++ "\""
(Just profile) ->
let aeson = Aeson.encode profile
in BSL8.putStrLn aeson
LibMK -> do
mapM_ putStrLn Profiles.libMk
-- Print a single profiles, with an optional overlay.
(ToJson filePath) -> print filePath
-- str <- readFile filePath
-- case (readEither str) of
Expand Down Expand Up @@ -78,13 +81,19 @@ cliParser = OA.hsubparser $
OA.command "all"
(OA.info
(pure All)
(OA.fullDesc <> OA.header "all" <> OA.progDesc "All profiles")
(OA.fullDesc <> OA.header "all" <> OA.progDesc "Create all profiles")
)
<>
OA.command "by-name"
(OA.info
(ByName <$> OA.argument OA.str (OA.metavar "PROFILE-NAME"))
(OA.fullDesc <> OA.header "by-name" <> OA.progDesc "Create profile")
)
<>
OA.command "make"
OA.command "lib-make"
(OA.info
(Make <$> OA.argument OA.str (OA.metavar "PROFILE-NAME"))
(OA.fullDesc <> OA.header "make" <> OA.progDesc "Create profile")
(pure LibMK)
(OA.fullDesc <> OA.header "lib-make" <> OA.progDesc "Makefile include")
)
<>
OA.command "to-json"
Expand Down
7 changes: 5 additions & 2 deletions bench/cardano-profile/cardano-profile.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ library
other-modules: Paths_cardano_profile
autogen-modules: Paths_cardano_profile
exposed-modules: Cardano.Benchmarking.Profile
, Cardano.Benchmarking.Profile.Builtin.AdHoc.Dense
, Cardano.Benchmarking.Profile.Builtin.AdHoc.Dish
, Cardano.Benchmarking.Profile.Builtin.Cloud
, Cardano.Benchmarking.Profile.Builtin.Empty
, Cardano.Benchmarking.Profile.Builtin.ForgeStress
, Cardano.Benchmarking.Profile.Builtin.K3
, Cardano.Benchmarking.Profile.Builtin.Legacy.Dense
, Cardano.Benchmarking.Profile.Builtin.Legacy.Dish
, Cardano.Benchmarking.Profile.Builtin.Miniature
, Cardano.Benchmarking.Profile.Builtin.Model
, Cardano.Benchmarking.Profile.Builtin.Plutuscall
, Cardano.Benchmarking.Profile.Builtin.Scenario.Base
, Cardano.Benchmarking.Profile.Builtin.Scenario.Chainsync
Expand Down
Loading

0 comments on commit 7be426f

Please sign in to comment.