Commit 8f495d1c authored by John van Groningen's avatar John van Groningen
Browse files

add option to compile a module of a project

parent f6f5e582
...@@ -17,6 +17,7 @@ from PmTypes import ::Pathname,::Output ...@@ -17,6 +17,7 @@ from PmTypes import ::Pathname,::Output
= CreateProject = CreateProject
| ShowProject | ShowProject
| BuildProject Bool FilePath | BuildProject Bool FilePath
| Compile !String
| ProjectPath PathAction | ProjectPath PathAction
| SetRelativeRoot String | SetRelativeRoot String
| SetTarget String | SetTarget String
......
...@@ -16,6 +16,7 @@ import AbsSyn,CpmPaths ...@@ -16,6 +16,7 @@ import AbsSyn,CpmPaths
* CleanIDE imports * CleanIDE imports
*/ */
import UtilIO,IdeState,Platform,PmPath,PmEnvironment,PmProject,PmDriver import UtilIO,IdeState,Platform,PmPath,PmEnvironment,PmProject,PmDriver
from PmCleanSystem import :: CompileOrCheckSyntax(..)
/** /**
* Execute a general CPM action * Execute a general CPM action
...@@ -122,6 +123,17 @@ doProjectAction cleanhome pwd pn (BuildProject force ideenvs) world ...@@ -122,6 +123,17 @@ doProjectAction cleanhome pwd pn (BuildProject force ideenvs) world
pinit force_rebuild gst = BringProjectUptoDate force_rebuild cleanup gst pinit force_rebuild gst = BringProjectUptoDate force_rebuild cleanup gst
cleanup exepath bool1 bool2 ps = abortLog (not bool2) "" ps cleanup exepath bool1 bool2 ps = abortLog (not bool2) "" ps
doProjectAction cleanhome pwd pn (Compile module_name) world
# (envs, world) = readIDEEnvs cleanhome EnvsFileName world
(project_path, project, ok, world) = openProject pwd pn cleanhome world
| not ok
= world
# (console, world) = stdio world
iniGeneral = initGeneral False compilerOptions cleanhome project_path project envs console
gst = {ls=iniGeneral,gst_world=world,gst_continue_or_stop=False}
gst = CompileProjectModule Compilation module_name project (\ _ _ _ gst -> gst) gst
= gst.gst_world
doProjectAction cleanhome pwd pn (ProjectPath pa) world doProjectAction cleanhome pwd pn (ProjectPath pa) world
# (proj_path, project, ok, world) = openProject pwd pn cleanhome world # (proj_path, project, ok, world) = openProject pwd pn cleanhome world
| not ok | not ok
......
...@@ -22,6 +22,7 @@ parse_Project ["create"] project_name = Project project_name CreateProject; ...@@ -22,6 +22,7 @@ parse_Project ["create"] project_name = Project project_name CreateProject;
parse_Project ["show"] project_name = Project project_name ShowProject; parse_Project ["show"] project_name = Project project_name ShowProject;
parse_Project ["build":project_build_args] project_name parse_Project ["build":project_build_args] project_name
= parse_Project_build_args project_build_args False EnvsFileName project_name (Project "" ProjectHelp); = parse_Project_build_args project_build_args False EnvsFileName project_name (Project "" ProjectHelp);
parse_Project ["compile",s] project_name = Project project_name (Compile s);
parse_Project ["path":project_path_args] project_name = parse_Project_path_args project_path_args project_name; parse_Project ["path":project_path_args] project_name = parse_Project_path_args project_path_args project_name;
parse_Project ["root",s] project_name parse_Project ["root",s] project_name
| size s > 0 && and [c == '.'\\ c<-:s] | size s > 0 && and [c == '.'\\ c<-:s]
......
Supports Markdown
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