[Lazarus] Project / Save Project As ... - expected behavior?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Project / Save Project As ... - expected behavior?

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.

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Project / Save Project As ... - expected behavior?

Mattias Gaertner
On Fri, 1 Apr 2011 20:54:11 -0500
John Repucci <[hidden email]> 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?

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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Project / Save Project As ... - expected behavior?

Peter Williams
Hi

> Date: Sat, 2 Apr 2011 10:19:08 +0200
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Lazarus] Project / Save Project As ... - expected behavior?
>
> On Fri, 1 Apr 2011 20:54:11 -0500
> John Repucci <[hidden email]> 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.

> 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

> --
> _______________________________________________
> Lazarus mailing list
> [hidden email]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Project / Save Project As ... - expected behavior?

Mattias Gaertner
On Sun, 3 Apr 2011 02:29:14 +1100
Peter Williams <[hidden email]> wrote:

>
> Hi
>
> > Date: Sat, 2 Apr 2011 10:19:08 +0200
> > From: [hidden email]
> > To: [hidden email]
> > Subject: Re: [Lazarus] Project / Save Project As ... - expected behavior?
> >
> > On Fri, 1 Apr 2011 20:54:11 -0500
> > John Repucci <[hidden email]> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Project / Save Project As ... - expected behavior?

John Repucci
In reply to this post by John Repucci
>> > On Fri, 1 Apr 2011 20:54:11 -0500
>> > John Repucci <[hidden email]> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Project / Save Project As ... - expected behavior?

John Repucci
In reply to this post by John Repucci
> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Project / Save Project As ... - expected behavior?

Hans-Peter Diettrich
In reply to this post by John Repucci
John Repucci schrieb:

> 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


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Project / Save Project As ... - expected behavior?

Mattias Gaertner
In reply to this post by John Repucci
On Sat, 2 Apr 2011 14:20:40 -0500
John Repucci <[hidden email]> wrote:

> >> > On Fri, 1 Apr 2011 20:54:11 -0500
> >> > John Repucci <[hidden email]> 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus