Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-04

Project / Save Project As ... - expected behavior?

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

John Repucci

If I have a project that works (ie: compiles correctly...) and I do a Project / Save Project As ... into a different directory with a different name, should I expect that the new project should contain all necessary files and compile correctly?

OnGuard example program: "codegen" - If I compile it, it works just fine. When I do a Project Save As ...into a different directory, I only find two files in the new directory - NewCodeGen.lpi and NewCodeGen.lpr. And (duh...), the application fails to compile, complaining it cannot find a unit (codegenu, in this case).

0.9.31-29846, win32-Vista.

Reply by email

Mattias Gaertner
to John Repucci
If I have a project that works (ie: compiles correctly...) and I do a Project / Save Project As ... into a different directory with a different name, should I expect that the new project should contain all necessary files and compile correctly?

Only the lpi and lpr files are copied to the new location and the search paths are adapted. Normal projects will still compile. If you want a copy of the whole project directory you can use your favorite file browser.

Show quoted text 5 lines
OnGuard example program: "codegen" - If I compile it, it works just fine. When I do a Project Save As ...into a different directory, I only find two files in the new directory - NewCodeGen.lpi and NewCodeGen.lpr. And (duh...), the application fails to compile, complaining it cannot find a unit (codegenu, in this case).

Please create a bug report and give a simple example with a directory layout.

Mattias

Reply by email

Peter Williams
to Mattias Gaertner

Hi

Show quoted text 13 lines
Date: Sat, 2 Apr 2011 10:19:08 +0200 From: To: Subject: Re: [Lazarus] Project / Save Project As ... - expected behavior? On Fri, 1 Apr 2011 20:54:11 -0500 John Repucci wrote: > If I have a project that works (ie: compiles correctly...) and I do a > Project / Save Project As ... into a different directory with a > different name, should I expect that the new project should contain > all necessary files and compile correctly?

I believe that currently it is necessary to use the menu "View / Units..." for each unit then do a "File / Save as..." for each of the units. I also think that when a unit is saved that it's form is automatically saved... someone please correct me if this is wrong.

Show quoted text 17 lines
Only the lpi and lpr files are copied to the new location and the search paths are adapted. Normal projects will still compile. If you want a copy of the whole project directory you can use your favorite file browser. > OnGuard example program: "codegen" - If I compile it, it works just fine. > When I do a Project Save As ...into a different directory, I only find > two files in the new directory - NewCodeGen.lpi and NewCodeGen.lpr. > And (duh...), the application fails to compile, complaining it cannot > find a unit (codegenu, in this case). Please create a bug report and give a simple example with a directory layout. Mattias

Best Regards,Peter / pew

Show quoted text 5 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110403/300accae/attachment.html>

Reply by email

Mattias Gaertner
to Peter Williams
Show quoted text 17 lines
Hi > Date: Sat, 2 Apr 2011 10:19:08 +0200 > From: > To: > Subject: Re: [Lazarus] Project / Save Project As ... - expected behavior? > > On Fri, 1 Apr 2011 20:54:11 -0500 > John Repucci wrote: > > > If I have a project that works (ie: compiles correctly...) and I do a > > Project / Save Project As ... into a different directory with a > > different name, should I expect that the new project should contain > > all necessary files and compile correctly? > I believe that currently it is necessary to use the menu "View / Units..." for each unit then do a "File / Save as..." for each of the units. I also think that when a unit is saved that it's form is automatically saved... someone please correct me if this is wrong.

Correct.
If you want to move many units, it may be easier to edit the lpi file.

Mattias

Reply by email

John Repucci
Show quoted text 16 lines
> > On Fri, 1 Apr 2011 20:54:11 -0500 > > John Repucci wrote: > > > > > If I have a project that works (ie: compiles correctly...) and I do a > > > Project / Save Project As ... into a different directory with a > > > different name, should I expect that the new project should contain > > > all necessary files and compile correctly? > > > I believe that currently it is necessary to use the menu "View / Units..." for each unit then do a "File / Save as..." for each of the units. I also think that when a unit is saved that it's form is automatically saved... someone please correct me if this is wrong. Correct. If you want to move many units, it may be easier to edit the lpi file. Mattias

Ignoring the effort to make the changes ...

Is either of these procedures (move one file at a time or edit the lpi file) the way this should ideally work?

I was expecting that Save Project As ... would allow me to clone the project so I could start a spin-off. Would "Project / Publish Project do a clone?

Is there any reason I should not create an enhancement / feature request to change this behavior?
John

Reply by email

John Repucci
Show quoted text 17 lines
I believe that currently it is necessary to use the menu "View / Units..." for each unit then do a "File / Save as..." for each of the units. I also think that when a unit is saved that it's form is automatically saved... someone please correct me if this is wrong. > Only the lpi and lpr files are copied to the new location and the > search paths are adapted. Normal projects will still compile. > If you want a copy of the whole project directory you can use your > favorite file browser. > > > > OnGuard example program: "codegen" ?- If I compile it, it works just fine. > > When I do a Project Save As ...into a different directory, I only find > > two files in the new directory - NewCodeGen.lpi and NewCodeGen.lpr. > > And (duh...), the application fails to compile, complaining it cannot > > find a unit (codegenu, in this case). > > Please create a bug report and give a simple example with a directory > layout. > > Mattias

Mattias,
I tried this with a simple blank form project and it worked perfectly and as expected. All of the files (.lpi, .lpr, pas, lrm, etc... ) files moved to the new folder and compiled. I'll try again with the OnGuard examples to see if I continue to have issues.

I've copied the example from OnGuard to a new directory via my (not so favorite windows explorer) file manager, but I am unable to get a clean compile. sigh. More time to spend on this.

All, Thanks for the comments and suggestions.
John

Reply by email

Hans-Peter Diettrich
to John Repucci: Ignoring the effort to make the changes ... Is either of these procedures (move one file…
Show quoted text 6 lines
Is either of these procedures (move one file at a time or edit the lpi file) the way this should ideally work? I was expecting that Save Project As ... would allow me to clone the project so I could start a spin-off. Would "Project / Publish Project do a clone?

For cloning etc. IMO the project directory should be moved or copied, outside the IDE.

Is there any reason I should not create an enhancement / feature request to change this behavior?

The feature (as is) supports to move or duplicate project files, e.g. when you want multiple versions of the same project (package...). In this case the file references in the project file have to be updated, and this is what this feature does for the user. Similarly the project file is updated when one of the project units is Save'd As.

Moving around entire projects, e.g. for backup purposes, does not normally require changes to the project file, so that this can and should be done outside the IDE.

DoDi

Reply by email

Mattias Gaertner
to John Repucci: Ignoring the effort to make the changes ... Is either of these procedures (move one file…
Show quoted text 21 lines
>> > On Fri, 1 Apr 2011 20:54:11 -0500 >> > John Repucci wrote: >> > >> > > If I have a project that works (ie: compiles correctly...) and I do a >> > > Project / Save Project As ... into a different directory with a >> > > different name, should I expect that the new project should contain >> > > all necessary files and compile correctly? >> > >> I believe that currently it is necessary to use the menu "View / Units..." for each unit then do a "File / Save as..." for each of the units. I also think that when a unit is saved that it's form is automatically saved... someone please correct me if this is wrong. > > Correct. > If you want to move many units, it may be easier to edit the lpi file. > > > Mattias > Ignoring the effort to make the changes ... Is either of these procedures (move one file at a time or edit the lpi file) the way this should ideally work?

Yes for "Save Project As". It should work as a rename and a possibility to change the base directory of the project. No for the many units. Ideally there is a explorer like tool to move units around and all references are automatically updated.

I was expecting that Save Project As ... would allow me to clone the project so I could start a spin-off.

Then you need a function "clone project".

Would "Project / Publish Project do a clone?

Yes.
Maybe this function should be named "Publish/Clone project".

Is there any reason I should not create an enhancement / feature request to change this behavior?

This mail is already a feature request. :)

Mattias

Reply by email