Bug 551705 - Pomless Tycho should support Eclipse-PlatformFilter
Summary: Pomless Tycho should support Eclipse-PlatformFilter
Status: CLOSED DUPLICATE of bug 487341
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2019-10-02 09:40 EDT by Lars Vogel CLA
Modified: 2021-04-28 16:52 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2019-10-02 09:40:47 EDT
Currently pomless build cannot be used for platform specific bundles.

Example:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CPython Plug-in
Bundle-SymbolicName: com.test.linux.x86_64;singleton:=true
Bundle-Version: 2.7
Bundle-Vendor: vogella GmbH
Eclipse-PlatformFilter: (& (osgi.os=linux) (osgi.arch=x86_64))

Requires a pom.xml similar to the following:

<project>
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.vogella.tycho</groupId>
	<artifactId>com.vogella.tycho.example.linux.x86_64</artifactId>
	<version>1.0.0-SNAPSHOT</version>
	<packaging>pom</packaging>

	<parent>
		<groupId>com.vogella.tycho</groupId>
		<artifactId>org.eclipse.tycho.parent</artifactId>
		<version>1.0.0-SNAPSHOT</version>
	</parent>

	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<version>${tycho.version}</version>
				<configuration>
					<environments>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86_64</arch>
						</environment>
					</environments>
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>

I suggest to enhance pomless to consider also the Eclipse-PlatformFilter attribute.
Comment 1 Christoph Laeubrich CLA 2019-10-02 09:56:08 EDT
Why can't it be used? In your example you are specifying the platforms inside the pom of the module, why not specify them inside the master-pom (org.eclipse.tycho.parent)?
Comment 2 Lars Vogel CLA 2019-10-02 10:38:58 EDT
(In reply to Christoph Laeubrich from comment #1)
> Why can't it be used? In your example you are specifying the platforms
> inside the pom of the module, why not specify them inside the master-pom
> (org.eclipse.tycho.parent)?

The master pom specifies all platforms (win32, linux, macosx) therefore you need to reduce the platforms to the one which is relevant otherwise the build fails.
Comment 3 Christoph Laeubrich CLA 2019-10-02 11:23:21 EDT
But why does the build fails then? Instead of narrow down the thing in tycho pomless, the build part that fails then should respect the property, I think we have discussed this before.

So if you could share a stack-trace we might find out whats wrong there, I don't see anything here tycho-pomless can do as pomless has no knowledge about the used target platform at all.
Comment 4 Lars Vogel CLA 2019-10-02 11:30:00 EDT
(In reply to Christoph Laeubrich from comment #3)
> But why does the build fails then? Instead of narrow down the thing in tycho
> pomless, the build part that fails then should respect the property, I think
> we have discussed this before.
> 
> So if you could share a stack-trace we might find out whats wrong there, I
> don't see anything here tycho-pomless can do as pomless has no knowledge
> about the used target platform at all.

Tobias explained on Stackoverflow that this necessary: https://stackoverflow.com/questions/32854138/error-when-building-fragment-with-tycho-xyz-fragment-cannot-be-installed-in-th
Comment 5 Christoph Laeubrich CLA 2019-10-02 11:42:18 EDT

*** This bug has been marked as a duplicate of bug 487341 ***