packages feed

servant-csharp 0.0.7.0 → 0.0.7.1

raw patch · 2 files changed

+11/−9 lines, 2 filesdep +filepath

Dependencies added: filepath

Files

servant-csharp.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                servant-csharp-version:             0.0.7.0+version:             0.0.7.1 synopsis:            Generate servant client library for C# description:         Generate servant client library for C# homepage:            https://github.com/cutsea110/servant-csharp.git@@ -31,6 +31,7 @@   build-depends:       base >=4.8 && <4.9                      , bytestring >=0.10 && <0.11                      , directory >=1.2 && <1.3+                     , filepath >=1.4 && <1.5                      , haskell-src-exts >=1.17 && <1.18                      , heredocs >=0.1 && <0.2                      , http-types >=0.9 && <0.10
src/CS/JsonDotNet.hs view
@@ -25,7 +25,7 @@  import Prelude hiding (concat, lines, unlines) import Control.Arrow-import Control.Lens+import Control.Lens hiding ((<.>)) import Data.ByteString (ByteString) import Data.ByteString.Char8 as BC (unpack) import Data.Char (toUpper, toLower)@@ -41,6 +41,7 @@ import Language.Haskell.Exts import Servant.Foreign import System.Directory (createDirectoryIfMissing)+import System.FilePath ((</>), (<.>)) import Text.Heredoc  import CS.Common (CSharp, getEndpoints)@@ -90,13 +91,13 @@ genCsForAPI conf api = do   guid' <- maybe (toString <$> UUID.nextRandom) return $ guid conf   let conf' = conf { guid = Just guid' }-  createDirectoryIfMissing True [heredoc|${outdir conf'}/${namespace conf'}/Properties|]-  classCsForAPIWith conf' >>= writeFile [heredoc|${outdir conf'}/${namespace conf'}${classCsName conf'}|]-  apiCsForAPIWith conf' api >>= writeFile [heredoc|${outdir conf'}/${namespace conf'}${apiCsName conf'}|]-  enumCsForAPIWith conf' >>= writeFile [heredoc|${outdir conf'}/${namespace conf'}${enumCsName conf'}|]-  converterCsForAPIWith conf' >>= writeFile [heredoc|${outdir conf'}/${namespace conf'}${converterCsName conf'}|]-  assemblyInfoCsForAPIWith conf' >>= writeFile [heredoc|${outdir conf'}/${namespace conf'}/Properties/AssemblyInfo.cs|]-  csprojForAPIWith conf' >>= writeFile [heredoc|${outdir conf'}/${namespace conf'}/${namespace conf'}.cs|]+  createDirectoryIfMissing True $ outdir conf' </> namespace conf' </> "Properties"+  classCsForAPIWith conf' >>= writeFile (outdir conf' </> namespace conf' </> classCsName conf')+  apiCsForAPIWith conf' api >>= writeFile (outdir conf' </> namespace conf' </> apiCsName conf')+  enumCsForAPIWith conf' >>= writeFile (outdir conf' </> namespace conf' </> enumCsName conf')+  converterCsForAPIWith conf' >>= writeFile (outdir conf' </> namespace conf' </> converterCsName conf')+  assemblyInfoCsForAPIWith conf' >>= writeFile (outdir conf' </> namespace conf' </> "Properties" </> "AssemblyInfo.cs")+  csprojForAPIWith conf' >>= writeFile (outdir conf' </> namespace conf' </> namespace conf' <.> "csproj")  -------------------------------------------------------------------------- isDatatypeDecl :: Decl -> Bool