We are planning to upgrade GitLab to the latest version this Friday morning. Expect some downtime!

Commit 7ebbd243 authored by John van Groningen's avatar John van Groningen

store editor options in .prp file instead of .prj file,

sort modules in .prj and .prp files
parent bbc8e5a5
......@@ -158,8 +158,8 @@ ed_open_cont pathName cont ps
# optional_window_pos_and_size = if (isJust inf)
(if isDefMod
(fromJust inf).defeo.pos_size
(fromJust inf).impeo.pos_size)
(fromJust inf).mod_edit_options.defeo.pos_size
(fromJust inf).mod_edit_options.impeo.pos_size)
NoWindowPosAndSize
# ps = openEditWindow mn_und (if readOnly title` title) pathName text font tabs margin syncols windowId (
[ WindowClose (noLS (ed_close windowId))
......@@ -247,11 +247,13 @@ where
lengths = size s
firsts = lengths - 4
lasts = dec lengths
dofrag (SCons (str) SNil)
| CleanModId str
= Just str
= Nothing
dofrag _ = Nothing
handlefrag (Just str) mIds
=
[(mIds.mn_odm,"Open "+++(MakeDefPathname str))
......@@ -443,9 +445,9 @@ ed_common_close update_in_project win ps
# modname = GetModuleName nam
# isDefmod = IsDefPathname nam
# pos_size = WindowPosAndSize {posx = pos.vx,posy=pos.vy,sizex=siz.w,sizey=siz.Size.h}
# update = \inf=:{defeo,impeo} -> if isDefmod
{inf & defeo = {defeo & pos_size = pos_size}, defopen = not update_in_project}
{inf & impeo = {impeo & pos_size = pos_size}, impopen = not update_in_project}
# update = \inf=:{mod_edit_options=mod_edit_options=:{defeo,impeo}} -> if isDefmod
{inf & mod_edit_options={mod_edit_options & defeo = {defeo & pos_size = pos_size}, defopen = not update_in_project}}
{inf & mod_edit_options={mod_edit_options & impeo = {impeo & pos_size = pos_size}, impopen = not update_in_project}}
# ps = appProject (\p -> PR_UpdateModule modname update p) ps
= closeEditWindow win ps
......
......@@ -645,7 +645,7 @@ pm_set ps
# info = PR_GetModuleInfo (GetModuleName path) project
| isJust info
# info = fromJust info
# eo = info.impeo
# eo = info.mod_edit_options.impeo
# co = info.compilerOptions
# project = PR_SetRoot path eo co project
# ps = appProject (const project) ps
......
implementation module PmDriver
import StdArray, StdBool, StdList, StdMisc, StdEnum, StdStrictLists
import StdArray,StdBool,StdList,StdMisc,StdEnum,StdStrictLists
import UtilNewlinesFile, UtilIO
......@@ -13,13 +13,9 @@ from projwin import pm_update_project_window
import PmCallBack
import PmCleanSystem
import PmPath
import PmProject
import PmCleanSystem,PmPath,PmProject
from PmDialogues import doPathsDialog
import PmAbcMagic
import PmFileInfo
import PmDirCache
import PmAbcMagic,PmFileInfo,PmDirCache
import Platform
from StdLibMisc import :: Date{..}, :: Time{..}
......@@ -150,7 +146,6 @@ BringProjectUptoDate force continuation ps
# ps = showInfo (Level1 "Bring up to date...") ps
# ps = ClearCompilerCache` ps
ini_step = DInit force project cleanup
= start ini_step step ps
where
......@@ -170,7 +165,7 @@ where
| isJust postlink
# (Just post_link) = postlink
# (prj_path,ps) = getProjectFilePath ps
# prj_dir_path = RemoveFilename prj_path
# prj_dir_path = PR_GetRootDir project
# (app_path,ps) = getStup ps
# post_link = fulPath app_path prj_dir_path post_link
# ps = showInfo (Level1 "Postlink...") ps
......@@ -360,13 +355,11 @@ step intr (DComp force dircache compinfo=:(Pers _) (next :! rest) ds) ps
| isProjLibraryModule modname ds.libsinfo
// instead of testing explicitly put libmodules in done <= conflicts with other administration
= step intr (DComp force dircache compinfo rest ds) ps
# ps = trace_n ("update",next) ps
# (ps,dircache,ok,newpaths`,rest,compinfo,ds,_)
= UpdateDependencies force next rest compinfo dircache ds ps
# ds = {ds & newpaths = ds.newpaths || newpaths`, ok = ok}
| not ok
# (Pers inf) = compinfo
# (_,ps) = trace_n "exit compiler!" ExitCleanCompiler (inf,ps)
# (paths,ds) = ds!modpaths
= step intr (DGene paths SyncCodeGeneration ds) ps
# ds = {ds & modpaths = next :! ds.modpaths}
......@@ -861,6 +854,7 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
# prj_path` = RemoveFilename prj_path
# execpath = PR_GetExecPath project
# prj_path` = PR_GetRootDir project
# execpath = fulPath app_path prj_path` execpath
# ps = showInfo (Level2 ("Linking '" +++ RemovePath execpath +++ "'")) ps
......@@ -935,29 +929,12 @@ step intr (DLink ds=:{ok, newpaths, fileinfo, libsinfo, modpaths, abccache, proj
= continue False newpaths False fileinfo libsinfo modpaths project intr (abccache, ps)
// project objects and dynamic libs
/* full paths again...
# (loobjsOk,ofiles,abcPathsCache)
= GetPathNames lo.extraObjectModules ofiles abcPathsCache
# (lolibsOk,lfiles,_)
= GetPathNames lo.libraries lfiles abcPathsCache
*/
# loobjsOk = True
# lolibsOk = True
# extraObjectModules = lo.extraObjectModules
# extraObjectModules = Map (append_object_file_extension_if_dot_at_end tp use_64_bit_processor) extraObjectModules
# ofiles = Concat extraObjectModules ofiles
# ofiles` = Concat extraObjectModules ofiles`
# lfiles = Concat lo.libraries lfiles
| not loobjsOk
# line = Level3 ["Link error: File: '" +++ (Head ofiles) +++ "' not found."]
# ps = showInfo line ps
= continue False newpaths False fileinfo libsinfo modpaths project intr (abccache, ps)
| not lolibsOk
# line = Level3 ["Link error: File: '" +++ (Head lfiles) +++ "' not found."]
# ps = showInfo line ps
= continue False newpaths False fileinfo libsinfo modpaths project intr (abccache, ps)
# (env_static_libs,ps) = getCurrentSlibs ps
#! sfiles = Concat (SL_Libs libsinfo) env_static_libs // only if really used?
#! ofiles = Reverse ofiles
......@@ -1393,8 +1370,7 @@ where
set defp ao ps
# (prj,ps) = getProject ps
# prj = PR_SetPaths False defp ao prj
# ps = setProject prj ps
= ps
= setProject prj ps
ProcessCompilerMsg cstate _ _ path abcpath SyntaxError fileinfo dircache abccache project ps
= (cstate,(ps, fileinfo, dircache,abccache,project, False, False, abcpath,Nil))
......
......@@ -8,12 +8,12 @@ import PmCompilerOptions
import PmTypes
ProjectTable :: OptionsTable ProjectGlobalOptions
project_table :: OptionsTable ProjectGlobalOptions
edit_options_table :: OptionsTable ProjectGlobalOptions
CompilerOptionsTable :: OptionsTable CompilerOptions
CodeGenOptionsTable :: OptionsTable CodeGenOptions
LinkOptionsTable :: OptionsTable LinkOptions
ApplicationOptionsTable :: OptionsTable ApplicationOptions
//ProjectOptionsTable :: OptionsTable ProjectOptions
ProjectFileVersion :== "1.4"
......
......@@ -70,28 +70,36 @@ EmptyUndefModule =
}
project_root_option = SimpleOption "ProjectRoot" (\a->a.pg_root_directory) (\v a->{a & pg_root_directory = v})
target_option = SimpleOption "Target" (\a->a.pg_target) (\v a->{a & pg_target=v})
code_gen_option = GroupedOption "CodeGen" CodeGenOptionsTable (\a->a.pg_codegen) (\v a->{a & pg_codegen=v})
application_option = GroupedOption "Application" ApplicationOptionsTable (\a->a.pg_application) (\v a->{a & pg_application=v})
link_option = GroupedOption "Link" LinkOptionsTable (\a->a.pg_link) (\v a->{a & pg_link=v})
paths_option = ListOption "Paths" PathName "" (\a->a.pg_projectPaths) (\v a->{a & pg_projectPaths=v})
static_option = GroupedOption "Static" StaticLibsInfoTable (\a->a.pg_staticLibInfo) (\v a->{a & pg_staticLibInfo=v})
precompile_option = SimpleOption "Precompile" (\a->unwrap a.pg_precompile)(\v a->{a & pg_precompile = wrap v})
postlink_option = SimpleOption "Postlink" (\a->unwrap a.pg_postlink) (\v a->{a & pg_postlink = wrap v})
// Making Precompile & Postlink 'List' options is probably prettier...
unwrap Nothing = ""
unwrap (Just s) = s
wrap "" = Nothing
wrap s = Just s
ProjectGlobalOptionsTable :: OptionsTable ProjectGlobalOptions
ProjectGlobalOptionsTable =
{ project_root_option
, SimpleOption "Built" (\a->a.pg_built) (\v a->{a & pg_built=v})
, SimpleOption "Target" (\a->a.pg_target) (\v a->{a & pg_target=v})
, target_option
, SimpleWithStringConversionOption convert_exec_path_separators_and_extension "Exec" (\a->a.pg_execpath) (\v a->{a & pg_execpath=v})
, GroupedOption "CodeGen" CodeGenOptionsTable (\a->a.pg_codegen) (\v a->{a & pg_codegen=v})
, GroupedOption "Application" ApplicationOptionsTable (\a->a.pg_application) (\v a->{a & pg_application=v})
, GroupedOption "Link" LinkOptionsTable (\a->a.pg_link) (\v a->{a & pg_link=v})
, ListOption "Paths" PathName "" (\a->a.pg_projectPaths) (\v a->{a & pg_projectPaths=v})
, GroupedOption "Static" StaticLibsInfoTable (\a->a.pg_staticLibInfo) (\v a->{a & pg_staticLibInfo=v})
, SimpleOption "Precompile" (\a->unwrap a.pg_precompile)(\v a->{a & pg_precompile = wrap v})
, SimpleOption "Postlink" (\a->unwrap a.pg_postlink) (\v a->{a & pg_postlink = wrap v})
, code_gen_option
, application_option
, link_option
, paths_option
, static_option
, precompile_option
, postlink_option
}
where
// Making Precompile & Postlink 'List' options is probably prettier...
unwrap Nothing = ""
unwrap (Just s) = s
wrap "" = Nothing
wrap s = Just s
instance fromString Bool
where
......@@ -100,41 +108,83 @@ where
fromString _
= True
name_option = SimpleOption "Name" (\a->a.name) (\v a->{a & name=v})
dir_option = SimpleWithStringConversionOption convert_path_separators "Dir" (\a->a.info.dir) (\v a->{a & info.dir=v})
compiler_option = GroupedOption "Compiler" CompilerOptionsTable (\a->a.info.compilerOptions)(\v a->{a & info.compilerOptions=v})
needed_obj_files_option = ListOption "NeededObjFiles" ObjectFile "" (\a->a.info.abcLinkInfo.linkObjFileNames)
(\v a->{a & info.abcLinkInfo.linkObjFileNames=v})
needed_libraries_option = ListOption "NeededLibraries" Library "" (\a->a.info.abcLinkInfo.linkLibraryNames)
(\v a->{a & info.abcLinkInfo.linkLibraryNames=v})
dcl_option = GroupedOption "Dcl" EditWdOptionsTable (\a->a.info.mod_edit_options.defeo) (\v a->{a & info.mod_edit_options.defeo=v})
dcl_open_option = SimpleOption "DclOpen" (\a->a.info.mod_edit_options.defopen) (\v a->{a & info.mod_edit_options.defopen=v})
icl_option = GroupedOption "Icl" EditWdOptionsTable (\a->a.info.mod_edit_options.impeo) (\v a->{a & info.mod_edit_options.impeo=v})
icl_open_option = SimpleOption "IclOpen" (\a->a.info.mod_edit_options.impopen) (\v a->{a & info.mod_edit_options.impopen=v})
ModInfoAndNameTable :: OptionsTable ModInfoAndName
ModInfoAndNameTable =
{ SimpleOption "Name" (\a->a.name) (\v a->{a & name=v})
, SimpleWithStringConversionOption convert_path_separators "Dir" (\a->a.info.dir) (\v a->{a & info.dir=v})
, GroupedOption "Compiler" CompilerOptionsTable (\a->a.info.compilerOptions)(\v a->{a & info.compilerOptions=v})
, GroupedOption "Dcl" EditWdOptionsTable (\a->a.info.defeo) (\v a->{a & info.defeo=v})
, SimpleOption "DclOpen" (\a->a.info.defopen) (\v a->{a & info.defopen=v})
, GroupedOption "Icl" EditWdOptionsTable (\a->a.info.impeo) (\v a->{a & info.impeo=v})
, SimpleOption "IclOpen" (\a->a.info.impopen) (\v a->{a & info.impopen=v})
, ListOption "NeededObjFiles" ObjectFile "" (\a->a.info.abcLinkInfo.linkObjFileNames)
(\v a->{a & info.abcLinkInfo.linkObjFileNames=v})
, ListOption "NeededLibraries" Library "" (\a->a.info.abcLinkInfo.linkLibraryNames)
(\v a->{a & info.abcLinkInfo.linkLibraryNames=v})
{ name_option
, dir_option
, compiler_option
, dcl_option
, dcl_open_option
, icl_option
, icl_open_option
, needed_obj_files_option
, needed_libraries_option
}
ModInfoAndNameEntry =
GroupedOption "Module" ModInfoAndNameTable id const
ModInfoAndNameEntry = GroupedOption "Module" ModInfoAndNameTable id const
prj_mod_info_and_name_table :: OptionsTable ModInfoAndName
prj_mod_info_and_name_table
= { name_option, dir_option, compiler_option, needed_obj_files_option, needed_libraries_option }
prj_mod_info_and_name_entry = GroupedOption "Module" prj_mod_info_and_name_table id const
prp_mod_info_and_name_table :: OptionsTable ModInfoAndName
prp_mod_info_and_name_table
= { name_option, dir_option, dcl_option, dcl_open_option, icl_option, icl_open_option }
prp_mod_info_and_name_entry = GroupedOption "Module" prp_mod_info_and_name_table id const
ProjectTable :: OptionsTable ProjectGlobalOptions
ProjectTable = // +++ order is important here
{ GroupedOption "Global" ProjectGlobalOptionsTable id const
, GroupedOption "MainModule" ModInfoAndNameTable (\a->a.pg_mainModuleInfo) (\v a->{a & pg_mainModuleInfo=v})
, ListOption "OtherModules" ModInfoAndNameEntry {info=EmptyModInfo,name=""} (\a->a.pg_otherModules) (\v a->{a & pg_otherModules=v})
ProjectTable
# main_module_option = GroupedOption "MainModule" ModInfoAndNameTable (\a->a.pg_mainModuleInfo) (\v a->{a & pg_mainModuleInfo=v})
# other_modules_option = ListOption "OtherModules" ModInfoAndNameEntry {info=EmptyModInfo,name=""} (\a->a.pg_otherModules) (\v a->{a & pg_otherModules=v})
= make_project_table main_module_option other_modules_option
project_table :: OptionsTable ProjectGlobalOptions
project_table
# main_module_option = GroupedOption "MainModule" prj_mod_info_and_name_table (\a->a.pg_mainModuleInfo) (\v a->{a & pg_mainModuleInfo=v})
# other_modules_option = ListOption "OtherModules" prj_mod_info_and_name_entry {info=EmptyModInfo,name=""} (\a->a.pg_otherModules) (\v a->{a & pg_otherModules=v})
= make_project_table main_module_option other_modules_option
edit_options_table :: OptionsTable ProjectGlobalOptions
edit_options_table
# main_module_option = GroupedOption "MainModule" prp_mod_info_and_name_table (\a->a.pg_mainModuleInfo) (\v a->{a & pg_mainModuleInfo=v})
# other_modules_option = ListOption "OtherModules" prp_mod_info_and_name_entry {info=EmptyModInfo,name=""} (\a->a.pg_otherModules) (\v a->{a & pg_otherModules=v})
= { main_module_option, other_modules_option }
make_project_table :: !(OptionsTableEntry ProjectGlobalOptions) !(OptionsTableEntry ProjectGlobalOptions) -> OptionsTable ProjectGlobalOptions
make_project_table main_module_option other_modules_option
= // +++ order is important here
{ GroupedOption "Global" ProjectGlobalOptionsTable id const
, main_module_option
, other_modules_option
, GroupedOption "Dynamic" DynamicInfoTable (\a->a.pg_dynamic) (\v a->{a & pg_dynamic=v})
}
EmptyModInfo :: ModInfo
EmptyModInfo
# defaultEditWdOptions = {eo=DefaultEditOptions,pos_size=NoWindowPosAndSize}
# mod_edit_options = {defeo=defaultEditWdOptions,impeo=defaultEditWdOptions,
defopen=False,impopen=False}
= { dir = EmptyPathname,
compilerOptions = DefaultCompilerOptions,
mod_edit_options = mod_edit_options,
abcLinkInfo = {linkObjFileNames = Nil, linkLibraryNames = Nil} }
where
EmptyModInfo :: ModInfo
EmptyModInfo = { dir = EmptyPathname,
compilerOptions = DefaultCompilerOptions,
defeo = {eo=DefaultEditOptions,pos_size=NoWindowPosAndSize},
impeo = {eo=DefaultEditOptions,pos_size=NoWindowPosAndSize},
defopen = False,
impopen = False,
abcLinkInfo = {linkObjFileNames = Nil, linkLibraryNames = Nil} }
DefaultEditOptions :: EditOptions;
DefaultEditOptions =
{ newlines = HostNativeNewlineConvention
......
This diff is collapsed.
......@@ -147,13 +147,17 @@ instance fromString Output
:: ModInfo =
{ dir :: !String // !Pathname
, compilerOptions :: !CompilerOptions
, defeo :: !EditWdOptions // definition module edit options
, impeo :: !EditWdOptions // implementation module edit options
, defopen :: !Bool // definition module is open
, impopen :: !Bool // implementation module is open
, mod_edit_options :: !ModEditOptions
, abcLinkInfo :: !ABCLinkInfo // found dependant libs and objs
}
:: ModEditOptions = {
defeo :: !EditWdOptions, // definition module edit options
impeo :: !EditWdOptions, // implementation module edit options
defopen :: !Bool, // definition module is open
impopen :: !Bool // implementation module is open
}
:: ABCLinkInfo =
{ linkObjFileNames :: !List LinkObjFileName
, linkLibraryNames :: !List LinkLibraryName
......
......@@ -107,13 +107,17 @@ where
:: ModInfo =
{ dir :: !String // !Pathname // directory
, compilerOptions :: !CompilerOptions // compiler options
, defeo :: !EditWdOptions // edit options def module
, impeo :: !EditWdOptions // edit options imp module
, defopen :: !Bool // dcl open?
, impopen :: !Bool // icl open?
, mod_edit_options :: !ModEditOptions
, abcLinkInfo :: !ABCLinkInfo
}
:: ModEditOptions = {
defeo :: !EditWdOptions, // definition module edit options
impeo :: !EditWdOptions, // implementation module edit options
defopen :: !Bool, // definition module is open
impopen :: !Bool // implementation module is open
}
:: ABCLinkInfo = {linkObjFileNames :: !List LinkObjFileName, linkLibraryNames :: !List LinkLibraryName}
:: LinkObjFileName :== String
......
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