You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by "Karl Trygve Kalleberg (JIRA)" <ji...@apache.org> on 2010/07/05 12:28:50 UTC

[jira] Issue Comment Edited: (BUILDR-338) For Scala project, Idea module has incorrect path to Scala library jar

    [ https://issues.apache.org/jira/browse/BUILDR-338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885172#action_12885172 ] 

Karl Trygve Kalleberg edited comment on BUILDR-338 at 7/5/10 6:28 AM:
----------------------------------------------------------------------

Fortunately, this is trivial to fix.

In the file /var/lib/gems/1.8/gems/buildr-1.4.0/lib/buildr/ide/idea.rb,

The code around line 193 should rather read:

               # Libraries
                ext_libs = libs.map {|path| "$MODULE_DIR$/#{relative[path.to_s]}" } +
                    m2_libs.map { |path| path.to_s.sub(m2repo, "$M2_REPO$") }

I.e., by applying the relative[] lambda defined earlier in idea.rb, to all non-M2_REPO imports, the Scala libraries will be imported correctly, e.g.:

        <CLASSES>
          <root url="jar://$MODULE_DIR$/../../../../apps/scala-2.8.0-rc7/lib/scala-library.jar!/"/>
        </CLASSES>

I hope this trivial fix can make it into 1.4.1:)


      was (Author: karltk):
    Fortunately, this is trivial to fix.

In the file /var/lib/gems/1.8/gems/buildr-1.4.0/lib/buildr/ide/idea.rb,

The code around line 193 should rather read:

               # Libraries
                ext_libs = libs.map {|path| "$MODULE_DIR$/#{relative[path.to_s]}" } +
                    m2_libs.map { |path| path.to_s.sub(m2repo, "$M2_REPO$") }

I.e., by applying the relative[] lambda further up to all non-M2_REPO imports, the Scala libraries will be imported correct, e.g.:

        <CLASSES>
          <root url="jar://$MODULE_DIR$/../../../../apps/scala-2.8.0-rc7/lib/scala-library.jar!/"/>
        </CLASSES>

I hope this trivial fix can make it into 1.4.1:)

  
> For Scala project, Idea module has incorrect path to Scala library jar 
> -----------------------------------------------------------------------
>
>                 Key: BUILDR-338
>                 URL: https://issues.apache.org/jira/browse/BUILDR-338
>             Project: Buildr
>          Issue Type: Bug
>          Components: IDE
>    Affects Versions: 1.3.5
>            Reporter: Alex Eagle
>
> After running `buildr idea`, I get a module file that includes the scala-library.jar and scala-compiler.jar. I didn't list those as dependencies of my project, but I do require buildr/scala, so it makes sense that these are automatically added to the dependency list internally in buildr in order to compile my project.
> But, in my resulting iml file, the dependencies look like this:
>    <orderEntry type="module-library">
>       <library>
>         <CLASSES>
>           <root url="jar://$MODULE_DIR$//Users/alexeagle/projects/scala-2.7.5.final/lib/scala-library.jar!/" /
> >
>         </CLASSES>
>         <JAVADOC />
>         <SOURCES>
>           <root url="jar://$MODULE_DIR$//Users/alexeagle/projects/scala-2.7.5.final/lib/scala-library-sources.
> jar!/" />
>         </SOURCES>
>       </library>
>     </orderEntry>
>     <orderEntry type="module-library">
>       <library>
>         <CLASSES>
>           <root url="jar://$MODULE_DIR$//Users/alexeagle/projects/scala-2.7.5.final/lib/scala-compiler.jar!/" 
> />
>         </CLASSES>
>         <JAVADOC />
>         <SOURCES>
>           <root url="jar://$MODULE_DIR$//Users/alexeagle/projects/scala-2.7.5.final/lib/scala-compiler-sources
> .jar!/" />
>         </SOURCES>
>       </library>
>     </orderEntry>
> They have an absolute path based on my $SCALA_HOME, but these are incorrectly getting a prefix of $MODULE_DIR$.
> I'm marking it as major because I have to fix this manually every time I regenerate my project from a buildfile.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.