Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
AutoVersioning Plugin
JGM:
:lol: thank you anyways!
JGM:
Discovered a bug introduced by the new changes while using the plugin on the development of my simple application.
The plugin is not autoincrementing the values before compiling. Here is the fix for oncompiler started and oncompilerfinished:
==================================================
void AutoVersioning::OnCompilerStarted(CodeBlocksEvent& event)
{
if (m_Project && IsAttached() && m_IsVersioned[m_Project])
{
if (m_Modified)
{
const bool doAutoIncrement = GetConfig().Settings.DoAutoIncrement;
const bool askToIncrement = GetConfig().Settings.AskToIncrement;
if (doAutoIncrement && askToIncrement)
{
if (wxMessageBox(_("Do you want to increment the version?"),_T(""),wxYES_NO) == wxYES)
{
CommitChanges();
}
}
else if(doAutoIncrement)
{
CommitChanges();
}
}
}
} // end of OnCompilerStarted
void AutoVersioning::OnCompilerFinished(CodeBlocksEvent& event)
{
if (m_Project && IsAttached() && m_IsVersioned[m_Project])
{
++(GetVersionState().Values.BuildCount);
}
}
==================================================
I dont know why but the previous code wasn't working:
m_IsVersioned[event.GetProject()]
Maybe the function (event) wasn't passing the correct project pointer, I didn't deeply tested. I wanted to create a patch but I'm still downloading a fresh copy cb svn, since svn update sucks (I don't know how to manages it well)
I will provide a patch later since the checkouts takes an eternity :lol:
JGM:
Here is the patch to resolve the bug:
Changes:
Now the auto incrementation is behaving normally again.
Quick look of the patch attached
--- Code: ---Index: src/plugins/contrib/AutoVersioning/AutoVersioning.cpp
===================================================================
--- src/plugins/contrib/AutoVersioning/AutoVersioning.cpp (revision 5010)
+++ src/plugins/contrib/AutoVersioning/AutoVersioning.cpp (working copy)
@@ -293,7 +293,7 @@
// be activated and each has the compilerstarted/Finished ?????
void AutoVersioning::OnCompilerStarted(CodeBlocksEvent& event)
{
- if (m_Project && IsAttached() && m_IsVersioned[event.GetProject()])
+ if (m_Project && IsAttached() && m_IsVersioned[m_Project])
{
if (m_Modified)
{
@@ -316,7 +316,7 @@
void AutoVersioning::OnCompilerFinished(CodeBlocksEvent& event)
{
- if (m_Project && IsAttached() && m_IsVersioned[event.GetProject()])
+ if (m_Project && IsAttached() && m_IsVersioned[m_Project])
{
++(GetVersionState().Values.BuildCount);
}
Index: src/plugins/contrib/AutoVersioning/manifest.xml
===================================================================
--- src/plugins/contrib/AutoVersioning/manifest.xml (revision 5010)
+++ src/plugins/contrib/AutoVersioning/manifest.xml (working copy)
@@ -3,7 +3,7 @@
<SdkVersion major="1" minor="10" release="0" />
<Plugin name="AutoVersioning">
<Value title="AutoVersioning" />
- <Value version="1.2" />
+ <Value version="1.3" />
<Value description="Auto increments the version and build number of your application every time a change has been made and stores it in version.h with easy to use variable declarations. Also have a feature for committing changes a la SVN style, a version scheme editor and a change log generator.
Example:
--- End code ---
[attachment deleted by admin]
killerbot:
I will apply it soon ;-)
However I think it is good to find out why that event.GetProject() *might* be incorrect ?
Could you specify how you saw this misbehavior and how easily we could reproduce it (workspace with project in a zip file or something)
We should find the real cause and fix it over there ;-)
JGM:
I submitted the patch to berlios also.
I will make some testing this night if possible, to check if it is an autoversioning error not updating the m_Project pointer correctly or it's the event.getproject sending a diffrent pointer value, since the pointer by event.getproject is not found on the m_IsVersioned map :?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version