Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How to add a resource directory?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alexis  
View profile  
 More options Jul 10 2007, 11:08 am
From: Alexis <alexismi...@gmail.com>
Date: Tue, 10 Jul 2007 15:08:57 -0000
Local: Tues, Jul 10 2007 11:08 am
Subject: How to add a resource directory?

Hey guys,

for some reasons I'd like to keep my hbm files in a separate
directory.
So I need to add src/main/hbm to the list of resources.

The only way I found to do so is:

resources {|t|filter(_("src/main/hbm")).into(compile.target).run}

not really neat, but the filter instance hold by the 'resource' task
is bound to single directory (@source).

I'd just like to ask if there is a better way.

Thanks in advance,

Alexis


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Assaf Arkin  
View profile  
 More options Jul 10 2007, 1:59 pm
From: "Assaf Arkin" <as...@labnotes.org>
Date: Tue, 10 Jul 2007 10:59:04 -0700
Local: Tues, Jul 10 2007 1:59 pm
Subject: Re: How to add a resource directory?

On 7/10/07, Alexis <alexismi...@gmail.com> wrote:

Hopefully. This came up before, I had some ideas, and want to share it with
you and see what you all think.

Option 1, we can use the include method to add another source directory, so
you can do:

resources.include _("src/main/hbm")

That will copy the contents of the hbm directory into target/classes, and
most times will do the right thing. But there is no way to copy a directory
into target/classes, if you wanted to do something like
resources.include_("src/images") it will copy the image files, not the
images directory.
You'd have to use the longer filter ... run for this.

Option 2, you need to copy files individually, so:

resources.include _("src/main/hbm/*")

Which unfortunately won't work some of the time. It will look for files in
the hbm directory, but if the hbm directory doesn't already exist, it won't
find any, and since hbm is not a target, it will not execute any task to
create them. This will just be frustrating to use.

Option 3, add additional source directories using from, so:

resources.from _("src/main/hbm")

On the face of it, it looks similar to option 1, but there's a subtle
difference in the way include/exclude are used. In option 1, include/exclude
must point to the actual files (absolute paths) being included, excluded.
Say I only want to copy jpg files (and skip png files). For option 1:

resources.include( _("src/images") ).exclude( _("src/images/**/*.png") )

For option 3:

resources.from( _("src/images") ).include("**/*.jpg")

(or exclude("**/*.png")

I'm leaning towards option 3 that will allow resources to copy files from
more source directories, and retain the relative path include/exclude
options.

What do you think?

Assaf

Thanks in advance,


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alexis  
View profile  
 More options Jul 11 2007, 6:37 am
From: Alexis <alexismi...@gmail.com>
Date: Wed, 11 Jul 2007 10:37:38 -0000
Local: Wed, Jul 11 2007 6:37 am
Subject: Re: How to add a resource directory?
Option 3 is exactly what I was looking for yesterday.
In my opinion, this is the most comprehensible solution.

I like the way the resource directory is clearly identified with the
'from' method.
Chained with include/exclude, it avoids ambiguity about the filter
root directory.

On Jul 10, 7:59 pm, "Assaf Arkin" <a...@labnotes.org> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Caleb Powell  
View profile  
 More options Jul 11 2007, 8:59 am
From: Caleb Powell <caleb.pow...@gmail.com>
Date: Wed, 11 Jul 2007 12:59:35 -0000
Local: Wed, Jul 11 2007 8:59 am
Subject: Re: How to add a resource directory?
I was dealing with this problem as well, and I think option 3 is the
way to go. Just out of curiosity, if the include/exclude
methods are not invoked, will all of the resources from the dir be
copied by default?

For example;

resources.from( _("src-test") )

will Buildr recurse through the child directories of src-test and
include all of the resources by default?

On Jul 11, 6:37 am, Alexis <alexismi...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anatol Pomozov  
View profile  
 More options Jul 11 2007, 9:24 am
From: Anatol Pomozov <anatol.pomo...@gmail.com>
Date: Wed, 11 Jul 2007 13:24:10 -0000
Local: Wed, Jul 11 2007 9:24 am
Subject: Re: How to add a resource directory?
I guess it should.

For example I keep all my resources (spring, hibernate config etc.) in
_("src/main/java") and as for me most intuitive way to add resource
directory would be

 resources.from( _("src/main/java") ).exclude("*.java") #copies all
files (except source files) to _("target/classes")

On Jul 11, 4:59 pm, Caleb Powell <caleb.pow...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthieu Riou  
View profile  
 More options Jul 11 2007, 9:31 am
From: "Matthieu Riou" <matthieu.r...@gmail.com>
Date: Wed, 11 Jul 2007 06:31:33 -0700
Local: Wed, Jul 11 2007 9:31 am
Subject: Re: How to add a resource directory?

+1 (non binding) for option 3. Getting voteholic.

On 7/11/07, Anatol Pomozov <anatol.pomo...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Assaf Arkin  
View profile  
 More options Jul 11 2007, 1:07 pm
From: "Assaf Arkin" <as...@labnotes.org>
Date: Wed, 11 Jul 2007 10:07:23 -0700
Local: Wed, Jul 11 2007 1:07 pm
Subject: Re: How to add a resource directory?

On 7/11/07, Caleb Powell <caleb.pow...@gmail.com> wrote:

> I was dealing with this problem as well, and I think option 3 is the
> way to go. Just out of curiosity, if the include/exclude
> methods are not invoked, will all of the resources from the dir be
> copied by default?

I still have your e-mail, but I had to mentally work through all the
combinations so it got pushed to after 1.2.

If you don't tell it which files to include, it defaults to "*", which
processes all the files/directories in the source directory, and does so
recursively. There's a default exclusion pattern, so it will always exclude
the .svn and CVS directories, and all files ending with *.bak or ~.

The include/exclude pattern applies to all the source directories. In fact,
the default behavior would just look for the src/main/resources directory,
and if it exists, call from with it once for the resources task.

Assaf

For example;


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Caleb Powell  
View profile  
 More options Jul 11 2007, 6:59 pm
From: Caleb Powell <caleb.pow...@gmail.com>
Date: Wed, 11 Jul 2007 22:59:40 -0000
Local: Wed, Jul 11 2007 6:59 pm
Subject: Re: How to add a resource directory?
That sounds perfect.

On Jul 11, 1:07 pm, "Assaf Arkin" <a...@labnotes.org> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Assaf Arkin  
View profile  
 More options Jul 12 2007, 8:15 pm
From: "Assaf Arkin" <as...@labnotes.org>
Date: Thu, 12 Jul 2007 17:15:58 -0700
Local: Thurs, Jul 12 2007 8:15 pm
Subject: Re: How to add a resource directory?

Now in SVN, and shortly in Buildr 1.2.1

Assaf

On 7/11/07, Caleb Powell <caleb.pow...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google