{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DataKinds #-}
module CabalLenses.PackageDescription where
import Distribution.PackageDescription ( GenericPackageDescription(..)
, PackageDescription(..)
, Library(..)
, Executable(..)
, TestSuite(..)
, Benchmark(..)
, BuildInfo(..)
, CondTree(..)
)
import Control.Lens (makeLensesFor)
makeLensesFor [ ("packageDescription", "packageDescriptionL")
, ("genPackageFlags" , "genPackageFlagsL")
, ("condLibrary" , "condLibraryL")
, ("condExecutables" , "condExecutablesL")
, ("condTestSuites" , "condTestSuitesL")
, ("condBenchmarks" , "condBenchmarksL")
] ''GenericPackageDescription
makeLensesFor [ ("exposedModules", "exposedModulesL")
, ("libExposed" , "libExposedL")
, ("libBuildInfo" , "libBuildInfoL")
] ''Library
makeLensesFor [ ("exeName" , "exeNameL")
, ("modulePath", "modulePathL")
, ("buildInfo" , "buildInfoL")
] ''Executable
makeLensesFor [ ("testName" , "testNameL")
, ("testInterface", "testInterfaceL")
, ("testBuildInfo", "testBuildInfoL")
, ("testEnabled" , "testEnabledL")
] ''TestSuite
makeLensesFor [ ("benchmarkName", "benchmarkNameL")
, ("benchmarkInterface", "benchmarkInterfaceL")
, ("benchmarkBuildInfo", "benchmarkBuildInfoL")
, ("benchmarkEnabled" , "benchmarkEnabledL")
] ''Benchmark
makeLensesFor [ ("condTreeData" , "condTreeDataL")
, ("condTreeConstraints", "condTreeConstraintsL")
, ("condTreeComponents" , "condTreeComponentsL")
] ''CondTree