Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] How do I use the Groovy Eclipse compiler with Tycho?

Tycho uses build.properties file to determine what is included in the
bundle jar. Although I have not tried this myself, adding a line like
below to build.properties may work

bin.excludes = **/*.groovy

--
Regards,
Igor

On 11-04-21 05:34 PM, Thomas Hofmann wrote:
Hi Igor,

thanks for this suggestion. Although I havn't had a change to understand what is really going on with a pom like that I can say that it compiled the groovy code alright.
One problem is that the groovy source files are also included in the jar being build. Do you have a suggestion on how they could be excluded?

Thanks, Thomas

-----Original Message-----
From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of Igor Fedorenko
Sent: Dienstag, 19. April 2011 23:32
To: tycho-user@xxxxxxxxxxx
Subject: Re: [tycho-user] How do I use the Groovy Eclipse compiler with Tycho?

It is not possible to change compiler used by maven-osgi-compiler-plugin but it should be possible to *add* maven-compiler-plugin with compilerId=groovy-eclipse-compiler to tycho projects. Try something like this

    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.3.2</version>
          <executions>
            <execution>
              <id>groovy</id>
              <goals>
                <goal>compile</goal>
              </goals>
              <phase>compile</phase>
              <configuration>
                <compilerId>groovy-eclipse-compiler</compilerId>
                <verbose>true</verbose>
              </configuration>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.groovy</groupId>
              <artifactId>groovy-eclipse-compiler</artifactId>
              <version>0.5.1-SNAPSHOT</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </build>


--
Regards,
Igor

On 11-04-19 04:51 PM, Thomas Hofmann wrote:
Probably,


			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<compilerId>groovy-eclipse-compiler</compilerId>
					<verbose>true</verbose>
				</configuration>

Should be changed to

			<plugin>
				<artifactId>maven-osgi-compiler-plugin</artifactId>
				<version>0.11.0</version>
				<configuration>
					<compilerId>groovy-eclipse-compiler</compilerId>
					<verbose>true</verbose>
				</configuration>

I will try that.

-----Original Message-----
From: tycho-user-bounces@xxxxxxxxxxx
[mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of Thomas Hofmann
Sent: Dienstag, 19. April 2011 22:33
To: Tycho user list
Subject: Re: [tycho-user] How do I use the Groovy Eclipse compiler with Tycho?

Hi Igor,

that was the impression I had. The compiler used is always the jdt compiler. http://contraptionsforprogramming.blogspot.com/2010/10/more-on-groovy-eclipse-and-maven.html explains how the eclipse compiler can be used in maven.

What I tried to do is esential this:

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<compilerId>groovy-eclipse-compiler</compilerId>
					<verbose>true</verbose>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.codehaus.groovy</groupId>
						<artifactId>groovy-eclipse-compiler</artifactId>
						<version>0.5.1-SNAPSHOT</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>

But unfortunately, this had no effect. As far as I have seen in the tycho source the maven-osgi-compiler-plugin handles classpaths and such. The actual compiler being used is the jdt one (as you stated). I would like to know if changing the jdt one to antoher one is just not implemented or if there are other problems preventing one from doing so or if there is even a way to change the compiler impl. being used that I couldn't figure out.



-----Original Message-----
From: tycho-user-bounces@xxxxxxxxxxx
[mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of Igor Fedorenko
Sent: Dienstag, 19. April 2011 22:17
To: tycho-user@xxxxxxxxxxx
Subject: Re: [tycho-user] How do I use the Groovy Eclipse compiler with Tycho?

Tycho has it's own maven-osgi-compiler-plugin which is hardcoded to use jdt compiler (so Tycho projects can have proper OSGi classpath with access rules, etc). Theoretically, it should be able to bind groovy maven compiler in addition to maven-osgi-compiler-plugin, but I don't know enough about groovy/maven integration to tell for sure.

--
Regards,
Igor

On 11-04-19 03:56 PM, Thomas Hofmann wrote:
Hi,
I have two features that should end up in a p2 repository that can be
used as source to install the two features. One bundle in one of the
features is implemented in Groovy.
I setup up a tycho build for this and I am facing the problem that
the Groovy files are not compiled since Tycho is not using the
Eclipse Groovy compiler for the bundle containing the Groovy sources.
So I tried to change the compiler implementation for this one bundle
to the Groovy Eclipse specific one. No matter what I do the compiler
implementation that I specified is not used.
Could someone on this list please shed some light on how this can be
acomplished?
Thanks, Thomas



Back to the top