Commit 2c254d15 authored by John van Groningen's avatar John van Groningen

add -dynamics and -ndynamics project options

parent f01594fb
......@@ -20,6 +20,7 @@ from System.FilePath import :: FilePath
| SetRelativeRoot String
| SetTarget String
| SetExec String
| SetProjectOptions [ProjectOption]
| ProjectHelp
:: PathAction
......@@ -35,6 +36,10 @@ from System.FilePath import :: FilePath
| MovePathTop
| MovePathBottom
:: ProjectOption
= DynamicsOn
| DynamicsOff
:: ModuleAction
= CreateModule ModuleType
| ModuleHelp
......
......@@ -69,7 +69,6 @@ getLine world
# (_, world) = fclose console world
= (line, world)
import StdDebug
/**
* Execute project-specific actions
*/
......@@ -139,6 +138,20 @@ doProjectAction cleanhome pwd pn (SetTarget target) world =
doProjectAction cleanhome pwd pn (SetExec exec) world =
withProject cleanhome pn (PR_SetExecPath exec) world
doProjectAction cleanhome pwd pn (SetProjectOptions project_options) world
= withProject cleanhome pn (set_project_options project_options) world
where
set_project_options [project_option:project_options] project
# project = set_project_option project_option project
= set_project_options project_options project
set_project_options [] project
= project
set_project_option DynamicsOn project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & dynamics = True} project
set_project_option DynamicsOff project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & dynamics = False} project
doProjectAction _ _ _ _ world =
help "cpm project <projectname> <action>"
[ "Where <action> is one of the following"
......@@ -149,6 +162,7 @@ doProjectAction _ _ _ _ world =
, " path : manage project paths"
, " target <env> : set target environment to <env>"
, " exec <execname> : set executable name to <execname>"
, " set options : set options"
] world
/**
......
......@@ -25,6 +25,11 @@ parse_Project ["path":project_path_args] project_name = parse_Project_path_args
parse_Project ["root",s] project_name = Project project_name (SetRelativeRoot s);
parse_Project ["target",s] project_name = Project project_name (SetTarget s);
parse_Project ["exec",s] project_name = Project project_name (SetExec s);
parse_Project ["set":project_option_args] project_name
# (ok,project_options) = parse_Project_options project_option_args;
| ok
= Project project_name (SetProjectOptions project_options);
= Project "" ProjectHelp;
parse_Project _ project_name = Project "" ProjectHelp;
parse_Project_build_args :: ![String] !Bool !String !String !CpmAction -> CpmAction;
......@@ -67,6 +72,18 @@ only_digits_in_string i s
= isDigit s.[i] && only_digits_in_string (i+1) s;
= True;
parse_Project_options :: ![String] -> (!Bool,![ProjectOption]);
parse_Project_options ["-dynamics":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok,[DynamicsOn:project_options]);
parse_Project_options ["-ndynamics":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok,[DynamicsOff:project_options]);
parse_Project_options []
= (True,[]);
parse_Project_options _
= (False,[]);
parse_Module :: ![String] !String -> CpmAction;
parse_Module ["create"] module_name = Module module_name (CreateModule LibraryModule);
parse_Module ["create","application"] module_name = Module module_name (CreateModule ApplicationModule);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment