mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
Setup.hs: don't build example grammars when the rgl-none argument is specified
This commit is contained in:
18
Setup.hs
18
Setup.hs
@@ -43,18 +43,18 @@ main = defaultMainWithHooks simpleUserHooks{ preBuild = gfPreBuild
|
|||||||
gfPostBuild args flags pkg lbi =
|
gfPostBuild args flags pkg lbi =
|
||||||
do --writeFile "running" ""
|
do --writeFile "running" ""
|
||||||
buildRGL args flags (pkg,lbi)
|
buildRGL args flags (pkg,lbi)
|
||||||
let gf = default_gf (pkg,lbi)
|
-- let gf = default_gf (pkg,lbi)
|
||||||
buildWeb gf args flags pkg lbi
|
-- buildWeb gf (pkg,lbi)
|
||||||
|
|
||||||
gfPostInst args flags pkg lbi =
|
gfPostInst args flags pkg lbi =
|
||||||
do installRGL args flags (pkg,lbi)
|
do installRGL args flags (pkg,lbi)
|
||||||
let gf = default_gf (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)
|
do copyRGL args flags (pkg,lbi)
|
||||||
let gf = default_gf (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
|
-- Commands for building the Resource Grammar Library
|
||||||
@@ -93,6 +93,8 @@ rglCommands =
|
|||||||
| mode <- modes,
|
| mode <- modes,
|
||||||
let files = map try (optml mode langsAPI args) ++
|
let files = map try (optml mode langsAPI args) ++
|
||||||
map symbolic (optml mode langsSymbolic args)]
|
map symbolic (optml mode langsSymbolic args)]
|
||||||
|
, RGLCommand "web" True $ \modes args bi ->
|
||||||
|
buildWeb (default_gf bi) bi
|
||||||
, RGLCommand "pgf" False $ \modes args bi ->
|
, RGLCommand "pgf" False $ \modes args bi ->
|
||||||
parallel_ [
|
parallel_ [
|
||||||
do let dir = getRGLBuildDir bi mode
|
do let dir = getRGLBuildDir bi mode
|
||||||
@@ -107,9 +109,9 @@ rglCommands =
|
|||||||
let ls = optl langsDemo args
|
let ls = optl langsDemo args
|
||||||
gf bi (demos "Demo" ls) ["demo/Demo" ++ la ++ ".gf" | (_,la) <- ls]
|
gf bi (demos "Demo" ls) ["demo/Demo" ++ la ++ ".gf" | (_,la) <- ls]
|
||||||
return ()
|
return ()
|
||||||
, RGLCommand "parse" False $ \mode args bi ->
|
, RGLCommand "parse" False $ \modes args bi ->
|
||||||
gfc bi mode (summary parse) (map parse (optl langsParse args))
|
gfc bi modes (summary parse) (map parse (optl langsParse args))
|
||||||
, RGLCommand "none" False $ \mode args bi ->
|
, RGLCommand "none" False $ \modes args bi ->
|
||||||
return ()
|
return ()
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ example_grammars = -- :: [(pgf, subdir, src)]
|
|||||||
letterSrc = ["Letter"++lang++".gf"|lang<-letterLangs]
|
letterSrc = ["Letter"++lang++".gf"|lang<-letterLangs]
|
||||||
letterLangs = words "Eng Fin Fre Heb Rus Swe"
|
letterLangs = words "Eng Fin Fre Heb Rus Swe"
|
||||||
|
|
||||||
buildWeb gf args flags pkg lbi =
|
buildWeb gf (pkg,lbi) =
|
||||||
do --putStrLn "buildWeb"
|
do --putStrLn "buildWeb"
|
||||||
mapM_ build_pgf example_grammars
|
mapM_ build_pgf example_grammars
|
||||||
where
|
where
|
||||||
@@ -51,17 +51,17 @@ buildWeb gf args flags pkg lbi =
|
|||||||
" --output-dir="++gfo_dir++
|
" --output-dir="++gfo_dir++
|
||||||
" "++unwords [dir</>file|file<-src]
|
" "++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
|
where
|
||||||
dest = NoCopyDest
|
dest = NoCopyDest
|
||||||
|
|
||||||
copyWeb gf args flags pki lbi = setupWeb gf args dest pki lbi
|
copyWeb gf args flags = setupWeb gf args dest
|
||||||
where
|
where
|
||||||
dest = case copyDest flags of
|
dest = case copyDest flags of
|
||||||
NoFlag -> NoCopyDest
|
NoFlag -> NoCopyDest
|
||||||
Flag d -> d
|
Flag d -> d
|
||||||
|
|
||||||
setupWeb gf args dest pkg lbi =
|
setupWeb gf args dest (pkg,lbi) =
|
||||||
do mapM_ (createDirectoryIfMissing True) [grammars_dir,cloud_dir]
|
do mapM_ (createDirectoryIfMissing True) [grammars_dir,cloud_dir]
|
||||||
mapM_ copy_pgf example_grammars
|
mapM_ copy_pgf example_grammars
|
||||||
copyGFLogo
|
copyGFLogo
|
||||||
|
|||||||
Reference in New Issue
Block a user