Added Option to create an lpk for libraries#7
Added Option to create an lpk for libraries#7andrewd207 wants to merge 4 commits intograemeg:masterfrom
Conversation
… need less work. Improved Unit name detection for BootstrapGenerator. More units are found. Added Param to DiscoverUnits to allow returning whole filename/path or only unit name as before. And protected instead of private so inherited class could reuse code.
…ound. Added Param to DiscoverUnits to allow returning whole filename/path or only unit name as before. And protected instead of private so inherited class could reuse code.
|
Also, it's worth noting that pasbuild will find more .pas files with the improvement to unit name searching and for fpgui it's agg units. Several of them don't compile, because of comments or being windows/gdi or using units not in the source tree scope. |
|
Apologies for the delay! I somehow didn't get any notifications about this PR—I'll double-check my repository settings to see what went wrong. First off, thank you so much for the contribution and for showing interest in PasBuild. It’s great to see others poking at the codebase. You actually jumped ahead of my future plans! 😃 From the start, I’ve had the idea of auto-generating Lazarus Packages, but it has been a lower priority. I’m hesitant to bake the LPK generation directly into the core PasBuild binary, as it slightly conflicts with my goal of keeping the tool project-independent, and avoiding hard-coded paths in projects or tying to external projects file formats that could change (given how much LPK layouts have varied over time). My goal was to handle this via a plug-in system, loosely inspired by how Git handles extensions. I’ve recently implemented the Even though I'm not merging the LPK logic directly yet, your PR was incredibly helpful for two reasons:
Thanks again for the input—it definitely made the project better. Let me know if you have any thoughts on the plugin system! |
|
That’s cool — I admit it felt a little alien to have a Lazarus target in the somewhat generic build system. I did have one thought as I was writing the plugin: if each build goal has a corresponding class, why not just have a registration with a class, like:
Then it wouldn't need an enum or to/from, just PerformGoal(FoundGoal) But I looked a little closer and saw that when the goals are called, they have different parameters — so it’s not quite that simple. FWIW freepascal can use typeinfo to call procedures now in trunk. But assuming you could register them, you could use interfaces and even load dynamic libraries that implement your plugins, etc. In that case, a package could probably be made for Lazarus that implements a plugin for PasBuild. I was using this to call tools from an ollama tool request. I limited myself to basic types without const/out/var but I imagine passing classes shouldn't be too bad either. |
|
Ahh you already have a working plugin system 😀 I had read it as it was in your future plans. I'm very curious what are you using to write freepascal files as your IDE? |
👍
TL;DR: maximus The back story... MSEide (which was normally my go-to IDE) had too tight integration with GDB. FP IDE (that FreeVision IDE) also had tight integration with GDB, but that is actually a lot easier to refactor to support multiple debuggers than MSEide. Lazarus - well yes that has better design, but there is so much about Lazarus I'm not a fan of, and I didn't want to step on any toes. So I thought I would use fpGUI's IDE instead. But there starts the problem. It was far from being an "ide". My recent years with Java and Eclipse/IntelliJ has taught me how well IDEs can work. Moving back to MSEide and Lazurus felt like the stone age. 😁 So, I created my own debug format, I already created my own debugger, I created my own GUI toolkit, I created a Maven (java) inspired build system. I have all this awesome experience with IntelliJ.... It just seemed logical to bring this all together - in the form of an IDE. 😆 So that's what I'm working on. Still got tons to do. The editor was a good start, but it missed a lot of features. So I started there. Then tokenised highlighting (and I threw in a few editor themes for good measure). Then PasBuild integration (using the same Feel free to give it a try and let me know your thoughts. ;-) |
First I changed the TArgumentParser.GoalToString/ToGoal code to not need updating for new goals. This was not really needed so, sorry for that.
Added an option 'lazarus-package' as a goal. It builds an lpk if a project is a 'library' type. + 2 new units to implement that.
I based then on the Compile command and removed what I didn't need.
Specifically I did this for the fpgui_framework.lpk file. which I later found in _template. But this could be useful too for anything. Lazarus is more than happy to generate the pas file that goes with the lpk.
Let me know if this fits or there's something you'd like changed.