1
0
forked from GitHub/gf-core

Setup.hs: don't build example grammars when the rgl-none argument is specified

This commit is contained in:
hallgren
2014-08-08 17:02:36 +00:00
parent bf0b487a4c
commit 1ce3569c82
2 changed files with 14 additions and 12 deletions

View File

@@ -43,18 +43,18 @@ main = defaultMainWithHooks simpleUserHooks{ preBuild = gfPreBuild
gfPostBuild args flags pkg lbi =
do --writeFile "running" ""
buildRGL args flags (pkg,lbi)
let gf = default_gf (pkg,lbi)
buildWeb gf args flags pkg lbi
-- let gf = default_gf (pkg,lbi)
-- buildWeb gf (pkg,lbi)
gfPostInst args flags pkg lbi =
do installRGL args flags (pkg,lbi)
let gf = default_gf (pkg,lbi)
installWeb gf args flags pkg lbi
installWeb gf args flags (pkg,lbi)
gfPostCopy args flags pkg lbi =
gfPostCopy args flags pkg lbi =
do copyRGL args flags (pkg,lbi)
let gf = default_gf (pkg,lbi)
copyWeb gf args flags pkg lbi
copyWeb gf args flags (pkg,lbi)
--------------------------------------------------------
-- Commands for building the Resource Grammar Library
@@ -93,6 +93,8 @@ rglCommands =
| mode <- modes,
let files = map try (optml mode langsAPI args) ++
map symbolic (optml mode langsSymbolic args)]
, RGLCommand "web" True $ \modes args bi ->
buildWeb (default_gf bi) bi
, RGLCommand "pgf" False $ \modes args bi ->
parallel_ [
do let dir = getRGLBuildDir bi mode
@@ -107,9 +109,9 @@ rglCommands =
let ls = optl langsDemo args
gf bi (demos "Demo" ls) ["demo/Demo" ++ la ++ ".gf" | (_,la) <- ls]
return ()
, RGLCommand "parse" False $ \mode args bi ->
gfc bi mode (summary parse) (map parse (optl langsParse args))
, RGLCommand "none" False $ \mode args bi ->
, RGLCommand "parse" False $ \modes args bi ->
gfc bi modes (summary parse) (map parse (optl langsParse args))
, RGLCommand "none" False $ \modes args bi ->
return ()
]
where

View File

@@ -33,7 +33,7 @@ example_grammars = -- :: [(pgf, subdir, src)]
letterSrc = ["Letter"++lang++".gf"|lang<-letterLangs]
letterLangs = words "Eng Fin Fre Heb Rus Swe"
buildWeb gf args flags pkg lbi =
buildWeb gf (pkg,lbi) =
do --putStrLn "buildWeb"
mapM_ build_pgf example_grammars
where
@@ -51,17 +51,17 @@ buildWeb gf args flags pkg lbi =
" --output-dir="++gfo_dir++
" "++unwords [dir</>file|file<-src]
installWeb gf args flags pki lbi = setupWeb gf args dest pki lbi
installWeb gf args flags = setupWeb gf args dest
where
dest = NoCopyDest
copyWeb gf args flags pki lbi = setupWeb gf args dest pki lbi
copyWeb gf args flags = setupWeb gf args dest
where
dest = case copyDest flags of
NoFlag -> NoCopyDest
Flag d -> d
setupWeb gf args dest pkg lbi =
setupWeb gf args dest (pkg,lbi) =
do mapM_ (createDirectoryIfMissing True) [grammars_dir,cloud_dir]
mapM_ copy_pgf example_grammars
copyGFLogo