سؤال

I have set up a Teamcity server for start working with Continous Integration and having daily builds and also when VCS check-in is detected. Me and my team is now working on a videogame, we are using Unity as the game engine and C# as programming language. I have used Gendarme manually on our project and can totally use the benefits it offers. So I was trying to make it run as a build step of Teamcity, but I can seem to figure out how to make it to work. Do someone have some expirience with this combination of tools? Any experience shared is apreciated.

Thanks.

هل كانت مفيدة؟

المحلول

Well finally I did ended up finding a solution and I'am posting it here so that anyone interested can see it.

Teamcity has a Command Line build step that can be used for using Gendarme as part of your build process(For the custom scripts I am going to write here in the Workspace property of the Build Step you need to put where each of this .exe's are). Here is the console command needed for it:

gendarme.exe --v --html Your\Path\To\Save\Report\GendarmeReport.html --severity all --confidence all "Path/To/Your/Project/Library/ScriptAssemblies/Assembly-CSharp.dll" "Path/To/Your/Project/Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll" "Path/To/Your/Project/Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll"

Probably, if you run this build step after doing the Unity build the Assemblies here would have been erased by Unity, so you need to have another console command build step before the Gendarme step, this one:

Unity.exe -batchmode -nographics -quit

This will make unity re-generate the Library folder contents and running Gendarme build step after that will do the trcik. Finally Gendarme will sometimes throw a 1 exit code as it finishes the report, but the report have been successful and every rule check also, so I think this is probably a minor error, according to the manpages of Gendarme this code is returned when

The runner execution was successful but either some defects where found or no assembly was specified.

If the assemblies are been checked correctky, since you have the step that re-generates them, then you can tell Teamcity to ignore the exit code 1, you can do this going to the Build Failure conditions of Teamcity and unchecking the option build process exit code is not zero and that's all.

Hope this helps someone else that is also interested in something like this.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top