Xide Plugin - AssemblyInfo manipulator (BuildCount)

This forum is meant for anything you would like to share with other visitors
User avatar
SHirsch
Posts: 281
Joined: Tue Jan 30, 2018 8:23 am

Xide Plugin - AssemblyInfo manipulator (BuildCount)

Post by SHirsch »

Hi all,

maybe someone is interested in a plugin for Xide.
It manipulates AssemblyInfo.prg.

First part is change VersionAttibutes.
It increments the build number (third part of version) in all VersionAttibutes after every compile.
When I deploy my apps I always set the build number to divisible by 10 (zero at end, I call it release build no). So via menu item one can set the build number back to previous release build no or up to next release build no (due to fact that a new comile has to be done the number is set to 9 at the end). At export the current version is added to filename. Also the minor version (seconds part of version) can be incremented via menu.

Seconds part of the plugin is setting/changing the other AssemblyAttributes.
Backgound: I sell standard software to resellers. Some of the reseller have there own product name. So via menu item it is possible to change easily the attributes. I hope the sample is self explaining.

Attached a zip with the plugin (copy to PlugIns folder in XIDE folder) and a sample AssemblyInfo.prg

Any suggestions are wellcome.

Regards,
Stefan
Attachments
XideBC.PNG
XideBC.PNG (25.3 KiB) Viewed 291 times
Plugin.zip
(7 KiB) Downloaded 39 times
FFF
Posts: 1522
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Xide Plugin - AssemblyInfo manipulator (BuildCount)

Post by FFF »

Hi Stefan,
got it, works ;-)
Enhancement requests:
* increment only, if there was any change between compiles (useful)
* showing version info e.g. in XIDE's shell caption (sugar candy ;))

Thx
Karl
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
SHirsch
Posts: 281
Joined: Tue Jan 30, 2018 8:23 am

Xide Plugin - AssemblyInfo manipulator (BuildCount)

Post by SHirsch »

Hi Karl,

thanks for testing.
Karl Faller wrote: * increment only, if there was any change between compiles (useful)
Is already on my list.
Karl Faller wrote: * showing version info e.g. in XIDE's shell caption (sugar candy ;))
This may interfere with internal caption setting of Xide. But I will look into this.

Regards,
Stefan
User avatar
SHirsch
Posts: 281
Joined: Tue Jan 30, 2018 8:23 am

Xide Plugin - AssemblyInfo manipulator (BuildCount)

Post by SHirsch »

Hi all,

I have a new version of XIDE_BuildCount ready:
- The version from AssemblyInfo.prg of current app/lib will be inserted in caption.
- If a native recource file AssemblyInfo.rc is available the VERSIONINFO will be changed like in AssemblyInfo.prg.
- Version will be change only if files have changed after last compile.
- In AssemblyInfo.prg one can add defines and resources for each reseller. These values are inserted in AssemblyInfo.rc when reseller is changed.

A sample of AssemblyInfo.prg and AssemblyInfo.rc is included in zip file (hopefully self explaining).

Regards,
Stefan
Attachments
Plugins_1.3.380.zip
(11.14 KiB) Downloaded 42 times
FFF
Posts: 1522
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Xide Plugin - AssemblyInfo manipulator (BuildCount)

Post by FFF »

Hi Stefan,
got it, copied over old dll.
Added a new AssemblyInfo.prg to a sample prog, containing only:

Code: Select all

#using System.Reflection
#using System.Runtime.InteropServices

/*[assembly: AssemblyTitleAttribute( "BuildCount" )]
[assembly: AssemblyDescriptionAttribute( "BuildCount PlugIn für XIDE" )]
[assembly: AssemblyConfigurationAttribute( "" )]
[assembly: AssemblyCompanyAttribute( "Kölndata Software GmbH" )]
[assembly: AssemblyProductAttribute( "BuildCount" )]
[assembly: AssemblyCopyrightAttribute( "Copyright © Kölndata Software GmbH 2018" )]
[assembly: AssemblyTrademarkAttribute( "" )]
[assembly: AssemblyCultureAttribute( "" )]

[assembly: AssemblyVersionAttribute( "1.2.279.0" )]
[assembly: AssemblyFileVersionAttribute( "1.2.279.0" )]
[assembly: AssemblyInformationalVersionAttribute( "1.2.279.0" )]

*/
[assembly: AssemblyTitleAttribute( "Test für neue Version" )]              
[assembly: AssemblyVersionAttribute( "0.1.4.0" )]
[assembly: AssemblyFileVersionAttribute( "0.1.4.0" )]        
[assembly: AssemblyInformationalVersionAttribute( "0.1.4.0" )]
The not commented attributes get incremented as they should (i added one attribute after the other to provoke "change" ;) -
But one strange thing: the commented lines with "1.2.279" increment as well - and this info is the one shown in Xides' caption...
AssemblyInfo.PNG
AssemblyInfo.PNG (148.3 KiB) Viewed 291 times
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
SHirsch
Posts: 281
Joined: Tue Jan 30, 2018 8:23 am

Xide Plugin - AssemblyInfo manipulator (BuildCount)

Post by SHirsch »

Hi Karl,

quick and dirty. :) I do not parse complete content. I just search for [assembly: AssemblyVersion. With incrementing the same. Just check if line starts with searched value. So if you comment each line ('//') then it should work as expected.

Regards,
Stefan
FFF
Posts: 1522
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Xide Plugin - AssemblyInfo manipulator (BuildCount)

Post by FFF »

Hi Stefan,
sorry, no.
First tried with all lines "//" - no change.
Renamed file and set it to "Text", made a new AssemblyInfo.prg:
// Application : arraybase
// AssemblyInfo.prg , Created : 17.04.2018 16:34
// User : Karl2

#using System.Reflection
#using System.Runtime.InteropServices


[assembly: AssemblyTitleAttribute( "Test für neue Version" )]
[assembly: AssemblyVersionAttribute( "0.1.5.0" )]
[assembly: AssemblyFileVersionAttribute( "0.1.5.0" )]
[assembly: AssemblyInformationalVersionAttribute( "0.1.5.0" )]


//%LASTCOMPILE%17.04.2018 18:24:18Start1.prg

Increments, but Xide-Caption still increments to 1.2.281.0
Delete the old version of the file, now i see the 0.1.5.0 in the caption - but no more increment ;(

Karl
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
SHirsch
Posts: 281
Joined: Tue Jan 30, 2018 8:23 am

Xide Plugin - AssemblyInfo manipulator (BuildCount)

Post by SHirsch »

Hi Karl,

Comments with '//' should work now. '/*' still does not work.
Caption should also update from correct file.

Thank you for testing and feedback

Regards,
Stefan
Attachments
Plugins_1.3.400.zip
(11.16 KiB) Downloaded 41 times
FFF
Posts: 1522
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Xide Plugin - AssemblyInfo manipulator (BuildCount)

Post by FFF »

Good morning, Stefan!
Got it, overwrote old files.
Made a new project, new app, new assemblyinfo.prg,

Code: Select all

// Application : Application1
// AssemblyInfo.prg , Created : 18.04.2018   09:22
// User : Karl2
#using System.Reflection
#using System.Runtime.InteropServices
[assembly: AssemblyTitleAttribute( "Test für neue Version" )]              
[assembly: AssemblyVersionAttribute( "0.0.0.0" )]
[assembly: AssemblyFileVersionAttribute( "0.0.0.0" )]
[assembly: AssemblyInformationalVersionAttribute( "0.0.0.0" )]
//%LASTCOMPILE%17.04.2018 18:24:18Start1.prg
caption shows correct data - but somehow increment won't work now...
Plus: switching back to prior project, Xide throws this error:
Plugin_Error.PNG
Plugin_Error.PNG (24.96 KiB) Viewed 291 times
@Chris: BTW, could you make this dialog sizable? Scrolls are a PITA ;) - and/or Errormessage copyable would be nice...

Regards
Karl
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
SHirsch
Posts: 281
Joined: Tue Jan 30, 2018 8:23 am

Xide Plugin - AssemblyInfo manipulator (BuildCount)

Post by SHirsch »

Hi Karl,

next try.
At the end of your last line 'Start1.prg' caused the problem.
Exception is now caught inside plugin.

Regards,
Stefan
Attachments
Plugins_1.3.410.zip
(11.18 KiB) Downloaded 40 times
Post Reply