Page 1 of 1
VersionManager plugin
Posted: Sun Dec 21, 2008 9:35 pm
by jfouche
Hi
Here is my first plugin : a version manager.
It is simple to use :
1 - right click an a project and you will see a Version Manager menu
2 - Select Settings to manage your project : actually, you can just select where the file version is stored.
3 - Select Deliver if you want to change the version.
Enjoy
Re: VersionManager plugin
Posted: Sun Dec 21, 2008 11:07 pm
by eranif
Nice work!
Some questions/points:
- Why did you choose to use wxString for this purpose? why not make it a more generic plugin and use std::string?
- either way, I suggest that you add include file at the top of the vm_version.h file, something like #include <wx/string.h> OR #include <string> (if you accept my suggestion)
- Now that I see what you needed the events for, I understand why you need the an event for BUILD_STARTED as 'Send' and not 'Post' --> to make sure that the file is updated prior the build process started.
I see that the Set/GetUserData worked
Eran
Re: VersionManager plugin
Posted: Sun Dec 21, 2008 11:28 pm
by jfouche
Hi Eran
Thanks for your overview.
eranif wrote:- Why did you choose to use wxString for this purpose? why not make it a more generic plugin and use std::string?
Well, I think this is because it was faster for me (no need to make conversions), but you're right, I'm going to change this. I just wanted to test plugin interface as fast as possible
eranif wrote:- either way, I suggest that you add include file at the top of the vm_version.h file, something like #include <wx/string.h> OR #include <string> (if you accept my suggestion)
Of course, thank you for pointing me that problem
eranif wrote:- Now that I see what you needed the events for, I understand why you need the an event for BUILD_STARTED as 'Send' and not 'Post' --> to make sure that the file is updated prior the build process started.
Yes : I've got a new settings in progress : automatic increment build. But, thinking to this, maybe there can be a problem :
Suppose you have many project in your workspace (like CL), If you build another project that the one which manage version, the version is gonna be incremented, which is interresting. Not sure that it's easy to know if a project need increment version in a whole build. I'm gonna look if there are helpfull method in the plugin interface...
Re: VersionManager plugin
Posted: Mon Dec 22, 2008 2:11 am
by sdolim
What if wxEVT_BUILD_STARTED included the project name as clientData?
Re: VersionManager plugin
Posted: Mon Dec 22, 2008 1:34 pm
by eranif
sdolim wrote:What if wxEVT_BUILD_STARTED included the project name as clientData?
If you get the builded project name, you still need to query the dependencies (project->GetDependencies())
Also, maybe adding a new event for wxEVT_BUILD_STARTED_PROJECT_ONLY --> since in this case, dependencies are skipped.
Eran
Re: VersionManager plugin
Posted: Mon Dec 22, 2008 4:38 pm
by jfouche
Tell me if I'm wrong : if I click on the build button, it will make the workspace, not the project.
So I think I'm gonna start this way : AutoIncrementBuild only for the active project (I know this is not pefect
).
Re: VersionManager plugin
Posted: Mon Dec 22, 2008 5:19 pm
by eranif
jfouche wrote:Tell me if I'm wrong : if I click on the build button, it will make the workspace, not the project.
You are wrong.
Clicking the build button, builds the active project. If the project has dependencies, it will build them first (right click on the project and select 'Build Order' to view/edit the build order)
'project only' is when activated from 'project context menu -> project only -> build'
Eran
Re: VersionManager plugin
Posted: Mon Dec 22, 2008 6:12 pm
by jfouche
I thought it was the worspace, because clicking on the build button show me :
Code: Select all
"mingw32-make.exe" -j 1 -f "VersionManager_wsp.mk"
which is the worspace makefile.
If I click on project only -> Build, i have :
Code: Select all
"mingw32-make.exe" -j 1 -f "VersionManager.mk"
which is the project makefile.
Well, I don't know where is the truth...
Re: VersionManager plugin
Posted: Mon Dec 22, 2008 9:15 pm
by eranif
the "*_wsp.mk" makefile, is a very simple makefile which compiles each of the projects listed in the build order of the active project.
If you change the active project, the content of this makefile will be modified to suite the new project build order.
The truth is what I told you: Build button -> builds the active project along with all its dependencies.
Project only: compiles only that project excluding its dependencies.
You can build the entire workspace, from the workspace context menu ('Build workspace') option, this will build all projects even if they do not include in the build order of the active project
Eran
Re: VersionManager plugin
Posted: Mon Dec 22, 2008 10:04 pm
by jfouche
Thank you Eran for your explanation
Here is a new version with some of your remarks.
FYI, I only configure the project for Windows Release.