Re: Writing a plugin

Dan Rollo <[email protected]>
Newsgroups gmane.comp.java.cruise-control.user
Message-ID <[email protected]>
Hi Mark,

It seems like you have "registered" your custom "CCReporter" plugin 
correctly.

Could you run CC with the -debug switch, and post the stack traces?

Dan

PS: Please feel free to also post any documentation changes that would 
help improve things as well. One is only new to this stuff once, but 
soon thereafter we quickly start making inaccurate assumptions about 
what is clear, and what is not... So please capture any problem areas 
and post what you can now (before it all becomes easy for you) ;) Thanks!



http://cruisecontrol.sourceforge.net/distributed/index.html#registerDistributedPlugin

Date: Mon, 9 May 2011 12:58:52 -1000
From: Mark Boon <[email protected]>
Subject: [Cruisecontrol-user] Writing a plugin
To: [email protected]

I'd be extremely interested in writing a CruiseControl plugin. But 
unfortunately the information available on the web-site is rather 
meager. ( 
http://cruisecontrol.sourceforge.net/main/plugins.html#defaultregistry )

As a first attempt I'm just trying to make something print something on 
the screen when a build finishes. But even that simple task I didn't 
manage, simply because CC doesn't let me insert my own tags. For example 
I have the following config.xml:

<cruisecontrol>
     <project name="connectfour">

	<plugin name="CCReporter" classname="com.bps.cc.CCReporter"/>

         <listeners>
             <currentbuildstatuslistener 
file="logs/${project.name}/status.txt"/>
         </listeners>

         <bootstrappers>
             <antbootstrapper anthome="apache-ant-1.7.0" 
buildfile="projects/${project.name}/build.xml" target="clean" />
         </bootstrappers>

         <modificationset quietperiod="30">
             <!-- touch any file in connectfour project to trigger a 
build -->
             <filesystem folder="projects/${project.name}"/>
         </modificationset>

         <schedule interval="300">
             <ant anthome="apache-ant-1.7.0" 
buildfile="projects/${project.name}/build.xml"/>
         </schedule>

         <log>
             <merge dir="projects/${project.name}/target/test-results"/>
         </log>

         <publishers>
		<CCReporter/>
             <onsuccess>
                 <artifactspublisher dest="artifacts/${project.name}" 
file="projects/${project.name}/target/${project.name}.jar"/>
             </onsuccess>
         </publishers>

     </project>
</cruisecontrol>

and when I start CC it says:
net.sourceforge.cruisecontrol.CruiseControlException: Nested element: 
'CCReporter' is not supported for the <publishers> tag.

Same if I stick it in the <onsuccess> element.

So I'm confused, how can one make plugins if the config XML is 
restricted to a predefined set of tags?

And if it is predefined, would there be some sort of XSD file that I 
could modify to add it in? Although that would be ugly, that would at 
least make me get around it.

Mark



------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.