Jenkins and Qt projects

1,136 views
Skip to first unread message

mrz

unread,
Oct 20, 2012, 7:40:13 AM10/20/12
to jenkins...@googlegroups.com


Hi everyone, this is my first time using Jenkins.

I'm trying to use Jenkins for some project I have written in Qt framework.

There is qmake plug-in for Jenkins in Jenkins wiki page, although this plug-in doesn't exist in Jenkins plug-in list.

I've looked for .hpi file for qmakebuilder plug-in, couldn't find it though. So I download the source code from the given repository, tried to compile it as described in Jenkins wiki... but I get  build error indicating:

 Failed to execute goal org.jvnet.hudson.tools:maven-hpi-plugin:1.40:apt-compile (default-apt-compile) on project qmakebuilder: Execution default-apt-compile of goal org.jvnet.hudson.tools:maven-hpi-plugin:1.40:apt-compile failed: A required class was missing while executing org.jvnet.hudson.tools:maven-hpi-plugin:1.40:apt-compile: com/sun/mirror/apt/AnnotationProcessorFactory

Seems there is/was compatibility problem between JDK 7 and Jenkins, i dont know how to solve it though.

Any of you guys have used this plug-in? or any other Jenkins plug-in to compile Qt projects with?

I'm using JDK 7 with Maven 3 on openSuse x64 machine.

Mark Waite

unread,
Oct 20, 2012, 8:24:14 AM10/20/12
to jenkins...@googlegroups.com
If you'd rather not wrestle with creating a dedicated qmake plugin, couldn't you call make or gmake or nmake and have it invoke qmake?  

That seems to be what is described on the  Hudson (not Jenkins) plugin page that you referenced, and it seems like it should work.  You wouldn't need to bother with attempting to bring that plugin from Hudson to Jenkins and you wouldn't need to bother with JDK compatibility questions from attempting to build the plugin.

If that isn't workable, you may want to bring your question to the Developers mailing list (mailto:jenkin...@googlegroups.com). 

Mark Waite



From: mrz <rash...@gmail.com>
To: jenkins...@googlegroups.com
Sent: Saturday, October 20, 2012 5:40 AM
Subject: Jenkins and Qt projects

Richard Mortimer

unread,
Oct 20, 2012, 8:45:43 AM10/20/12
to rash...@gmail.com, jenkins...@googlegroups.com
Hi,

On 20/10/2012 13:24, Mark Waite wrote:
> If you'd rather not wrestle with creating a dedicated qmake plugin,
> couldn't you call make or gmake or nmake and have it invoke qmake?
>
> That seems to be what is described on the Hudson (not Jenkins) plugin
> page that you referenced, and it seems like it should work. You
> wouldn't need to bother with attempting to bring that plugin from Hudson
> to Jenkins and you wouldn't need to bother with JDK compatibility
> questions from attempting to build the plugin.
The plugin is already in the jenkins build environment. I suspect it
needs someone to give it a little care and maybe take ownership of it if
it still serves a useful purpose.

https://wiki.jenkins-ci.org/display/JENKINS/qmakebuilder+Plugin
https://github.com/jenkinsci/qmakebuilder-plugin
https://jenkins.ci.cloudbees.com/job/plugins/job/qmakebuilder-plugin/

It looks like it has been updated to a recent version of the Jenkins
maven pom so you may have more luck building from the jenkins source.

>
> If that isn't workable, you may want to bring your question to the
> Developers mailing list (mailto:*jenkin...@googlegroups.com*).

As Mark says if you have difficulty getting it to work or indeed if it
does work fine then you might find someone on jenkinsci-dev who will be
able to help you - or better yet just ask there or in IRC am I'm sure
that someone will set you up with commit rights so that you can take
ownership of the plugin and do a release yourself.

Regards

Richard

>
> Mark Waite
>
>
> ------------------------------------------------------------------------
> *From:* mrz <rash...@gmail.com>
> *To:* jenkins...@googlegroups.com
> *Sent:* Saturday, October 20, 2012 5:40 AM
> *Subject:* Jenkins and Qt projects
>
>
> <http://stackoverflow.com/questions/12986156/use-jenkins-ci-for-qt-projects#>
>
> *
> *
>
> Hi everyone, this is my first time using Jenkins.
> I'm trying to use Jenkins for some project I have written in Qt
> framework.
> There is qmake plug-in
> <http://wiki.hudson-ci.org/display/HUDSON/qmakebuilder+Plugin> for
> Jenkins in Jenkins wiki page, although this plug-in doesn't exist in
> Jenkins plug-in list.
> I've looked for .hpi file for qmakebuilder plug-in, couldn't find it
> though. So I download the source code from the given repository,
> tried to compile it as described in Jenkins wiki
> <https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial>... but

Richard Mortimer

unread,
Oct 20, 2012, 9:38:58 AM10/20/12
to rash...@gmail.com, jenkins...@googlegroups.com
Hi,

On 20/10/2012 13:45, Richard Mortimer wrote:
> The plugin is already in the jenkins build environment. I suspect it
> needs someone to give it a little care and maybe take ownership of it if
> it still serves a useful purpose.
>
> https://wiki.jenkins-ci.org/display/JENKINS/qmakebuilder+Plugin
> https://github.com/jenkinsci/qmakebuilder-plugin
> https://jenkins.ci.cloudbees.com/job/plugins/job/qmakebuilder-plugin/
>
> It looks like it has been updated to a recent version of the Jenkins
> maven pom so you may have more luck building from the jenkins source.
>
Looks like it does not build with OpenJDK7 at the moment due to reliance
on Sun internal code in the Hudson/Jenkins test framework. Builds fine
with java 6 and that should work on a java 7 runtime.

There is a freshly built hpi file at
https://jenkins.ci.cloudbees.com/job/plugins/job/qmakebuilder-plugin/1/hudson.plugins.qmake$qmakebuilder/

Give that a try and report back how you get on.

Regards

Richard

mrz

unread,
Oct 20, 2012, 10:27:58 AM10/20/12
to jenkins...@googlegroups.com, rash...@gmail.com


On Saturday, October 20, 2012 5:09:29 PM UTC+3:30, Richard Mortimer wrote:
Hi,

On 20/10/2012 13:45, Richard Mortimer wrote:
> The plugin is already in the jenkins build environment. I suspect it
> needs someone to give it a little care and maybe take ownership of it if
> it still serves a useful purpose.
>
> https://wiki.jenkins-ci.org/display/JENKINS/qmakebuilder+Plugin
> https://github.com/jenkinsci/qmakebuilder-plugin
> https://jenkins.ci.cloudbees.com/job/plugins/job/qmakebuilder-plugin/
>
> It looks like it has been updated to a recent version of the Jenkins
> maven pom so you may have more luck building from the jenkins source.
>
Looks like it does not build with OpenJDK7 at the moment due to reliance
on Sun internal code in the Hudson/Jenkins test framework. Builds fine
with java 6 and that should work on a java 7 runtime.
Yes, I managed to compiled the source code with JDK 6 and generate the hpi file in target foler... worked just fine.

There is a freshly built hpi file at
https://jenkins.ci.cloudbees.com/job/plugins/job/qmakebuilder-plugin/1/hudson.plugins.qmake$qmakebuilder/

Give that a try and report back how you get on.
sure thing... I’ll try them both.

Regards

Thank you everybody.
Richard

mrz

unread,
Oct 22, 2012, 3:10:52 AM10/22/12
to jenkins...@googlegroups.com, rash...@gmail.com
I successfully installed the qmakebuilder plug-in into my Jenkins by adding the .hpi file that i got from compiling the code with JDK 6 and it seems to work smoothly for me.
I believe the .hpi file Richard has compiled should work just fine as well.
Thank you once again.

mrz

unread,
Oct 22, 2012, 4:12:33 AM10/22/12
to jenkins...@googlegroups.com, rash...@gmail.com
On a different note, I am trying to resolve dependencies my project has to other external/internal projects. can you give me some hints on this?

To be specific, I have a SVN repository which contains project A, and project B both written using Qt.
Project A is independent, project B is dependent to project a and some external library.
When running on my machine, I set the LD_LIBRARY_PATH to project A .so (and any other .so file required) file to compile project B).

I have SVN plug-in for Jenkins now, and I checke out the project. Obviously, project A will be compiled with no error, while in project B compilation I get error indicating some file cannot be found due to the dependency.

I am looking forward to overcome this In JEnkins using another plug-in in or customizing qmake Plug-in some how....

Jon Schewe

unread,
Oct 22, 2012, 9:29:04 PM10/22/12
to jenkins...@googlegroups.com, rash...@gmail.com
I build Qt based projects in Jenkins as well as non-Qt based projects. I'm primarily unix based and have found that the best way to get all of the builds working is to do everything from shell scripts that call make, which then calls qmake to build Makefiles and then make to build the code. I'm using msys on Windows to execute the shell scripts and the x-shell plugin to make my cross-platform builds all use the same scripts to fire everything off. This actually works quite well.
--
Jon Schewe | http://mtu.net/~jpschewe


mrz

unread,
Oct 23, 2012, 1:26:43 AM10/23/12
to jenkins...@googlegroups.com, rash...@gmail.com
seems thats the only option I have, I think it would be much neater if there was a plug-in or the existence qmakebuilder plug-in could have been modified or had more option.
However, at the end of the day, the important thing is if your jobs can be compiled, no matter how.
Thank you Jon for your advice.

Jon Schewe

unread,
Oct 23, 2012, 10:10:47 PM10/23/12
to jenkins...@googlegroups.com
If you'd like I can send you my Makefile skeleton for building Qt applications.

mrz

unread,
Oct 24, 2012, 2:29:17 AM10/24/12
to jenkins...@googlegroups.com
I would be very thankful if you do so. But my problem is not with the make file itself.

I have two projects say A and B, which A is dependent to B.
In the .pro file I introduce the dependency in the projects and in .pri file I present the path that makefile should look for the .so file. But if I dont make install B after wmake, the .so file wont be in the right place.
Therefore,  in my Job configuration in Jenkins for build environment, I added an execute shell after qmakebuilder plugin to make install the project, but after qmakebuilder is finished with the job, it exits the directory, which cause make install do nothing. I can of course cd to the directory, but I would like to avoid hardcoding stuff as much as possible (should do it for different jobs, different directory).

Hope the explanation was clear.
Thank you once again Jon.
Reply all
Reply to author
Forward
0 new messages