module System.Build.Java.Javadoc(
Javadoc,
SourceRelease(..),
overview,
public,
protected,
package,
private,
help,
doclet,
docletpath,
sourcepath,
classpath,
exclude,
subpackages,
breakiterator,
bootclasspath,
source,
extdirs,
verbose,
locale,
encoding,
quiet,
flags,
directory,
use,
version,
author,
docfilessubdirs,
splitindex,
windowtitle,
doctitle,
header,
footer,
top,
bottom,
link,
linkoffline,
excludedocfilessubdir,
group,
nocomment,
nodeprecated,
noqualifier,
nosince,
notimestamp,
nodeprecatedlist,
notree,
noindex,
nohelp,
nonavbar,
serialwarn,
tag,
taglet,
tagletpath,
charset,
helpfile,
linksource,
sourcetab,
keywords,
stylesheetfile,
docencoding,
javadoc,
javadoc'
) where
import Data.List hiding (group)
import Data.Maybe
import Control.Monad
import System.FilePath
import System.Build.Args
import System.Build.CompilePaths
import System.Build.Extensions
import System.Build.OutputDirectory
import System.Build.OutputReferenceSet
import System.Build.OutputReferenceGet
import System.Build.Command
data SourceRelease = S15
| S14
| S13
deriving Eq
instance Show SourceRelease where
show S15 = "1.5"
show S14 = "1.4"
show S13 = "1.3"
data Javadoc = Javadoc {
overview :: Maybe FilePath,
public :: Bool,
protected :: Bool,
package :: Bool,
private :: Bool,
help :: Bool,
doclet :: Maybe String,
docletpath :: Maybe FilePath,
sourcepath :: [FilePath],
classpath :: [FilePath],
exclude :: [String],
subpackages :: [String],
breakiterator :: Bool,
bootclasspath :: [FilePath],
source :: Maybe SourceRelease,
extdirs :: [FilePath],
verbose :: Bool,
locale :: Maybe String,
encoding :: Maybe String,
quiet :: Bool,
flags :: [String],
directory :: Maybe FilePath,
use :: Bool,
version :: Bool,
author :: Bool,
docfilessubdirs :: Bool,
splitindex :: Bool,
windowtitle :: Maybe String,
doctitle :: Maybe String,
header :: Maybe String,
footer :: Maybe String,
top :: Maybe String,
bottom :: Maybe String,
link :: [String],
linkoffline :: [(String, String)],
excludedocfilessubdir :: [String],
group :: [(String, [String])],
nocomment :: Bool,
nodeprecated :: Bool,
noqualifier :: [String],
nosince :: Bool,
notimestamp :: Bool,
nodeprecatedlist :: Bool,
notree :: Bool,
noindex :: Bool,
nohelp :: Bool,
nonavbar :: Bool,
serialwarn :: Bool,
tag :: [(String, String, String)],
taglet :: Bool,
tagletpath :: Bool,
charset :: Maybe String,
helpfile :: Maybe FilePath,
linksource :: Bool,
sourcetab :: Maybe Int,
keywords :: Bool,
stylesheetfile :: Maybe FilePath,
docencoding :: Maybe String
}
javadoc :: Javadoc
javadoc = Javadoc Nothing False False False False False Nothing Nothing [] [] [] [] False [] Nothing [] False Nothing Nothing False [] Nothing False False False False False Nothing Nothing Nothing Nothing Nothing Nothing [] [] [] [] False False [] False False False False False False False False [] False False Nothing Nothing False Nothing False Nothing Nothing
javadoc' :: Maybe FilePath
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Maybe String
-> Maybe FilePath
-> [FilePath]
-> [FilePath]
-> [String]
-> [String]
-> Bool
-> [FilePath]
-> Maybe SourceRelease
-> [FilePath]
-> Bool
-> Maybe String
-> Maybe String
-> Bool
-> [String]
-> Maybe FilePath
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Maybe String
-> Maybe String
-> Maybe String
-> Maybe String
-> Maybe String
-> Maybe String
-> [String]
-> [(String, String)]
-> [String]
-> [(String, [String])]
-> Bool
-> Bool
-> [String]
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> [(String, String, String)]
-> Bool
-> Bool
-> Maybe String
-> Maybe FilePath
-> Bool
-> Maybe Int
-> Bool
-> Maybe FilePath
-> Maybe String
-> Javadoc
javadoc' = Javadoc
instance Show Javadoc where
show (Javadoc overview'
public'
protected'
package'
private'
help'
doclet'
docletpath'
sourcepath'
classpath'
exclude'
subpackages'
breakiterator'
bootclasspath'
source'
extdirs'
verbose'
locale'
encoding'
quiet'
flags'
directory'
use'
version'
author'
docfilessubdirs'
splitindex'
windowtitle'
doctitle'
header'
footer'
top'
bottom'
link'
linkoffline'
excludedocfilessubdir'
group'
nocomment'
nodeprecated'
noqualifier'
nosince'
notimestamp'
nodeprecatedlist'
notree'
noindex'
nohelp'
nonavbar'
serialwarn'
tag'
taglet'
tagletpath'
charset'
helpfile'
linksource'
sourcetab'
keywords'
stylesheetfile'
docencoding') = ["overview" ~~> overview',
"public" ~~ public',
"protected" ~~ protected',
"package" ~~ package',
"private" ~~ private',
"help" ~~ help',
"doclet" ~~> doclet',
"docletpath" ~~> docletpath',
"sourcepath" ~: sourcepath',
"classpath" ~: classpath',
c exclude',
c subpackages',
"breakiterator" ~~ breakiterator',
"bootclasspath" ~: bootclasspath',
"source" ~~> source',
"extdirs" ~: extdirs',
"verbose" ~~ verbose',
"locale" ~~> locale',
"encoding" ~~> encoding',
"quiet" ~~ quiet',
intercalate " " $ map ("-J" ++) flags',
"d" ~~> directory',
"use" ~~ use',
"version" ~~ version',
"author" ~~ author',
"docfilessubdirs" ~~ docfilessubdirs',
"splitindex" ~~ splitindex',
"windowtitle" ~~> windowtitle',
"doctitle" ~~> doctitle',
"header" ~~> header',
"footer" ~~> footer',
"top" ~~> top',
"bottom" ~~> bottom',
"link" `many` link',
manys (\(x, y) -> x ++ "\" \"" ++ y) "linkoffline" linkoffline',
intercalate ":" excludedocfilessubdir',
manys (\(x, y) -> x ++ "\" \"" ++ c y) "group" group',
"nocomment" ~~ nocomment',
"nodeprecated" ~~ nodeprecated',
intercalate ":" noqualifier',
"nosince" ~~ nosince',
"notimestamp" ~~ notimestamp',
"nodeprecatedlist" ~~ nodeprecatedlist',
"notree" ~~ notree',
"noindex" ~~ noindex',
"nohelp" ~~ nohelp',
"nonavbar" ~~ nonavbar',
"serialwarn" ~~ serialwarn',
manys (\(x, y, z) -> c [x, y, z]) "tag" tag',
"taglet" ~~ taglet',
"tagletpath" ~~ tagletpath',
"charset" ~~> charset',
"helpfile" ~~> helpfile',
"linksource" ~~ linksource',
"sourcetab" ~~> sourcetab',
"keywords" ~~ keywords',
"stylesheetfile" ~~> stylesheetfile',
"docencoding" ~~> docencoding'
] ^^^ " "
where
c = intercalate ":"
instance CompilePaths Javadoc where
j =>> ps = show j ++ ' ' : space ps
instance Extensions Javadoc where
exts _ = ["java"]
instance OutputDirectory Javadoc where
outdir = directory
instance OutputReferenceSet Javadoc where
setReference p j = j { classpath = p }
instance OutputReferenceGet Javadoc where
getReference = classpath
instance Command Javadoc where
command _ = let envs = [
("JAVA_HOME", (</> "bin" </> "javadoc")),
("JDK_HOME", (</> "bin" </> "javadoc")),
("JAVADOC", id)
]
in fromMaybe "javadoc" `fmap` tryEnvs envs