You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Jabbar <aj...@gmail.com> on 2008/01/17 16:38:43 UTC

buildr newbie.

Hello,

I would like to use buildr on one of my projects. But I am a bit
confused. I have a project which is called contacts which contains sub
projects entity, session and presentation.

Do I have to have one buildfile in the root of contacts, or do I have
to have a buildfile in the root of each subprojects directories. I
have read the documentation, but have found parts of it confusing. I
found the example buildfile in the projects section of the manual
confusing. It looks like all the information describing the project is
there, yet the documentation implies there are multiple build files.

The project contacts will be an ear project. I have already got a
build of buildr from yesterdays (16/1/2008) svn trunk, so I should be
able to try the ear stuff. It was fun trying to create a buildr
package on my windows box, NOT. Hopefully the effort will be worth it.
I didn't want to use Ant or Maven.

-- 
Thanks

 A Jabbar Azam

Re: buildr newbie.

Posted by Jabbar <aj...@gmail.com>.
Hello Victor,

I've managed to get the ear packaging stuff working now :)

Now the fun starts learning and integrating jee5 with tapestry 5.


Thanks for your ear task

On 17/01/2008, Victor Hugo Borja <vi...@gmail.com> wrote:
> Hello Jabbar,
>
> First of all, thanks for trying out buildr.
>
> I currently have a project using the EAR task, using a single buildfile and
> some subprojects,
> my directory structure is something like:
>
> my_project/
>      buildfile                                   #   A
> buildfile to rule them all, and in buildr bind them :)
>      tasks/ejb.rb                             #  My ejb
> task using xdoclet (still needs a lot of love to be integrated on buildr)
>      my_utils/
>         src/main/java                        #  Utility
> java code
>      my_model/
>         src/main/java                        # A Hibernate
> capable project, some hbm.xml and DAOs
>      my_ejb/
>         src/main/java                        #  Business
> implementation
>      my_webservice
>         src/main/java                        #  A
> webservice interface to my ejb
>
>
> My buildfile looks something *like* this:
> ------
> require File.expand_path('tasks/ejb', File.dirname(__FILE__)) # I've
> attached my current ejb task (it needs a lot of love to be integrated on
> buildr trunk)
>
> define 'my_utils' do
>    compile.with Jar(:spring, :commons_lang) # Jar is a custom function of
> mine that receives filters like regexps and returns artifacts matching it
>    package(:jar)
> end
>
> define 'my_model' do
>    compile.with Jar(:spring, :hibernate)
>    package(:jar)
> end
>
> define 'my_ejb' do
>       compile.with projects(:my_utils, :my_model), artifacts(:spring,
> :logging)
>       ejb = package(:ejb)  # use the attached ejb.rb
>       ejb.doclet_cp = Jar(/j2ee|xdoclet/, :weblogic)
>       ejb.doclet do |ant|
>         ant.packageSubstitution :packages => "ejb", :substituteWith => "
> ejb.iface"
>         ant.remoteinterface
>         ant.localinterface
>         ant.homeinterface
>         ant.localhomeinterface
>         ant.session
>         ant.deploymentdescriptor :destDir => ejb.doclet_meta , :validateXML
> => "true"
>         ant.weblogic :destDir => ejb.doclet_meta, :validateXML => "true",
>                      :version => "8.1", :createtables => "Disabled"
>      end
> end
>
> define 'my_webservice' do
>     package(:war)
> end
>
> define 'my_ear' do   #  I have a single project to produce the EAR
>     ear = package(:ear)
>     ear.push Jar(:spring, :hiberante),
>                   projects('my_utils', 'my_model'),
>                   project('my_webservice').package(:war)
>     ear.add :ejb => project('my_ejb').package(:jar)
> end
>
> ------
>
> When I run my_project:my_ear:package, it creates the ear archive under
> my_ear/target  directory.
>
> Don't expect the above code to run unmodified, It's just an example as I
> cannot copy the actual source files.
> I hope this clarifies things a bit.
>
> We apprecitate your interest in using buildr, and would like to hear
> comments about what parts you find confusing on the current documentation,
> and patches are welcome :).
>
> Happy buildring.
>
>
> On Jan 17, 2008 9:38 AM, Jabbar <aj...@gmail.com> wrote:
> > Hello,
> >
> > I would like to use buildr on one of my projects. But I am a bit
> > confused. I have a project which is called contacts which contains sub
> > projects entity, session and presentation.
> >
> > Do I have to have one buildfile in the root of contacts, or do I have
> > to have a buildfile in the root of each subprojects directories. I
> > have read the documentation, but have found parts of it confusing. I
> > found the example buildfile in the projects section of the manual
> > confusing. It looks like all the information describing the project is
> > there, yet the documentation implies there are multiple build files.
> >
> > The project contacts will be an ear project. I have already got a
> > build of buildr from yesterdays (16/1/2008) svn trunk, so I should be
> > able to try the ear stuff. It was fun trying to create a buildr
> > package on my windows box, NOT. Hopefully the effort will be worth it.
> > I didn't want to use Ant or Maven.
> >
> > --
> > Thanks
> >
> >  A Jabbar Azam
> >
>
>
>
> --
> Quaerendo invenietis.


-- 
Thanks

 A Jabbar Azam

Re: buildr newbie.

Posted by Victor Hugo Borja <vi...@gmail.com>.
Forgot to wrapp all my subprojects on

define 'my_project' do
   # All the subprojects here
end

Actually, on http://incubator.apache.org/buildr/projects.html, the
'killer-app' example is pretty clear, please prefer that as a guide.

On Jan 17, 2008 10:24 AM, Victor Hugo Borja <vi...@gmail.com> wrote:

> Hello Jabbar,
>
> First of all, thanks for trying out buildr.
>
> I currently have a project using the EAR task, using a single buildfile
> and some subprojects,
> my directory structure is something like:
>
> my_project/
>      buildfile                                   #   A buildfile to rule
> them all, and in buildr bind them :)
>      tasks/ejb.rb                             #  My ejb task using xdoclet
> (still needs a lot of love to be integrated on buildr)
>      my_utils/
>         src/main/java                        #  Utility java code
>      my_model/
>         src/main/java                        # A Hibernate capable
> project, some hbm.xml and DAOs
>      my_ejb/
>         src/main/java                        #  Business implementation
>      my_webservice
>         src/main/java                        #  A webservice interface to
> my ejb
>
>
> My buildfile looks something *like* this:
> ------
> require File.expand_path('tasks/ejb', File.dirname(__FILE__)) # I've
> attached my current ejb task (it needs a lot of love to be integrated on
> buildr trunk)
>
> define 'my_utils' do
>    compile.with Jar(:spring, :commons_lang) # Jar is a custom function of
> mine that receives filters like regexps and returns artifacts matching it
>    package(:jar)
> end
>
> define 'my_model' do
>    compile.with Jar(:spring, :hibernate)
>    package(:jar)
> end
>
> define 'my_ejb' do
>       compile.with projects(:my_utils, :my_model), artifacts(:spring,
> :logging)
>       ejb = package(:ejb)  # use the attached ejb.rb
>       ejb.doclet_cp = Jar(/j2ee|xdoclet/, :weblogic)
>       ejb.doclet do |ant|
>         ant.packageSubstitution :packages => "ejb", :substituteWith => "
> ejb.iface"
>         ant.remoteinterface
>         ant.localinterface
>         ant.homeinterface
>         ant.localhomeinterface
>         ant.session
>         ant.deploymentdescriptor :destDir => ejb.doclet_meta ,
> :validateXML => "true"
>         ant.weblogic :destDir => ejb.doclet_meta, :validateXML => "true",
>                      :version => "8.1", :createtables => "Disabled"
>      end
> end
>
> define 'my_webservice' do
>     package(:war)
> end
>
> define 'my_ear' do   #  I have a single project to produce the EAR
>     ear = package(:ear)
>     ear.push Jar(:spring, :hiberante),
>                   projects('my_utils', 'my_model'),
>                   project('my_webservice').package(:war)
>     ear.add :ejb => project('my_ejb').package(:jar)
> end
>
> ------
>
> When I run my_project:my_ear:package, it creates the ear archive under
> my_ear/target  directory.
>
> Don't expect the above code to run unmodified, It's just an example as I
> cannot copy the actual source files.
> I hope this clarifies things a bit.
>
> We apprecitate your interest in using buildr, and would like to hear
> comments about what parts you find confusing on the current documentation,
> and patches are welcome :).
>
> Happy buildring.
>
>
> On Jan 17, 2008 9:38 AM, Jabbar <aj...@gmail.com> wrote:
>
> > Hello,
> >
> > I would like to use buildr on one of my projects. But I am a bit
> > confused. I have a project which is called contacts which contains sub
> > projects entity, session and presentation.
> >
> > Do I have to have one buildfile in the root of contacts, or do I have
> > to have a buildfile in the root of each subprojects directories. I
> > have read the documentation, but have found parts of it confusing. I
> > found the example buildfile in the projects section of the manual
> > confusing. It looks like all the information describing the project is
> > there, yet the documentation implies there are multiple build files.
> >
> > The project contacts will be an ear project. I have already got a
> > build of buildr from yesterdays (16/1/2008) svn trunk, so I should be
> > able to try the ear stuff. It was fun trying to create a buildr
> > package on my windows box, NOT. Hopefully the effort will be worth it.
> > I didn't want to use Ant or Maven.
> >
> > --
> > Thanks
> >
> >  A Jabbar Azam
> >
>
>
>
> --
> Quaerendo invenietis.




-- 
Quaerendo invenietis.

Re: buildr newbie.

Posted by Assaf Arkin <ar...@intalio.com>.
On 1/17/08, Jabbar <aj...@gmail.com> wrote:
>
> Hello Victor,
>
> Thanks for your information. I will create my project file tonight.
>
> The aspects of the documentation I found confusing was projects,
> subprojects and the buildfile. In Maven if you work on a multi module
> project, each project and module has it's own pom. Buildr is a
> replacement for Maven and hence I assumed each subproject had to have
> it's own buildfile.
>
> In your example code am I right to assume the following code in the
> buildfile is the definition for the 'my_webservice' sub project in the
> directory 'my_webservice'
>
> define 'my_webservice' do
>     package(:war)
> end


Actually, this defines a project called 'my_webservice' that will build from
the root directory, the same one containing the Buildfile.  If you have a
bunch of sub-projects in sub-directories, you will probably want to collect
them into a larger project, for example:

define 'my_app' do
  define 'beans' do
    package(:jar)
  end

  define 'webservice' do
    package(:war).with(project('beans'))
  end
end

This assumes you have one root directory which contains the Buildfile, and
two sub-directories called beans and webservice.  But you can always direct
a project definition to look in a given directory:

define 'webservice', :base_dir=>'ws' do
end

Assaf

On 17/01/2008, Victor Hugo Borja <vi...@gmail.com> wrote:
> > Hello Jabbar,
> >
> > First of all, thanks for trying out buildr.
> >
> > I currently have a project using the EAR task, using a single buildfile
> and
> > some subprojects,
> > my directory structure is something like:
> >
> > my_project/
> >      buildfile                                   #   A
> > buildfile to rule them all, and in buildr bind them :)
> >      tasks/ejb.rb                             #  My ejb
> > task using xdoclet (still needs a lot of love to be integrated on
> buildr)
> >      my_utils/
> >         src/main/java                        #  Utility
> > java code
> >      my_model/
> >         src/main/java                        # A Hibernate
> > capable project, some hbm.xml and DAOs
> >      my_ejb/
> >         src/main/java                        #  Business
> > implementation
> >      my_webservice
> >         src/main/java                        #  A
> > webservice interface to my ejb
> >
> >
> >  My buildfile looks something *like* this:
> > ------
> > require File.expand_path('tasks/ejb', File.dirname(__FILE__)) # I've
> > attached my current ejb task (it needs a lot of love to be integrated on
> > buildr trunk)
> >
> > define 'my_utils' do
> >    compile.with Jar(:spring, :commons_lang) # Jar is a custom function
> of
> > mine that receives filters like regexps and returns artifacts matching
> it
> >    package(:jar)
> > end
> >
> >  define 'my_model' do
> >    compile.with Jar(:spring, :hibernate)
> >    package(:jar)
> > end
> >
> > define 'my_ejb' do
> >       compile.with projects(:my_utils, :my_model), artifacts(:spring,
> > :logging)
> >        ejb = package(:ejb)  # use the attached ejb.rb
> >       ejb.doclet_cp = Jar(/j2ee|xdoclet/, :weblogic)
> >       ejb.doclet do |ant|
> >         ant.packageSubstitution :packages => "ejb", :substituteWith => "
> > ejb.iface"
> >         ant.remoteinterface
> >         ant.localinterface
> >         ant.homeinterface
> >         ant.localhomeinterface
> >         ant.session
> >         ant.deploymentdescriptor :destDir => ejb.doclet_meta ,
> :validateXML
> > => "true"
> >         ant.weblogic :destDir => ejb.doclet_meta, :validateXML =>
> "true",
> >                      :version => "8.1", :createtables => "Disabled"
> >      end
> > end
> >
> > define 'my_webservice' do
> >     package(:war)
> > end
> >
> > define 'my_ear' do   #  I have a single project to produce the EAR
> >     ear = package(:ear)
> >     ear.push Jar(:spring, :hiberante),
> >                   projects('my_utils', 'my_model'),
> >                   project('my_webservice').package(:war)
> >     ear.add :ejb => project('my_ejb').package(:jar)
> > end
> >
> > ------
> >
> > When I run my_project:my_ear:package, it creates the ear archive under
> > my_ear/target  directory.
> >
> > Don't expect the above code to run unmodified, It's just an example as I
> > cannot copy the actual source files.
> > I hope this clarifies things a bit.
> >
> > We apprecitate your interest in using buildr, and would like to hear
> > comments about what parts you find confusing on the current
> documentation,
> > and patches are welcome :).
> >
> > Happy buildring.
> >
> >
> > On Jan 17, 2008 9:38 AM, Jabbar <aj...@gmail.com> wrote:
> > > Hello,
> > >
> > > I would like to use buildr on one of my projects. But I am a bit
> > > confused. I have a project which is called contacts which contains sub
> > > projects entity, session and presentation.
> > >
> > > Do I have to have one buildfile in the root of contacts, or do I have
> > > to have a buildfile in the root of each subprojects directories. I
> > > have read the documentation, but have found parts of it confusing. I
> > > found the example buildfile in the projects section of the manual
> > > confusing. It looks like all the information describing the project is
> > > there, yet the documentation implies there are multiple build files.
> > >
> > > The project contacts will be an ear project. I have already got a
> > > build of buildr from yesterdays (16/1/2008) svn trunk, so I should be
> > > able to try the ear stuff. It was fun trying to create a buildr
> > > package on my windows box, NOT. Hopefully the effort will be worth it.
> > > I didn't want to use Ant or Maven.
> > >
> > > --
> > > Thanks
> > >
> > >  A Jabbar Azam
> > >
> >
> >
> >
> > --
> > Quaerendo invenietis.
>
>
> --
> Thanks
>
> A Jabbar Azam
>



-- 
CTO, Intalio
http://www.intalio.com

Re: buildr newbie.

Posted by Victor Hugo Borja <vi...@gmail.com>.
> In your example code am I right to assume the following code in the
> buildfile is the definition for the 'my_webservice' sub project in the
> directory 'my_webservice'
>
> define 'my_webservice' do
>    package(:war)
> end
>
>
That's right, that defines the 'my_webservice' subdirectory as a subproject.

-- 
Quaerendo invenietis.

Re: buildr newbie.

Posted by Jabbar <aj...@gmail.com>.
Hello Victor,

Thanks for your information. I will create my project file tonight.

The aspects of the documentation I found confusing was projects,
subprojects and the buildfile. In Maven if you work on a multi module
project, each project and module has it's own pom. Buildr is a
replacement for Maven and hence I assumed each subproject had to have
it's own buildfile.

In your example code am I right to assume the following code in the
buildfile is the definition for the 'my_webservice' sub project in the
directory 'my_webservice'

define 'my_webservice' do
    package(:war)
end


On 17/01/2008, Victor Hugo Borja <vi...@gmail.com> wrote:
> Hello Jabbar,
>
> First of all, thanks for trying out buildr.
>
> I currently have a project using the EAR task, using a single buildfile and
> some subprojects,
> my directory structure is something like:
>
> my_project/
>      buildfile                                   #   A
> buildfile to rule them all, and in buildr bind them :)
>      tasks/ejb.rb                             #  My ejb
> task using xdoclet (still needs a lot of love to be integrated on buildr)
>      my_utils/
>         src/main/java                        #  Utility
> java code
>      my_model/
>         src/main/java                        # A Hibernate
> capable project, some hbm.xml and DAOs
>      my_ejb/
>         src/main/java                        #  Business
> implementation
>      my_webservice
>         src/main/java                        #  A
> webservice interface to my ejb
>
>
>  My buildfile looks something *like* this:
> ------
> require File.expand_path('tasks/ejb', File.dirname(__FILE__)) # I've
> attached my current ejb task (it needs a lot of love to be integrated on
> buildr trunk)
>
> define 'my_utils' do
>    compile.with Jar(:spring, :commons_lang) # Jar is a custom function of
> mine that receives filters like regexps and returns artifacts matching it
>    package(:jar)
> end
>
>  define 'my_model' do
>    compile.with Jar(:spring, :hibernate)
>    package(:jar)
> end
>
> define 'my_ejb' do
>       compile.with projects(:my_utils, :my_model), artifacts(:spring,
> :logging)
>        ejb = package(:ejb)  # use the attached ejb.rb
>       ejb.doclet_cp = Jar(/j2ee|xdoclet/, :weblogic)
>       ejb.doclet do |ant|
>         ant.packageSubstitution :packages => "ejb", :substituteWith => "
> ejb.iface"
>         ant.remoteinterface
>         ant.localinterface
>         ant.homeinterface
>         ant.localhomeinterface
>         ant.session
>         ant.deploymentdescriptor :destDir => ejb.doclet_meta , :validateXML
> => "true"
>         ant.weblogic :destDir => ejb.doclet_meta, :validateXML => "true",
>                      :version => "8.1", :createtables => "Disabled"
>      end
> end
>
> define 'my_webservice' do
>     package(:war)
> end
>
> define 'my_ear' do   #  I have a single project to produce the EAR
>     ear = package(:ear)
>     ear.push Jar(:spring, :hiberante),
>                   projects('my_utils', 'my_model'),
>                   project('my_webservice').package(:war)
>     ear.add :ejb => project('my_ejb').package(:jar)
> end
>
> ------
>
> When I run my_project:my_ear:package, it creates the ear archive under
> my_ear/target  directory.
>
> Don't expect the above code to run unmodified, It's just an example as I
> cannot copy the actual source files.
> I hope this clarifies things a bit.
>
> We apprecitate your interest in using buildr, and would like to hear
> comments about what parts you find confusing on the current documentation,
> and patches are welcome :).
>
> Happy buildring.
>
>
> On Jan 17, 2008 9:38 AM, Jabbar <aj...@gmail.com> wrote:
> > Hello,
> >
> > I would like to use buildr on one of my projects. But I am a bit
> > confused. I have a project which is called contacts which contains sub
> > projects entity, session and presentation.
> >
> > Do I have to have one buildfile in the root of contacts, or do I have
> > to have a buildfile in the root of each subprojects directories. I
> > have read the documentation, but have found parts of it confusing. I
> > found the example buildfile in the projects section of the manual
> > confusing. It looks like all the information describing the project is
> > there, yet the documentation implies there are multiple build files.
> >
> > The project contacts will be an ear project. I have already got a
> > build of buildr from yesterdays (16/1/2008) svn trunk, so I should be
> > able to try the ear stuff. It was fun trying to create a buildr
> > package on my windows box, NOT. Hopefully the effort will be worth it.
> > I didn't want to use Ant or Maven.
> >
> > --
> > Thanks
> >
> >  A Jabbar Azam
> >
>
>
>
> --
> Quaerendo invenietis.


-- 
Thanks

 A Jabbar Azam

Re: buildr newbie.

Posted by Victor Hugo Borja <vi...@gmail.com>.
Hello Jabbar,

First of all, thanks for trying out buildr.

I currently have a project using the EAR task, using a single buildfile and
some subprojects,
my directory structure is something like:

my_project/
     buildfile                                   #   A buildfile to rule
them all, and in buildr bind them :)
     tasks/ejb.rb                             #  My ejb task using xdoclet
(still needs a lot of love to be integrated on buildr)
     my_utils/
        src/main/java                        #  Utility java code
     my_model/
        src/main/java                        # A Hibernate capable project,
some hbm.xml and DAOs
     my_ejb/
        src/main/java                        #  Business implementation
     my_webservice
        src/main/java                        #  A webservice interface to my
ejb


My buildfile looks something *like* this:
------
require File.expand_path('tasks/ejb', File.dirname(__FILE__)) # I've
attached my current ejb task (it needs a lot of love to be integrated on
buildr trunk)

define 'my_utils' do
   compile.with Jar(:spring, :commons_lang) # Jar is a custom function of
mine that receives filters like regexps and returns artifacts matching it
   package(:jar)
end

define 'my_model' do
   compile.with Jar(:spring, :hibernate)
   package(:jar)
end

define 'my_ejb' do
      compile.with projects(:my_utils, :my_model), artifacts(:spring,
:logging)
      ejb = package(:ejb)  # use the attached ejb.rb
      ejb.doclet_cp = Jar(/j2ee|xdoclet/, :weblogic)
      ejb.doclet do |ant|
        ant.packageSubstitution :packages => "ejb", :substituteWith => "
ejb.iface"
        ant.remoteinterface
        ant.localinterface
        ant.homeinterface
        ant.localhomeinterface
        ant.session
        ant.deploymentdescriptor :destDir => ejb.doclet_meta, :validateXML
=> "true"
        ant.weblogic :destDir => ejb.doclet_meta, :validateXML => "true",
                     :version => "8.1", :createtables => "Disabled"
     end
end

define 'my_webservice' do
    package(:war)
end

define 'my_ear' do   #  I have a single project to produce the EAR
    ear = package(:ear)
    ear.push Jar(:spring, :hiberante),
                  projects('my_utils', 'my_model'),
                  project('my_webservice').package(:war)
    ear.add :ejb => project('my_ejb').package(:jar)
end

------

When I run my_project:my_ear:package, it creates the ear archive under
my_ear/target  directory.

Don't expect the above code to run unmodified, It's just an example as I
cannot copy the actual source files.
I hope this clarifies things a bit.

We apprecitate your interest in using buildr, and would like to hear
comments about what parts you find confusing on the current documentation,
and patches are welcome :).

Happy buildring.

On Jan 17, 2008 9:38 AM, Jabbar <aj...@gmail.com> wrote:

> Hello,
>
> I would like to use buildr on one of my projects. But I am a bit
> confused. I have a project which is called contacts which contains sub
> projects entity, session and presentation.
>
> Do I have to have one buildfile in the root of contacts, or do I have
> to have a buildfile in the root of each subprojects directories. I
> have read the documentation, but have found parts of it confusing. I
> found the example buildfile in the projects section of the manual
> confusing. It looks like all the information describing the project is
> there, yet the documentation implies there are multiple build files.
>
> The project contacts will be an ear project. I have already got a
> build of buildr from yesterdays (16/1/2008) svn trunk, so I should be
> able to try the ear stuff. It was fun trying to create a buildr
> package on my windows box, NOT. Hopefully the effort will be worth it.
> I didn't want to use Ant or Maven.
>
> --
> Thanks
>
>  A Jabbar Azam
>



-- 
Quaerendo invenietis.