How to create custom Jenkins plugin for the .NET project ?

33 views
Skip to first unread message

Vadivel Natarajan

unread,
Jun 24, 2016, 1:16:07 AM6/24/16
to jenkin...@googlegroups.com, jenkins...@googlegroups.com
Hi All, 

I would like to modify the AssemblyCopyright and AssemblyCompany in AssemblyInfo.cs file of a .NET project. As far as i searched, i didn't get an any idea. So i decided to write a plugin to achieve this. So, what i have to do first like what are the softwares that should install in server machine and in which programming language do i need to written the code? How to test the written plugin?


Below are the things i need to change in the file

[assembly: AssemblyCopyright("2001- 2010")]
[assembly: AssemblyCompany("The XXXX Software Foundation")]


Note: I have tried it using text find/replace in jenkins. No use in that. So, please do let me know is there any other way to achieve this.


Regards,
Vadivel 

Oleg Nenashev

unread,
Jun 24, 2016, 2:49:43 AM6/24/16
to Jenkins Developers, jenkins...@googlegroups.com
I think it would be better to integrate the functionality into an existing plugin like https://wiki.jenkins-ci.org/display/JENKINS/Change+Assembly+Version .

пятница, 24 июня 2016 г., 7:16:07 UTC+2 пользователь Vadivel Natarajan написал:

Tom Moore

unread,
Jun 24, 2016, 8:24:45 AM6/24/16
to Jenkins Developers, jenkins...@googlegroups.com
For Company and Copyright, why aren't you just editing the file and saving it in your repository?  Those values shouldn't change enough to warrant build time modification.

The values in AssemblyInfo.cs that are most likely candidates for build time modification are:
[assembly: AssemblyVersion("0.0.0")]
[assembly: AssemblyFileVersion("0.0.0")]
[assembly: AssemblyInformationalVersion("0.0.0")]

The last two:
AssemblyFileVersion
AssemblyInformationalVersion

don't get into the file by default and have to be added.

Slide

unread,
Jun 24, 2016, 11:34:37 AM6/24/16
to Jenkins Developers, jenkins...@googlegroups.com
I use the MSBuild Community tasks to do this. I generate a GlobalVersion.cs file during the build which is included in my projects. This file contains common assembly attributes. You could even pass in git or other SCM revision information as a property to be included in the version. 

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/5f1d1176-16d6-4f8c-a615-f4d02fd228a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gavin Mogan

unread,
Jun 24, 2016, 8:14:56 PM6/24/16
to Jenkins Developers, jenkins...@googlegroups.com
I'm seconding the updating of the existing plugin

That being said, I did write https://github.com/halkeye/AssemblyVersionChanger/blob/master/Main.cs a couple jobs ago that created a cli tool that would update the assembly information. That might be a good starting point.

There might be better ideas on the user list if you don't want to modify the plugin.
Reply all
Reply to author
Forward
0 new messages