[Gambas-user] Issue 330 in gambas: IDE: Save Project As.. .Project file not updated

gambas at ...2524... gambas at ...2524...
Sat Sep 15 03:37:30 CEST 2012


Comment #3 on issue 330 by adamn... at ...626...: IDE: Save Project  
As.. .Project file not updated
http://code.google.com/p/gambas/issues/detail?id=330

OK.
1) This depends on the original project (let's call it "Orig") having an  
entry in its .project file "ExecPath=". (Say, by someone using Make  
Executable and changing the output directory in FMakeExecutable to  
somewhere other than the "Orig" project directory.)
2) When someone opens "Orig" after that and makes a copy of the project as  
say "NewProj", the "Orig" .project file is copied into the "NewProj"  
directory as is. (That is, it contains the ExecPath= entry.)
3) When the new project is opened (automatically or otherwise),  
Project.ReadProject() at line 3172 encounters that entry and sets  
Project.ExecPath to its value.
4) Now we move to Project.MakeExecutable() around lines 2760-2765.
     sExecPath = GetExecPath()  <--- (a)
     If Not Exist(File.Dir(sExecPath)) Then sExecPath = Project.Dir &/  
File.Name(sExecPath)

     'IF Dialog.SaveFile() THEN RETURN TRUE
     sExecPath = FMakeExecutable.Run(sExecPath) <--- (b)

(a) getExecPath will return the value of Project.ExecPath, which can be a  
valid and existing path, but the one where the "Orig" project was compiled  
in step 1

so (finally!) at (b) instead of the FMakeExecutable FileChooser ("fchExec")  
pointing to the "NewProj" directory it is pointing to where "Orig" was  
compiled and the file name is the original name.

What actually happened here was that Felicity compiled the "orig" project,  
which is a boilerplate project to a shared testing directory on our source  
server, I then made a copy of it as a new project.  When I compiled the new  
one, I didn't look at the FMakeExecutable form too closely, expecting that  
it would just compile it into my new project directory.  I then opened a  
terminal using Tools|Open A Terminal and there was no executable there.   
Much confusion then occurred because I couldn't find my executable and  
Felicity's version magically changed!

So, to answer your question, I feel that the ExecPath= entry in the  
old .project should not be copied into the new .project file.  This is  
based on considering the possible reasons for making a copy of a project,  
all the ones that I can think of relate to the idea of copying the source  
for some other purpose and none include retaining information about where  
the original project was compiled to.

Sorry the original issue description was incomplete, it seemed so obvious  
to me.
B







More information about the User mailing list