wuff icon indicating copy to clipboard operation
wuff copied to clipboard

Support for Eclipse 4

Open tschulte opened this issue 11 years ago • 3 comments

I am in the progress of switching a Maven Tycho Build of an e4 RCP application to wuff. But I think for e4 Wuff needs to be enhanced to support the new concepts:

  • There are no Views any more, but Application.e4xmi and Fragment.e4xmi (workaround: create file src/main/resources/plugin.xml and define it there)
  • There is no need to create an Application.java. Just use eclipse.application=org.eclipse.e4.ui.workbench.swt.E4Application in config.ini for SWT-Applications (Workaround: ?) This is normally defined in plugin.xml
    <extension
            id="myproductid"
            point="org.eclipse.core.runtime.products">
        <product
                name="myproductname"
                application="org.eclipse.e4.ui.workbench.swt.E4Application">
[...]

Workaround:

products {
    launchParameters << '-application'
    launchParameters << 'org.eclipse.e4.ui.workbench.swt.E4Application'
    launchParameters << '-product'
    launchParameters << "${project.name}.myproductid"
}

run {
    args = products.launchParameters
}
  • More to come?

tschulte avatar Aug 06 '14 10:08 tschulte

I implemented support of e4 technology in Wuff 0.0.13-SNAPSHOT. Please, test the following scenario:

  • Create new directory, create "build.gradle", insert code:
buildscript {
  repositories {
    jcenter()
    maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
  }

  dependencies {
    classpath 'org.akhikhl.wuff:wuff-plugin:0.0.13-SNAPSHOT'
  }
}

repositories {
  jcenter()
  maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
}

apply plugin: 'java'
apply plugin: 'org.akhikhl.wuff.eclipse-rcp-app'
  • Run gradle scaffold
  • Run gradle run, check that app gets started.
  • Run gradle buildProduct, check that product gets assembled
  • Run launch script of the generated product, check that product gets started

Wiring of org.eclipse.e4.ui.workbench.swt.E4Application and product is done completely automatically, so you don't have to pass additional arguments to JVM.

I tested e4 support on Eclipse versions 4.2.1, 4.2.2, 4.3.1, 4.3.2, 4.4 and on platforms Linux and Windows. I did not test it on Mac OSX, since I don't own Apple machine.

akhikhl avatar Sep 07 '14 18:09 akhikhl

It seems to work for SWT based apps. But I wonder, if the Application.e4xmi should be moved to src/main/resources?

Currently I am trying to get a JavaFX-based RCP application to run. See https://github.com/tschulte/contacts-griffon. I still get

Error in equinox application configuration for project org.eclipse.fx.demo.contacts.app:
Could not generate extension-point "org.eclipse.core.runtime.applications" and there are no user-provided extension-points of this type.
Reason: project sources do not contain Application.java or Application.groovy.

This project is a copy of the contacts demo of e(fx)clipse and I just added the gradle build file. As you can see, I needed to do a lot of stuff to at least get it running, though it still does not run completely.

OSGI-Extensions are not supported out of the box:

products {
    launchParameter '-vmargs'
    launchParameter '-Dosgi.framework.extensions=org.eclipse.fx.osgi'
}
configurations {
    osgiExtension
}
dependencies {
    osgiExtension "$eclipseMavenGroup:org.eclipse.fx.osgi:+"
}
afterEvaluate {
    tasks.prepareRunConfig << {
        File configIni = file("$buildDir/run/configuration/config.ini")
        configIni.append "osgi.framework.extensions=reference\\:${configurations.osgiExtension.files[0].toURI()}"
    }
}
configurations {
    compileOnly
    all {
        // exclude a lot of dependencies automatically applied by wuff (swt et. al.)
    }
}

But it still does not run yet. Seem to be some dependency issue. Maybe you can see what the problem is?

tschulte avatar Sep 07 '14 21:09 tschulte

Moving Application.e4xmi to src/main/resources - yes, this is a good idea. I will try to do it. e(fx)clipse integration - I am new in this area. Will see what I can learn and implement. Could you, please, open a new issue on e(fx)clipse integration and move our discussion there? I'd rather prefer to have more small issues than fewer large issues.

akhikhl avatar Sep 08 '14 06:09 akhikhl