On Wed, Jul 22, 2009 at 7:00 PM, Josh Suereth <joshua.suer...@gmail.com>wrote:

> Hey, I just go this email.  I'll make the patch and commit shortly.  Thanks
> for the submission!
>
> There's still some mismatch since we re-built the scala-tools.org server,
> so the maven-scala-plugin nightlies are not getting published.  I'm going to
> try to resolve that shortly.
>
> - Josh


Thanks very much! Please adjust the code style as you see fit. I'm not sure
whether it's worth reusing the addToClasspath() call, if it's just creating
a Set<String> and adding a single element to it.

regards,
Nicholas


>
>
> On Wed, Jul 22, 2009 at 4:14 PM, Nicholas Tung <gatoatigr...@gmail.com>wrote:
>
>> The problem is that my scala plugin project has additional dependencies.
>> These are added to pluginClassPath, but then you only add the first element
>> from pluginClassPath (why the first? this seems a bit arbitrary).
>>
>> If you wouldn't mind fixing this (in github master), I'd appreciate it
>> very much. I don't think users would ever want to add deps of the project as
>> plugins, so perhaps the changes below would work.
>>
>> Also, is the latest version on a public site?
>>
>> regards,
>> Nicholas
>> https://ntung.com
>>
>> +    protected void addToClasspath(BasicArtifact artifact_info,
>> +            Set<String> classpath, boolean add_deps) throws Exception
>> +    {
>> +        addToClasspath(factory.createArtifact(artifact_info.groupId,
>> +                artifact_info.artifactId, artifact_info.version,
>> +                Artifact.SCOPE_RUNTIME, "jar"), classpath, add_deps);
>> +    }
>>
>> +    protected void addToClasspath(Artifact artifact, Set<String>
>> classpath,
>> +            boolean add_deps) throws Exception
>> +    {
>>          resolver.resolve(artifact, remoteRepos, localRepo);
>>          classpath.add(artifact.getFile().getCanonicalPath());
>> -        for(Artifact dep: resolveArtifactDependencies(artifact)) {
>> -            classpath.add(dep.getFile().getCanonicalPath());
>> +        if (add_deps) {
>> +            for (Artifact dep : resolveArtifactDependencies(artifact)) {
>> +                classpath.add(dep.getFile().getCanonicalPath());
>> +            }
>>          }
>>      }
>>
>> +    /**
>> +     * Retrieves a list of paths to scala compiler plugins.
>> +     * @return The list of plugins
>> +     * @throws Exception
>> +     */
>> +    private Set<String> getCompilerPlugins() throws Exception {
>> +        Set<String> plugins = new HashSet<String>();
>> +        if (compilerPlugins != null) {
>> +            Set<String> ignoreClasspath = new HashSet<String>();
>> +            addToClasspath(SCALA_GROUPID, "scala-compiler", scalaVersion,
>> +                    ignoreClasspath);
>> +            addToClasspath(SCALA_GROUPID, SCALA_LIBRARY_ARTIFACTID,
>> +                    scalaVersion, ignoreClasspath);
>> +            for (BasicArtifact artifact : compilerPlugins) {
>> +                System.out.println("compiler plugin: " +
>> artifact.toString());
>> +                // TODO - Ensure proper scala version for plugins
>> +                Set<String> pluginClassPath = new HashSet<String>();
>> +                addToClasspath(artifact, pluginClassPath, false);
>> +                pluginClassPath.removeAll(ignoreClasspath);
>> +                plugins.addAll(pluginClassPath);
>> +            }
>> +        }
>> +        return plugins;
>> +    }
>>
>>
>> On Wed, Jul 22, 2009 at 12:43 PM, Nicholas Tung 
>> <gatoatigr...@gmail.com>wrote:
>>
>>> It looks like you're setting this stuff with javadoc... imho, an
>>> attribute is a bit more robust. Also, you have
>>>
>>> <compilerPlugins> <dependency>
>>> instead of <compilerPlugins> <compilerPlugin>, but changing it doesn't
>>> seem to help (it then compiles without any plugin).
>>>
>>> If you could point me to other relevant code (I'm looking at
>>> ScalaMojoSupport.java), that would be much appreciated.
>>>
>>> Thanks in advance,
>>> Nicholas
>>> https://ntung.com
>>>
>>> On Wed, Jul 22, 2009 at 12:12 PM, Nicholas Tung 
>>> <gatoatigr...@gmail.com>wrote:
>>>
>>>> Hi Josh,
>>>>
>>>>     Thanks; the repo is at [1], and I've attached the plugin (though I
>>>> suspect it has more to do with command line compilation rather than the
>>>> plugin itself).
>>>>
>>>>     I might end up overriding the main compiler class (i.e. not
>>>> scala.tools.nsc.Main), so I could probably hack something from there.
>>>>
>>>>     I got github master to build... if you could tell me where things
>>>> are, I'd appreciate it.
>>>>
>>>> regards,
>>>> Nicholas
>>>> https://ntung.com
>>>>
>>>> [1] http://github.com/gatoatigrado/skalch/tree/master
>>>>
>>>>
>>>> On Wed, Jul 22, 2009 at 8:34 AM, Josh Suereth <joshua.suer...@gmail.com
>>>> > wrote:
>>>>
>>>>> Does your scalac plugin depend on any other plugins?  If you can point
>>>>> me towards a repository holding your scalac plugin, I can create an
>>>>> integration test for this use case.  I'm adding it to the list of known
>>>>> issues.
>>>>>
>>>>> - Josh
>>>>>
>>>>>
>>>>> On Wed, Jul 22, 2009 at 2:43 AM, Nicholas Tung <gatoatigr...@gmail.com
>>>>> > wrote:
>>>>>
>>>>>> Hi David and Josh,
>>>>>>
>>>>>>    I'm having some trouble with the maven scala plugin; it doesn't
>>>>>> seem to be setting the -Xplugin line correctly when I try to build a 
>>>>>> project
>>>>>> [1]. The configuration passed to the maven-scala-plugin is [2]. I'm 
>>>>>> running
>>>>>> $(mvn install -Dmaven.scala.displayCmd=true).
>>>>>>
>>>>>>     Feel free to look at the pom.xml files if you want [3], but don't
>>>>>> feel obliged... I haven't done proper Scala / Java separation yet (among
>>>>>> other things to clean it up).
>>>>>>
>>>>>> Thanks so much!
>>>>>> Nicholas
>>>>>> https://ntung.com
>>>>>>
>>>>>> [1]
>>>>>> version 2.10 gives
>>>>>>
>>>>>> -Xplugin:/home/gatoatigrado/.m2/repository/org/scala-tools/maven-scala-plugin/2.10/maven-scala-plugin-2.10.jar
>>>>>>
>>>>>> version 2.11 gives
>>>>>> -Xplugin:/home/gatoatigrado/.m2/repository/xom/xom/1.1/xom-1.1.jar
>>>>>>
>>>>>> the correct version should be
>>>>>> -Xplugin:/home/gatoatigrado/.m2/repository/edu/berkeley/cs/sketch/skalch-plugin/git-master/skalch-plugin-git-master.jar
>>>>>>
>>>>>>
>>>>>> [2]
>>>>>> <compilerPlugin>
>>>>>>         <groupId>edu.berkeley.cs.sketch</groupId>
>>>>>>         <artifactId>skalch-plugin</artifactId>
>>>>>>         <version>git-master</version>
>>>>>> </compilerPlugin>
>>>>>>
>>>>>> [3] http://github.com/gatoatigrado/skalch/tree/master
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

Reply via email to