New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example output folders #73
Comments
This would be my preference too. |
I'm a fan of |
@micha137 Yes, I understand that in a real project, which needs to support multiple platforms or build configs, one would use Do we really need to handle that someone might compile the examples for both 32 and 64 bit? I'm not saying that it's impossible I just think it would be very rare - and it can be handled just by doing a Build instead of a Compile. Those that compile for 64 bit probably already know that. Anyhow I don't feel strongly about this. I see that you assigned yourself to this task. You should coordinate with @AngusJohnson since he has already done some work on this and I believe he has a solution ready. |
Yes, no problem to switch by rebuilding. I hope @AngusJohnson has not changed this yet, as my 42 line script is done, fixing *dproj und *.cbproj, but not *.lpi. |
Hi Micha. I'm very happy if you want to manage this. Go for it :). |
* for our 39 Delphi Examples and for our 5 C++ Builder examples * leaving the Lazarus examples as they are (but the *.lpi files don't use a common unit cache directory anyway and use a UnitOutputDirectory of "lib/$(TargetCPU)-$(TargetOS)") * see #73
Should also put the script for fixing the paths somewhere, like a folder |
Sorry to comment this so late, but as I mentioned before, I had a bit of work to do for my current project I earn my money with. Regarding this issue: I might be the only one who have objections with it, but here we go:
Actually the name shouldn't matter, but for sake of consistency I would vote to keep it as it is. When I started working in the GR32 team, the members were very strict when it came to naming. The code should be formatted according to the Pascal Style Guide. Within the guide procedure and field names started with a capital letter. Thus I would prefer to keep the capital letter here:
For this reason I'd also opt for using The only problem we have is the fact that there are currently many example units named "MainUnit". It would be necessary to rename them in order to see a benefit. |
* to be run with Cygwin Perl * they will need minor adjustments to get the paths right, since I moved these scripts into the subdirectory "Maintenance" now * see #73
Sure. No problem.
Habit from my days as a C/C++ developer where intermediaries would go into
Speed surely can't be the overriding reason for this decision. It's Delphi we're talking about; I don't think it matters if it takes 1 second or 1.2 to compile an example.
I understand your point but isn't the target audience of the examples the users of graphics32? In any case my experience is that compile speed is a non-problem with the examples. |
@CWBudde: Sorry I went forward already, but with the script it is (relatively) easy to change again. Capitalisation for consistency is good, not abbreviating is also fine with me. I just checked why we didn't hit the cache directory issue before, considering I also have to add |
…roup. refs #73: Adde powershell based Example project file update script. Project files are now updated based on a template. Currently only Delphi project files are supported.
The current examples are all configured as follows:
..\..\..\Binaries\$(Platform)\$(Config)
..\..\..\Unit Cache;..\..\..\Source
..\..\..\Unit Cache\$(Platform)\$(Config)
I propose that this be changed to:
.\bin
..\..\..\Source
.\lib
or if we must have the platform/config part, of which I'm not a fan, then:
.\bin\$(Platform)\$(Config)
..\..\..\Source
.\lib\$(Platform)\$(Config)
The important part is that the individual examples should not have the unit output folder of other examples in their search path.
One reason is that many examples uses the same unit names (for example
MainUnit.pas
) and the compiler isn't always smart enough to discover that themainunit.dcu
in the search path doesn't correspond to themainunit.pas
in the current project. The result is that the compile fails if one is lucky or that the application bombs spectacularly at run time if unlucky. In any case it's a bad practice.The reason I have made the
bin
andlib
folders subdirectories of the project folder is that it makes them easier to find and the examples more self contained. The choice ofbin
andlib
is just personal taste; It could just as well bebinaries
andlibrary
or whatever.The text was updated successfully, but these errors were encountered: