hs-java 0.3.1 → 0.3.3
raw patch · 4 files changed
+17/−9 lines, 4 filesdep ~data-default
Dependency ranges changed: data-default
Files
- JVM/ClassFile.hs +3/−3
- JVM/Common.hs +0/−3
- Java/JAR.hs +11/−0
- hs-java.cabal +3/−3
JVM/ClassFile.hs view
@@ -310,7 +310,7 @@ | BoolType -- ^ Z | ObjectType String -- ^ L @{class name}@ | Array (Maybe Int) FieldType -- ^ @[{type}@- deriving (Eq)+ deriving (Eq, Ord) instance Show FieldType where show SignedByte = "byte"@@ -396,7 +396,7 @@ data ReturnSignature = Returns FieldType | ReturnsVoid- deriving (Eq)+ deriving (Eq, Ord) instance Show ReturnSignature where show (Returns t) = show t@@ -418,7 +418,7 @@ -- | Class method argument signature data MethodSignature = MethodSignature [ArgumentSignature] ReturnSignature- deriving (Eq)+ deriving (Eq, Ord) instance Show MethodSignature where show (MethodSignature args ret) = "(" ++ intercalate ", " (map show args) ++ ") returns " ++ show ret
JVM/Common.hs view
@@ -21,9 +21,6 @@ instance Default B.ByteString where def = B.empty -instance Default Word16 where- def = 0- toCharList :: B.ByteString -> [Int] toCharList bstr = map fromIntegral $ B.unpack bstr
Java/JAR.hs view
@@ -2,6 +2,7 @@ module Java.JAR (readManifest, readJAR,+ readMainClass, addJAR ) where @@ -33,6 +34,15 @@ where good name = (str `isPrefixOf` name) && (".class" `isSuffixOf` name) +-- | Read MainClass Entry of a MANIFEST.MF file+readMainClass :: FilePath -> IO (Maybe String)+readMainClass jarfile = do+ Zip.withArchive [] jarfile $ do+ m <- readManifest+ case m of+ Nothing -> return Nothing+ Just mf -> return $ mainClass mf+ -- | Read entries from JAR file, using MANIFEST.MF if it exists. readJAR :: FilePath -> IO [Tree CPEntry] readJAR jarfile = do@@ -46,6 +56,7 @@ return (Just forest) case r of Nothing -> readAllJAR jarfile+ Just [] -> readAllJAR jarfile Just f -> return f -- | Add given JAR file to ClassPath
hs-java.cabal view
@@ -1,5 +1,5 @@ Name: hs-java-Version: 0.3.1+Version: 0.3.3 Cabal-Version: >= 1.6 License: BSD3 License-File: LICENSE@@ -42,8 +42,8 @@ Build-Depends: base >= 3 && <= 5, containers, binary, mtl, directory, filepath, utf8-string, array, bytestring, data-binary-ieee754, binary-state,- control-monad-exception, data-default, MissingH,- LibZip, Glob, parsec >= 3 && <4+ control-monad-exception, data-default >= 0.5.0,+ MissingH, LibZip, Glob, parsec >= 3 && <4 ghc-options: -fwarn-unused-imports