Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Test runtime with platform specific fragments

Greg,

There are an outstanding issue open on this (https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636) and a solution in the works as well (https://git.eclipse.org/r/#/c/17296/)... Though I have no ideas when this will be included in a Tycho release :-)

For now I use the following construct to force the fragment in my test. You can add similar profiles for other architecture - though the activation can be a little tricky. If you have many different tests where this is needed, then you are in for some boring work!

/Tonny

<profiles>
<profile>
<id>test-on-mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<dependency-resolution>
<optionalDependencies>ignore</optionalDependencies>
<extraRequirements combine.children="append">
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.jdt.launching.macosx</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>


--
Tonny Madsen
My profiles: LinkedIn Twitter Blogger SlideShare



On Thu, Jan 2, 2014 at 7:07 AM, Greg Amerson <gregory.amerson@xxxxxxxxxxx> wrote:
Hey everyone,

I'm using tycho to build and test some eclipse plugins. I have one bundle that has many platform specific fragments. I also have one test bundle that is using tycho-surefire-plugin to test the original bundle that has the platform specific fragments. However, tycho is not including the current platform's fragment into the test runtime.

All of the platform specific fragments look like the win64 fragment manifest listed below (there are actually 6 total fragments, one for each platform combination I need to support.)

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay AUI Upgrade Tool Win64
Bundle-SymbolicName: com.liferay.laut.win32.win32.x86_64;singleton:=true
Bundle-Version: 1.0.2.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Fragment-Host: com.liferay.ide.alloy.core
Eclipse-BundleShape: dir
Eclipse-PlatformFilter: (& (osgi.ws=win32)(osgi.os=win32)(osgi.arch=x86_64))
Bundle-Vendor: Liferay, Inc.

Example win64 Fragment pom.xml's section

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <configuration>
                <resolver>p2</resolver>
                <environments>
                    <environment>
                        <os>win32</os>
                        <ws>win32</ws>
                        <arch>x86_64</arch>
                    </environment>
                </environments>
            </configuration>
        </plugin>
    </plugins>
</build>

When I try to execute my tycho build and it runs the surefire test plugin (no matter which OS I try), the correct platform fragment is not added into the runtime.

Any ideas?  

I've seen various posts on stackoverflow about similar questions but in those cases the fragments loaded into the test runtime were not platform-specific fragments with OS filters.

I've attached an example multi-module project the demonstrates the problem. 

After you run the test if you look at the bundles that are started by surefire it doesn't include the example.bundle.win32.win32.x86_64 fragment if you are on windows or the example.bundle.linux.gtk.x86_64 fragment if you are on linux.  

--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

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



Back to the top