diffplug / gradle-and-eclipse-rcp

Gradle and Eclipse RCP
Apache License 2.0
45 stars 9 forks source link

Unable to Build Eclipse Client Platform (ECP) Projects #14

Closed drkstr101 closed 4 years ago

drkstr101 commented 4 years ago

Hello,

I apologize if this is not the correct venue for general questions, but I wasn't sure where to ask this.

I am attempting to migrate a working Gradle build that builds the eclipse modeling projects, (EG hello.model, hello.model.edit, hello.model.editor) where the dependencies are managed explicitly, with the appropriate jars sitting in a libs directory. As I now need to add further dependencies to the project, I am looking towards goomph to manage the dependencies automatically.

I was able to build the first project (hello.model) successfully with the following:

hello.model/build.gradle

plugins {
    // Apply the java-library plugin to add support for Java Library
    id 'java-library'
}

// we need the maven repo from p2
evaluationDependsOn(':target.p2')

repositories {
    jcenter()
    mavenCentral()
    maven {
        url rootProject.file('target.p2/build/p2asmaven/maven')
    }
}

dependencies {

    compile 'eclipse-deps:org.eclipse.emf.ecore:+',
            'eclipse-deps:org.eclipse.emf.common:+',
            'eclipse-deps:org.eclipse.emf.ecore.xmi:+'

    runtime 'eclipse-deps:org.eclipse.core.runtime:+'

    // Use JUnit test framework
    testImplementation 'junit:junit:4.12',
            'org.hamcrest:hamcrest:2.1'
}

target.p2/build.gradle

// Download from eclipse and put it into maven
apply plugin: 'com.diffplug.gradle.p2.asmaven'

p2AsMaven {
    group 'eclipse-deps', {
        repoEclipse '4.12.0'
        feature 'org.eclipse.platform'
        feature 'org.eclipse.platform.source'
        feature 'org.eclipse.emf.ecore'
        //Uncommenting line below throws build error
        //feature 'org.eclipse.emf.ecp'
        repo2runnable()
    }
}

I would now like to build hello.model.edit in the same way. According to (https://eclipsesource.com/blogs/tutorials/getting-started-with-the-emf-client-platform/#product), I need the org.eclipse.emf.ecp feature for the org.eclipse.emf.ecp.edit dependency. However, adding this feature to the target.p2 project throws an error during the build process:

... at com.diffplug.gradle.JavaExecable.main(JavaExecable.java:135) Caused by: C:\Users\drkst\AppData\Local\Temp\goomph-ant-build5456272606421021958.xml:2: Unable to find: Installable Unit [ id=org.eclipse.emf.ecp.feature.group ] at org.eclipse.equinox.p2.internal.repository.tools.tasks.AbstractRepositoryTask.prepareIUs(AbstractRepositoryTask.java:187) at org.eclipse.equinox.p2.internal.repository.tools.tasks.MirrorTask.execute(MirrorTask.java:60) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:352) at org.apache.tools.ant.Target.execute(Target.java:437) at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:181) at org.eclipse.ant.internal.core.ant.InternalAntRunner.parseBuildFile(InternalAntRunner.java:392) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:682) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:573) ...

I am wondering if maybe I need to somehow add the ECP update site (http://download.eclipse.org/ecp/releases/releases_121/) to the build configuration, but I'm not sure how to go about doing that, or if this is even the right course of action. Any additional guidance or insight on the matter will be greatly appreciated.

Cheers and Thank You!

PS: Gradle Version 5.6.4

PPS: Javadoc links on the main goomph repo appear to be broken, so perhaps this is covered there already

drkstr101 commented 4 years ago

I am closing this issue and posting it on the main goomph repo