Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Tycho/FAQ

< Tycho
Revision as of 05:25, 6 September 2011 by Jan.sievers.sap.com (Talk | contribs) (New page: ==How to configure HTTP proxy settings during test execution?== Two options: Manually configure the proxy <source lang="xml"> <build> <plugins> <plugin> <groupId>org.eclipse...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to configure HTTP proxy settings during test execution?

Two options:

Manually configure the proxy

<build>
  <plugins>
    <plugin>
      <groupId>org.eclipse.tycho</groupId>
      <artifactId>tycho-surefire-plugin</artifactId>
      <configuration>
        <argLine>-Dhttp.proxyHost=myproxy -Dhttp.proxyPort=1234</argLine>
      </configuration>
    </plugin>
  </plugins>
</build>

and disable the eclipse system proxy setting

    if (Platform.isRunning() && getProxyService() != null
      && getProxyService().isSystemProxiesEnabled()
      && !getProxyService().hasSystemProxies()) {
      // XXX e3.5/gtk.x86_64 activate manual proxy configuration which
      // defaults to Java system properties if system proxy support is
      // not available
     getProxyService().setSystemProxiesEnabled(false);
     getProxyService().setProxiesEnabled(true);
    }

- or -

Make sure the native org.eclipse.core.net.* fragment for your platform is included in the test runtime so eclipse will pick up proxy settings configured on OS level:

<build>
  <plugins>
    <plugin>
      <groupId>org.eclipse.tycho</groupId>
      <artifactId>tycho-surefire-plugin</artifactId>
      <configuration>
        <dependencies>
          <dependency>
            <type>p2-installable-unit</type>
            <artifactId>org.eclipse.core.net.[YOUR_PLATFORM]</artifactId>
            <version>[VERSION]</version>
          </dependency>
        </dependencies>
      </configuration>
    </plugin>
  </plugins>
</build>

How to configure warning/error settings of the OSGi compiler?

To configure warnings:

<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>tycho-compiler-plugin</artifactId>
  <version>${tycho-version}</version>
  <configuration>
    <compilerArgument>-warn:[+|-]warning_tokens_separated_by_comma</compilerArgument>
  </configuration>
</plugin>

The available warning tokens are listed in the Eclipse help. Same applies for the

-err

argument for configuring errors.

How to build plugin-based products with platform-specific fragments?

First you need to configure all os/ws/arch environments for which you want to build. Example POM snippet:

<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>target-platform-configuration</artifactId>
  <version>${tycho-version}</version>
  <configuration>
  <resolver>p2</resolver>
    <environments>
      <environment>
        <os>win32</os>
        <ws>win32</ws>
        <arch>x86</arch>
      </environment>
      <environment>
        <os>win32</os>
        <ws>win32</ws>
        <arch>x86_64</arch>
      </environment>
    </environments>
  </configuration>
</plugin>

for plugin-based (as opposed to feature-based) .product files, tycho needs additional os/ws/arch attributes for the fragments in the .product file which are not required by PDE.

Example product file snippet:

<plugin id="org.eclipse.swt.win32.win32.x86" fragment="true" os="win32" ws="win32" arch="x86"/>
<plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true" os="win32" ws="win32" arch="x86_64"/>

How to test OSGi declarative services?

You need to add bundle org.eclipse.equinox.ds to the test runtime:


<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>tycho-surefire-plugin</artifactId>
  <configuration>
    <dependencies>
      <dependency>
        <type>p2-installable-unit</type>
        <artifactId>org.eclipse.equinox.ds</artifactId>
      </dependency>
    </dependencies>
  </configuration>
</plugin>

Back to the top