Sign in Join
Wiki copytemporary

Project Groups: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Install
22
33The package is available since Lazarus 1.5.
44
55- Go to Package \> Install/Uninstall Packages.
66- Search in **Available for installation'' for**lazprojectgroups'''.
77- Select it.
88- Click on **Install selection**.
99- Save and rebuild IDE. The IDE will ask for confirmation, then it build the package, links it in and restarts itself.
1010
1111## Features
1212
1313### Menu items
1414
1515- New project group - creates a new project group with the active project as target. Same function as the editor **More / New**.
1616- Open project group - opens a dialog to select an .lpg file
1717- Open recent project group - list of recently opened groups
1818- Save project group - same function as the editor **Save** button.
1919- Saves project group as - same function as the editor **More / Save As** button.
2020
2121### Editor
2222
23-<figure>
24-<img src="ProjectGroupsEditor2.png" title="ProjectGroupsEditor2.png" />
25-<figcaption>ProjectGroupsEditor2.png</figcaption>
26-</figure>
23+![](/wiki-images/d/da/ProjectGroupsEditor2.png)
2724
2825#### Editor toolbar
2926
3027- **Save** - saves the .lpg including the .lpg files of nested project groups.
3128- **Add**
3229 - **Add from file** - Add projects (*.lpi), packages (*.lpk), Groups (*.lpg), single Pascal mfile (*.pas, *.pp) or scripts (e.g. *.sh, *.bat)
3330 - **Add current project** - Add active project to project group
3431- **Remove** - removes target from the list and puts it into **removed targets**.
3532- **Compile** - compiles the selected target:
3633 - Project/Build Mode: if the project and build mode is active it calls the IDE function, otherwise it uses lazbuild to compile the project. lazbuild automatically compiles outdated packages used by the project - same as the IDE.
3734 - Package: ompile using lazbuild. It uses lazbuild to compile a package in order to build independent of any project. It uses the target OS and CPU of lazbuild. lazbuild automatically compiles outdated packages used by the package.
3835 - Pascal module: builds the file using the IDE directives.
3936 - Project Group: builds all targets of the project group
4037 - Script: runs the script
4138- **Compile Clean** - same as **Compile**, except it passes -B to lazbuild when compiling, telling FPC to rebuild every unit it finds sources
4239- **Earlier** - moves the target one position up
4340- **Later** - moves the target one position down
4441- **Reload** - reloads the current .lpg, rebuilding the whole tree.
4542- **More**
4643 - **New** - create a new project group. Closes the old and opens the new.
4744 - **Save As** - saves the project group as a different file.
4845 - **Undo** - undo the last Delete
4946 - **Redo** - not yet implemented
5047 - **Options** - Opens the options frame. Same as Tools / Options / Environment / Project Groups
5148 - **Info** - Opens a dialog showing some information, e.g. all source paths of the project group
5249
5350#### Popup menu
5451
5552Right clicking on a node gives the following menu items depending on the selected node:
5653
5754- **Copy filename** - copies the filename of the selected target to the clipboard
5855- **Run** - Open the target in the IDEthis loads the project in the IDE
5956- **Compile**
6057- **Compile clean**
6158- **Compile from here** - compiles this target and all targets below.
6259- **Remove**
6360- **Earlier**
6461- **Later**
6562- **Open** - same as double click
6663 - Project: this opens the project in the IDE (closing the currently active).
6764 - Package: opens the package editor of the package.
6865 - Pascal file: opens it in the source editor
6966- **Properties**
7067 - Project: as open, except it also opens the Project Options.
7168 - Package: opens the package editor of the package.
7269 - Pascal file: opens the dialog to setup the IDE directives for Build and Run.
7370
7471## Concepts
7572
7673### Projects
7774
7875- The IDE has only one active project. The active project defines the active target OS, CPU and processor, the loaded packages, search paths and other compiler flags. And the active project has exactly one active build mode.
7976- When compiling the active project build mode the normal IDE function *DoBuildProject* is called.
8077- When compiling another build mode of the active project the active build mode is switched and *DoBuildProject* is called.
8178- When compiling a non active project the external tool **lazbuild** is called and output is shown in the Messages window. Hints/Warnings/Errors of files outside the active project or its packages might be interpreted wrong by the IDE.
8279- Note: You can add the same project multiple times. For example add *ProjectA* with build mode *Debug* active, then *ProjectA* again, except with build mode *Release* active.
8380
8481### Package
8582
8683- A package is affected by the active project, for example the project defines the target OS and CPU.
8784- When compiling a package the tool *lazbuild* is called to make sure the active project has no effect. *lazbuild* uses the target OS/CPU it was compiled with.
8885
8986### Pascal file
9087
9188- If you want to see output of the **Run** command, add the following directive to the file:
9289
9390``` pascal
9491{%RunFlags Messages+}
9592```
9693
9794- Hint: You can use instantfpc scripts to write Pascal scripts to do arbitrary things, like creating a zip, update documentation, install, uploading files. See [[InstantFPC]]
9895
9996Example for an instantfpc script:
10097
10198``` pascal
10299#!/usr/bin/instantfpc
103100{%BuildCommand instantfpc --skip-run -B -gl myscript.pas}
104101{%RunCommand instantfpc -gl myscript.pas}
105102{%RunFlags Messages+}
106103begin
107104 writeln('Running MyScript ...');
108105end.
109106```
110107
111108### Nested Project Group
112109
113110You can add a project group as a sub target of the project group.
114111
115112## Other features
116113
117114- By default if the project group editor was open when closing the IDE, the editor will reopen on next start with the last open group. You can disable this in the options.
118115- You can redirect Compile/Build to compile the selected target in the project group editor. See Tools / Options / Project Groups / "Compile" and "Build" compile target
119116- Option "Show target paths": Disable: show file names without path, Enable: show file names with paths relative to directory of lpg
120117- Find in files now has the option to search in all files in the currently loaded project group
121118
122119## Bugs / ToDos
123120
124121- Not yet updating menu items enabled state.
125122- Changes in the IDE are not yet updating the project group editor. After altering you need to click **Reload**.
126123- Changes on disk are not yet recognized. Use **Reload**.
127124- Show active build mode, active project
128125- "New" button to create a package/project/file and add to project groups
129126- clean function, like the Run / Clean up and build dialog
130127- drag and drop within the editor
131128 - reorder targets
132129 - move targets between sub groups
133130 - move file to another project/package
134131- save session in project group, allowing to quickly switch the active project
135132- load sub projects in IDE to use code navigation for files not in the active project
136133- find references in files
137134
138135---
139136*From the Free Pascal wiki, page "Project Groups", as it stood on 2020-09-17 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
140137Category: Lazarus
141138Category: Lazarus IDE plugins
142139Category: Packages

Back to history