Buildr for building osgi plugins.

View: New views
2 Messages — Rating Filter:   Alert me  

Buildr for building osgi plugins.

by Ketan Padegaonkar-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Apologies for the cross post. But I thought this would be a good
extension to buildr so I'm posting to the user and dev lists.

I'm attempting to build eclipse plugins using buildr. Eclipse plugins
follow slightly different conventions from the others, and I'm stuck not
being able to figure things on my own.

Here's what my project structure looks like:

org.eclipse.swt.examples/src

net.sf.swtbot.finder/src
net.sf.swtbot.finder.test/src

As you can see, the test folder is actually a different project, and I'm
attempting to hack into buildr to add support for this kind of a
configuration. I've created two different layouts for the different
kinds of plugins as described above:

class SimplePluginLayout < Layout
   def initialize
     super
     self[:source, :main, :java] = 'src'
     self[:source, :main, :resources] = 'src'
   end
end

class PluginWithTestLayout < Layout
   def initialize plugin_id
     super()
     self[:source, :main, :java] = 'src'
     self[:source, :main, :resources] = 'src'

     self[:source, :test, :java] = '../#{plugin_id}.test/src'
     self[:source, :test, :resources] = '../#{plugin_id}.test/src'
   end
end

I've also defined projects as follows:


define "org.eclipse.swt.examples", :layout=>SimplePluginLayout do
...
end


define "net.sf.swtbot.finder",
:layout=>PluginWithTestLayout.new("net.sf.swtbot.finder") do
...
end

define "net.sf.swtbot.finder",
:layout=>PluginWithTestLayout.new("net.sf.swtbot.finder") do
...
end

What's interesting is that running the "package" task seems to package
the projects into proper jars, but running tests does not execute the
tests, as the layout does not seem to find the tests.

Is there something that I'm doing wrong ?

-- Ketan




Re: Buildr for building osgi plugins.

by Assaf Arkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 14, 2008 at 9:52 AM, Ketan Padegaonkar
<ketanpadegaonkar@...> wrote:

> Hi,
>
> Apologies for the cross post. But I thought this would be a good extension
> to buildr so I'm posting to the user and dev lists.
>
> I'm attempting to build eclipse plugins using buildr. Eclipse plugins follow
> slightly different conventions from the others, and I'm stuck not being able
> to figure things on my own.
>
> Here's what my project structure looks like:
>
> org.eclipse.swt.examples/src
>
> net.sf.swtbot.finder/src
> net.sf.swtbot.finder.test/src
>
> As you can see, the test folder is actually a different project, and I'm
> attempting to hack into buildr to add support for this kind of a
> configuration. I've created two different layouts for the different kinds of
> plugins as described above:
>
> class SimplePluginLayout < Layout
>  def initialize
>    super
>    self[:source, :main, :java] = 'src'
>    self[:source, :main, :resources] = 'src'
>  end
> end
>
> class PluginWithTestLayout < Layout
>  def initialize plugin_id
>    super()
>    self[:source, :main, :java] = 'src'
>    self[:source, :main, :resources] = 'src'
>
>    self[:source, :test, :java] = '../#{plugin_id}.test/src'
>    self[:source, :test, :resources] = '../#{plugin_id}.test/src'
>  end
> end
>
> I've also defined projects as follows:
>
>
> define "org.eclipse.swt.examples", :layout=>SimplePluginLayout do
> ...
> end
>
>
> define "net.sf.swtbot.finder",
> :layout=>PluginWithTestLayout.new("net.sf.swtbot.finder") do
> ...
> end
>
> define "net.sf.swtbot.finder",
> :layout=>PluginWithTestLayout.new("net.sf.swtbot.finder") do
> ...
> end
>
> What's interesting is that running the "package" task seems to package the
> projects into proper jars, but running tests does not execute the tests, as
> the layout does not seem to find the tests.
>
> Is there something that I'm doing wrong ?

"../#{plugin_id}.test/src"

single quotes are taken literally, double quotes do the extra
processing which will expand #{plugin_id}.

Assaf

>
> -- Ketan
>
>
>
>