Problems Building Ranorex with Jenkins

Ask general questions here.
tallahassee101
Posts: 169
Joined: Thu Jan 13, 2011 2:06 pm

Problems Building Ranorex with Jenkins

Post by tallahassee101 » Mon Oct 29, 2012 9:20 pm

Hi,

I currently am creating a build of our Ranorex project through Jenkins and would like to change the manner in which we do it, but cannot figure out how. We currently are having to check-in all our generated ranorex *.cs files which I would like to remove from subversion. The problem is that the build on Jenkins fails then, so I'm wondering how I need to setup my Jenkins project so that it can properly pull down the Ranorex solution from subversion and build the Ranorex projects without checking in any generated *.cs files.

I'm using the latest version of Ranorex 3.3 and executing a windows batch script within my Jenkins project as such:

Code: Select all

call %WORKSPACE%\Ranorex_TacView\build.bat
My build.bat file contains a build method that sets up different folder and project names and essentially just calls the following code on them:

Code: Select all


cd %WORKSPACE%\Ranorex_TacView
echo ### Building %PROJECTNAME%###
%systemroot%\Microsoft.NET\Framework\v3.5\MSBuild.exe %FOLDERNAME%\%PROJECTNAME%.csproj /property:Configuration=Release
cd %WORKSPACE%\Ranorex_TacView\%FOLDERNAME%\bin\Release
"C:\Program Files\7-Zip\7z.exe" a -tzip ..\%PROJECTNAME%.zip *

The output from Jenkins when trying to build a project file without the cs files is:
PrepareForBuild:
Creating directory "bin\Release\".
Creating directory "obj\x86\Release\".
CSC : error CS2001: Source file 'Recording1.cs' could not be found
CSC : error CS2001: Source file 'Recording2.cs' could not be found
Done Building Project "ProjectFile.csproj" (default targets) -- FAILED.
Build FAILED.
"ProjectFile.csproj" (default target) (1) ->
(CoreCompile target) ->
CSC : error CS2001: Source file 'Recording1.cs' could not be found
CSC : error CS2001: Source file 'Recording2.cs' could not be found
0 Warning(s)
2 Error(s)



Any help would be greatly appreciated.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Problems Building Ranorex with Jenkins

Post by Support Team » Tue Oct 30, 2012 5:12 pm

Hello,

I recommend to use subversion to store all *.cs files as you have a version control.
Besides that, Jenkins gets these files from your SVN server.

Please take a look at our blog Integrating Ranorex in Jenkings.

Regards
Markus (T)
.
Image

tallahassee101
Posts: 169
Joined: Thu Jan 13, 2011 2:06 pm

Re: Problems Building Ranorex with Jenkins

Post by tallahassee101 » Wed Oct 31, 2012 4:41 pm

Markus,

It doesn't make any sense to have to store generated files in subversion if I am building on Jenkins. These files should get generated when I execute a build on Jenkins, which is what I am confused about how to do. Would you please explain how this is done because the blog post does not explain it and it does not seem to work for me.

Thanks,
-Nick

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Problems Building Ranorex with Jenkins

Post by Support Team » Fri Nov 02, 2012 4:10 pm

Hello,

The error message 'CSC : error CS2001: Source file 'Recording1.cs' could not be found' shows that there are missing source code files. You need Ranorex Studio in order to generate these source code files.
MSBuild.exe only compiles the project that you could use to build your project if source code files exist.

Regards,
Markus (T)
.
Image

tallahassee101
Posts: 169
Joined: Thu Jan 13, 2011 2:06 pm

Re: Problems Building Ranorex with Jenkins

Post by tallahassee101 » Mon Nov 05, 2012 2:32 pm

Markus,

If I load a licensed version of Ranorex Studio on my build machine is there a way to use it with Jenkins in order to generate those files? Using a command line statement perhaps?

Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Problems Building Ranorex with Jenkins

Post by Support Team » Mon Nov 05, 2012 5:38 pm

Hello,

Currently, it is not possible to do that using the command line, sorry for that.
A command line statement will be provided in one of our next releases.

Regards,
Markus (T)
.
Image