Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Headless Build with Tycho
Headless Build with Tycho [message #809265] Tue, 28 February 2012 11:55 Go to next message
Thomas Kölling is currently offline Thomas Kölling
Messages: 45
Registered: December 2011
Location: Munich
Member
Hey Guys,

is there a tutorial out there which describes the headless build for an E4 Project with Tycho? I've tried some tutorials based on 3.x, but they doesn't seem to work.

Greetings Thomas
Re: Headless Build with Tycho [message #809348 is a reply to message #809265] Tue, 28 February 2012 14:29 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Doesn't work in what way? Building anything with tycho is simply a matter of feeding in the correct p2 repos and features.

What did you do?

PW


Re: Headless Build with Tycho [message #809890 is a reply to message #809348] Wed, 29 February 2012 07:05 Go to previous messageGo to next message
Thomas Kölling is currently offline Thomas Kölling
Messages: 45
Registered: December 2011
Location: Munich
Member
The problem is maybe the folder structure, i don't know. I've created a RCP project via the Eclipse Wizard, with Application.xmi and *.product File. After that, i've created following pom inside the project:


<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>de.test.rcp-client</groupId>
    <artifactId>de.test.rcp-client</artifactId>
    <version>1.0.0</version>
    <build>
        <plugins>
            <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-p2-repository-plugin</artifactId>
            <version>0.14.0</version>
            <configuration>
                <includeAllDependencies>true</includeAllDependencies>
            </configuration>
        </plugin>
		<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<version>0.14.0</version>
				<configuration>
					<resolver>p2</resolver>
					<target>
						<artifact>
							<groupId>de.test.rcp-client</groupId>
							<artifactId>target-definition</artifactId>
							<version>1.0.0-SNAPSHOT</version>
							<classifier>juno</classifier>
						</artifact>
					</target>
					<ignoreTychoRepositories>true</ignoreTychoRepositories>
					<environments>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86</arch>
						</environment>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86</arch>
  					</environment>
					</environments>
				</configuration>
		</plugin>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-p2-director-plugin</artifactId>
            <version>0.14.0</version>
            <executions>
                <execution>
                    <id>materialize-products</id>
                    <goals>
                        <goal>materialize-products</goal>
                    </goals>
                </execution>
                <execution>
                    <id>archive-products</id>
                    <goals>
                        <goal>archive-products</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                    <products>
                        <product>
                            <id>example.product</id>
                        </product>
                    </products>

                    <formats>
                        <win32>zip</win32> 
                        <linux>tar.gz</linux>
                        <macosx>tar.gz</macosx>
                    </formats>

             </configuration>
        </plugin>
        </plugins>
    </build>
</project>





After maven clean install, the build failed with the message:

Failed to execute goal org.eclipse.tycho:tycho-p2-director-plugin:0.14.0:materialize-products (materialize-products) on project de.test.rcp-client: Product id 'example.product' not found -> [Help 1].

But example.product is defenitly there..

greetings thomas
Re: Headless Build with Tycho [message #810079 is a reply to message #809890] Wed, 29 February 2012 12:00 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Can you use the export button the .product editor to export it from within eclipse? If you can, then your best bet would be to ask on the tycho-user list, https://dev.eclipse.org/mailman/listinfo/tycho-user

PW


Re: Headless Build with Tycho [message #813600 is a reply to message #810079] Mon, 05 March 2012 08:40 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de Alwis
Messages: 242
Registered: July 2009
Senior Member
Thomas, I believe Tycho is referencing the product ID from the .product's "uid" field, and not from the file name. The are two product IDs (and I'm sure PDE uses different terms internally): the product instantiation ID, which references the configuration parameters in the .product file, and the product definition ID, which references a particular extension on the org.eclipse.core.runtime.products extension point.

For an app I'm working on, we have a single product definition (i.e., one org.eclipse.core.runtime.producsts extension) but multiple .product files (with different uids) referencing that extension.
Re: Headless Build with Tycho [message #815338 is a reply to message #813600] Wed, 07 March 2012 09:25 Go to previous messageGo to next message
Thomas Kölling is currently offline Thomas Kölling
Messages: 45
Registered: December 2011
Location: Munich
Member
Hi Brian, great to know that somebody use e4 rcp with tycho. In my case the build for now is successful, with a custom target platform file. Unfortunately by executing the resulting exe file, the application throws an exception:

java.lang.NullPointerException
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.<init>(ModelServiceImpl.java:92)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:482)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:172)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:125)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:352)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1433)


Maybe you've had this problem already an can help me. If i start the Application directly from an eclipse launch configuration, with the same dependencies like in the product file, all things are ok and the app starts.

btw. normal export via eclipse and the same target platform works fine. the plugin folder contains in both builds the same plugins.

edit2: The problem is the config.ini file. With the config.ini from the Eclipse Export, the Tycho build works. I look tomorrow deeper into this.


greetings Thomas

[Updated on: Wed, 07 March 2012 10:09]

Report message to a moderator

Re: Headless Build with Tycho [message #815745 is a reply to message #815338] Wed, 07 March 2012 20:49 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de Alwis
Messages: 242
Registered: July 2009
Senior Member
That's usually an indication that you haven't auto started org.eclipse.equinox.event and org.eclipse.equinox.ds.
Re: Headless Build with Tycho [message #815924 is a reply to message #815745] Thu, 08 March 2012 03:01 Go to previous message
Thomas Kölling is currently offline Thomas Kölling
Messages: 45
Registered: December 2011
Location: Munich
Member
Yep that was the problem.. shame on me Crying or Very Sad

additionally i have to add the org.eclipse.core.runtime bundle to the autostart.


greetings, thomas
Previous Topic:PartSashContainer: cascading delete
Next Topic:e4xmi Snippets - What are they?
Goto Forum:
  


Current Time: Mon Sep 01 22:02:34 EDT 2014

Powered by FUDForum. Page generated in 0.02030 seconds