Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] AspectJ weaving with org.eclipse.equinox.weaving.hook and frameworkextension



On Mon, Jun 27, 2011 at 9:57 AM, Markus Alexander Kuppe <tycho-user_eclipse.org@lemmster.de> wrote:
> Have you solved it? I am trying to achieve the same thing, but weaving
doesn't happen in my tests..
>
> thanks,
> iulian

Hi iulian,

I ended up having tycho resolve the weaving hook with p2 into the local
Maven repository to install it in a pre-integration-test step manually.
Afterwards it can be referenced like a regular maven dependency.
Only downside is, that you depend on a specific version that might
change over time.

Hi Markus,

Thank you for your message. Unfortunately, it doesn't seem to work for me. I do get the info message:

[org.eclipse.equinox.weaving.hook] info adding AspectJ hooks ...

but nothing else. In a normal run (using the Eclipse launcher), I get a lot more, along these lines:

[org.eclipse.equinox.weaving.hook] info adding AspectJ hooks ...
[org.eclipse.equinox.weaving.aspectj] info Starting AspectJ weaving service ...
[org.scala-ide.sdt.aspects] info AspectJ Weaver Version 1.6.11.RC1 built on Friday Mar 4, 2011 at 20:53:44 GMT
[org.scala-ide.sdt.aspects] info register aspect org.eclipse.jdt.core.dom.ASTConverterAspect
[org.scala-ide.sdt.aspects] info register aspect scala.tools.eclipse.contribution.weaving.jdt.builderoptions.ScalaJavaBuilderAspect
[org.scala-ide.sdt.aspects] info register aspect scala.tools.eclipse.contribution.weaving.jdt.cfprovider.ClassFileProviderAspect
[org.scala-ide.sdt.aspects] info register aspect scala.tools.eclipse.contribution.weaving.jdt.core.BindingKeyAspect

Here's my pom.xml:


  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.scala-ide</groupId>
    <artifactId>scala-ide-for-eclipse</artifactId>
    <version>2.0.0-SNAPSHOT</version>
    <relativePath>../org.scala-ide.build/pom.xml</relativePath>
  </parent>
  <artifactId>org.scala-ide.sdt.core.tests</artifactId>
  <packaging>eclipse-test-plugin</packaging>

  <profiles>
    <profile>
      <id>Mac OS</id>
      <activation>
        <os>
          <family>mac</family>
        </os>
      </activation>
      <properties>
        <tycho.test.OSspecific>-Dosgi.ws=cocoa -XstartOnFirstThread
        </tycho.test.OSspecific>
      </properties>
    </profile>

    <profile>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <tycho.test.OSspecific></tycho.test.OSspecific>
      </properties>
    </profile>

  </profiles>

  <properties>
    <tycho.test.jvmArgs>-Xmx800m -XX:MaxPermSize=256m -Dsdtcore.headless ${tycho.test.OSspecific}</tycho.test.jvmArgs>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.2</version>
        <executions>
          <execution>
            <id>it-preparation</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>install-file</goal>
            </goals>
            <configuration>
              
              <file>${settings.localRepository}/p2/osgi/bundle/org.eclipse.equinox.weaving.hook/1.0.0.v20100503/org.eclipse.equinox.weaving.hook-1.0.0.v20100503.jar
              </file>
              <groupId>org.scala-ide</groupId>
              <artifactId>org.eclipse.equinox.weaving.hook</artifactId>
              <version>1.0.0.v20100503</version>
              <packaging>jar</packaging>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <version>2.15.0</version>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <jvmArgs>
            <jvmArg>-Xms512m</jvmArg>
            <jvmArg>-Xmx1024m</jvmArg>
          </jvmArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.tycho</groupId>
        <artifactId>maven-osgi-test-plugin</artifactId>
        <version>${tycho.version}</version>
        <configuration>
          <useUIHarness>false</useUIHarness>
          <useUIThread>false</useUIThread>

          <!-- Enable JDT weaving -->
          <systemProperties combine.children="append">
            <aj.weaving.verbose>true</aj.weaving.verbose>
            <org.aspectj.weaver.showWeaveInfo>true
            </org.aspectj.weaver.showWeaveInfo>
            <org.aspectj.osgi.verbose>true</org.aspectj.osgi.verbose>
          </systemProperties>
          <frameworkExtensions>
            <frameworkExtension>
              <groupId>org.scala-ide</groupId>
              <artifactId>org.eclipse.equinox.weaving.hook</artifactId>
              <version>1.0.0.v20100503</version>
            </frameworkExtension>
          </frameworkExtensions>

          <!-- <includes> -->
          <!-- <include>scala/tools/eclipse/*Test.class</include> -->
          <!-- </includes> -->
          <argLine>${tycho.test.jvmArgs}</argLine>
          <testSuite>${project.artifactId}</testSuite>
          <testClass>scala.tools.eclipse.TestsSuite</testClass>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.sonatype.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <version>${tycho.version}</version>
        <configuration>
          <resolver>p2</resolver>
          <pomDependencies>consider</pomDependencies>
        </configuration>
      </plugin>

    </plugins>
  </build>
</project>




_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

Back to the top