You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Karl Trygve Kalleberg <ka...@quantility.org> on 2010/07/05 11:52:54 UTC

Removing toplevel prefix from the generated IntelliJ IDEA .iml files

Hi gang,

I've been browsing the online docs, the API docs and also looked at
the IDEA buildr source code a bit, but if the answer was right there
in my face, I didn't see it...

I have a toplevel Buildfile in project foo, and a few subjects, say
bar and baz. Inside baz/, I do buildr idea, and the file foo-bar.iml
is generated. However, I want this file to be named bar.iml, i.e.
without the toplevel prefix "foo-".

In /var/lib/gems/1.8/gems/buildr-1.4.0/lib/buildr/ide/idea.rb, I found the line

 task_name = project.path_to("#{project.name.gsub(':', '-')}.iml")

which leads me to think that my desires are (i) unreasonable or (ii)
reasonable, but not supported.

Is there a way to (temporarily) change the project.name for just the
idea target?


-- Karl T

Re: Removing toplevel prefix from the generated IntelliJ IDEA .iml files

Posted by Peter Donald <pe...@realityforge.org>.
Hi,

You may want to check out buildr-iidea [1] which is an enhanced suite
of task to generate IDEA project files. It can be configured to do
what you want and much more besides that. If you try it out and find
anything missing then drop me a line.

[1] http://github.com/realityforge/buildr-iidea

On Mon, Jul 5, 2010 at 7:52 PM, Karl Trygve Kalleberg
<ka...@quantility.org> wrote:
> Hi gang,
>
> I've been browsing the online docs, the API docs and also looked at
> the IDEA buildr source code a bit, but if the answer was right there
> in my face, I didn't see it...
>
> I have a toplevel Buildfile in project foo, and a few subjects, say
> bar and baz. Inside baz/, I do buildr idea, and the file foo-bar.iml
> is generated. However, I want this file to be named bar.iml, i.e.
> without the toplevel prefix "foo-".
>
> In /var/lib/gems/1.8/gems/buildr-1.4.0/lib/buildr/ide/idea.rb, I found the line
>
>  task_name = project.path_to("#{project.name.gsub(':', '-')}.iml")
>
> which leads me to think that my desires are (i) unreasonable or (ii)
> reasonable, but not supported.
>
> Is there a way to (temporarily) change the project.name for just the
> idea target?

-- 
Cheers,

Peter Donald

Re: Removing toplevel prefix from the generated IntelliJ IDEA .iml files

Posted by Rhett Sutphin <rh...@detailedbalance.net>.
Hi Karl,

On Jul 5, 2010, at 4:52 AM, Karl Trygve Kalleberg wrote:

> Hi gang,
> 
> I've been browsing the online docs, the API docs and also looked at
> the IDEA buildr source code a bit, but if the answer was right there
> in my face, I didn't see it...
> 
> I have a toplevel Buildfile in project foo, and a few subjects, say
> bar and baz. Inside baz/, I do buildr idea, and the file foo-bar.iml
> is generated. However, I want this file to be named bar.iml, i.e.
> without the toplevel prefix "foo-".

This is the default behavior for the buildr-iidea plugin, which is a third-party replacement for the built-in idea and idea7x tasks:

http://github.com/realityforge/buildr-iidea

If you are using buildr-iidea, you can also control the name for a particular project like so:

define "foo" do
  define "bar" do
    iml.id = "not-bar"
  end
end

In this situation, the IML for bar would be named not-bar.iml.

Rhett

> 
> In /var/lib/gems/1.8/gems/buildr-1.4.0/lib/buildr/ide/idea.rb, I found the line
> 
> task_name = project.path_to("#{project.name.gsub(':', '-')}.iml")
> 
> which leads me to think that my desires are (i) unreasonable or (ii)
> reasonable, but not supported.
> 
> Is there a way to (temporarily) change the project.name for just the
> idea target?
> 
> 
> -- Karl T