2006/2/18, Mattias Gaertner <[EMAIL PROTECTED]>:
That's a good idea. Right now the current version is the one I sent, as I can't work on this on a daily basis. My next release will probably address some of the points you listed below.
AFAIK the .dof file is like an INI with informations about the project; do you know which sections/keys should I use? I think [Directories] and [History*] are good candidates. My first thought was to start like the "Convert Files" tool I used to port from CLX to VCL; this tool is very simple, basically a fancy search-and-replace based on a dictionary.
With this talk we can get a smarter tool.
So it would be better to open a DPR file (instead of a directory) and scan it, using as "list of files" the files found after the "uses * in" piece of code? It would be easy to parse them and the list would be smaller.
One nice side effect is to get people that just heard about Lazarus giving it a try faster, or at least knowing before hand how hard it will be to port their projects. This could help them to know which kind of components they should avoid, and what is supported. For a first-time user it's hard to find out what works and what don't.
On Thu, 16 Feb 2006 10:22:17 -0300
Alexsander Rosa <[EMAIL PROTECTED]> wrote:
> Maybe the tool could use the codetools for some complex source-code
> operations and TProject for generation of the lpi file - from *outside*
> the IDE.
The codetools are no problem.
About TProject: I agree, that the converter needs a lot of the IDE. Too
much, to put it all into the IDEIntf.
What about this:
We add a directory <lazarusdir>/converter.
Here we put all new IDE units, that converts Delphi things.
And we add <lazarusdir>/tools/delphiconverter/
Here we put the new standalone tool.
If you agree, I can setup this. Just send me a current version.
That's a good idea. Right now the current version is the one I sent, as I can't work on this on a daily basis. My next release will probably address some of the points you listed below.
I just had a short look at your project:
- The .dof file is ignored
AFAIK the .dof file is like an INI with informations about the project; do you know which sections/keys should I use? I think [Directories] and [History*] are good candidates. My first thought was to start like the "Convert Files" tool I used to port from CLX to VCL; this tool is very simple, basically a fancy search-and-replace based on a dictionary.
With this talk we can get a smarter tool.
- You scan sub directories, but this will find too much and not enough.
Delphi projects define their parts via the uses section in the .dpr file.
For example:
uses MyUnit in '..\dir\MyUnit.pas';
So it would be better to open a DPR file (instead of a directory) and scan it, using as "list of files" the files found after the "uses * in" piece of code? It would be easy to parse them and the list would be smaller.
This line means: MyUnit is part of the project and the directory '..\dir'
must be added to the unit path.
- I like the idea, to first setup some values, then get an overview (scan
button), what will happen.
One nice side effect is to get people that just heard about Lazarus giving it a try faster, or at least knowing before hand how hard it will be to port their projects. This could help them to know which kind of components they should avoid, and what is supported. For a first-time user it's hard to find out what works and what don't.
Mattias
> One early version of my previous idea is attached.
>
> 2006/2/15, Mattias Gaertner <[EMAIL PROTECTED]>:
> >
> > On Wed, 15 Feb 2006 12:00:39 -0300
> > Alexsander Rosa < [EMAIL PROTECTED]> wrote:
> >
> > > After a few "quick looks", I do not fully understand the structure of
> > the
> > > Lazarus source code. I would be easier for me if I could start a
> > separate
> > > application for early limited tests and, after it proves itself
> > > worthy, someone more familiar with Lazarus source tree could help me
> > > to
> > integrate
> > > the tool into the IDE.
> >
> > Of course, reinventing the wheel is much easier at the beginning.
> > And for simple Delphi sources, without packages, include files, IFDEFs,
> > etc.
> > a simple converter could be written quite easily.
> > So, please continue, but keep in mind to write it as modules and/or
> > package.
> > This way we can later add some designtime features, so the converter can
> > be
> > extended to use the IDE package system. Then more complex Delphi
> > projects/packages can be converted too.
> >
> >
> > > IMHO, main.pp is a bit "crowded". More comments below.
> >
> > main.pp is a monster.
> > Eventually the source editor stuff and the form editor stuff will become
> > separate parts.
> >
> >
> > > 2006/2/14, Mattias Gaertner < [EMAIL PROTECTED]>:
> > > >
> > > > On Tue, 14 Feb 2006 17:22:21 -0300
> > > > Alexsander Rosa < [EMAIL PROTECTED]> wrote:
> > > >
> > > > > (...) I was thinking about a different design, where the typical
> > > > > use would be:
> > > > >
> > > > > 1) Select a directory where the Delphi project is
> > > >
> > > > 1b) Open in the Lazarus IDE a Delphi project
> > >
> > >
> > > This would be nice, too. Seems easy to add this feature after the tool
> > is
> > > ready.
> > >
> > > > 2) Click "Convert to Lazarus"
> > > > > 3) Watch the progress bar run ;-)
> > > > >
> > > > > Optionally, the user could specify two places: LCL_DIR and
> > > > > VCL_DIR,
> > > > where
> > > > > the tool would read the classes to get the available properties,
> > > > removing
> > > > > them from the DFM files (and commenting out in the PAS files). A
> > > > > "translation table" could be used to replace the property instead
> > > > > of
> >
> > > > > removing the entire line from the DFM. In the PAS files, the Uses
> > > > section
> > > > > would be corrected, and so on.
> > > > >
> > > > > I would like to start coding as soon as possible, but I'm putting
> > this
> > > > > here in order to discuss this design and get ideas.
> > > >
> > > > About LCL_DIR and VCL_DIR:
> > > > - The tool must work without Delphi sources too.
> > > > - The tool should also work with Delphi packages.
> > > > - The tool should also convert Delphi projects, which require
> > packages.
> > > > A LCL_DIR is not enough.
> > > >
> > > > The idea is that:
> > > > It first scans the project for required packages and searches
> > > > corresponding
> > > > lazarus packages.
> > > > Then it loads the needed packages.
> > > > Then it scans for search paths and compiler options.
> > > > Then it converts each .pas file and does a simple conversion of the
> > .dfm
> > > > to
> > > > .lfm files.
> > > > Then it searches for all used classes in the .lfm files and collects
> > all
> > > > properties.
> > > > Then it finishes the conversion of the .lfm files.
> > >
> > >
> > > About packages: there's a huge number of standard and third-party
> > packages
> > > available for Delphi, many of them have similar counterparts for
> > Lazarus,
> > > others are unique. How the tool would solve that? A simple solution
> > > (for
> >
> > > version 1.0) is to have a database of Delphi third-party packages with
> > the
> > > provided functionality: after the first scan, the tool would show a
> > report
> > > of what needs to be installed on Lazarus, what is compatible, what is
> > > similar, etc.
> >
> > Yes.
> > Or a simple heuristic: If a unit is missing and a lazarus package
> > contains a
> > unit with this name, suggest the user to add this package to the
> > requirements of the new lazarus project.
> > But this can be added later. Just keep the interface of the converter
> > open for additions. Aka add some events.
> >
> >
> > > The package stuff, the compiler options and the .lpi parts require so
> > many
> > > > parts of the IDE, that it will be quite hard to create a separated
> > > > application. That's why I suggest to create instead a package with
> > > > the conversion functions. You can write a small application to test
> > > > the basic functions, like converting simple Delphi projects.
> >
> >
> > Mattias
> >
> > _________________________________________________________________
> > To unsubscribe: mail [EMAIL PROTECTED] with
> > "unsubscribe" as the Subject
> > archives at http://www.lazarus.freepascal.org/mailarchives
> >
>
>
>
> --
> Atenciosamente,
>
> Alexsander da Rosa
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
--
Atenciosamente,
Alexsander da Rosa
