Closed drkstr101 closed 4 years ago
I was able to solve this after poking around in the source, and a little trial-and-error. Solution posted below.
UPDATE I have included the full solution below in case anyone may find it useful.
target.p2/build.gradle
// Download from eclipse and put it into maven
apply plugin: 'com.diffplug.gradle.p2.asmaven'
p2AsMaven {
group 'eclipse-deps', {
repo 'http://download.eclipse.org/releases/2019-06'
repo 'http://download.eclipse.org/ecp/releases/releases_121/'
feature 'org.eclipse.platform'
feature 'org.eclipse.platform.source'
feature 'org.eclipse.emf.ecore'
iu 'org.eclipse.emf.ecp.edit'
iu 'org.eclipse.core.runtime'
iu 'org.eclipse.emf.edit.ui'
iu 'org.eclipse.emf.common.ui'
append true //not required for solution
repo2runnable()
}
}
hello.model.edit/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 {
implementation project(':hello.model')
compile 'eclipse-deps:org.eclipse.core.runtime:+',
'eclipse-deps:org.eclipse.osgi:+',
'eclipse-deps:org.eclipse.emf.edit:+',
'eclipse-deps:org.eclipse.emf.ecore.change:+'
// Use JUnit test framework
testImplementation 'junit:junit:4.12',
'org.hamcrest:hamcrest:2.1'
}
hello.model.editor
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 {
implementation project(':hello.model'),
project(':hello.model.edit')
//some of these may be redundant, but it works
compile 'eclipse-deps:org.eclipse.core.runtime:+',
'eclipse-deps:org.eclipse.core.commands:+',
'eclipse-deps:org.eclipse.emf.edit.ui:+',
'eclipse-deps:org.eclipse.emf.common.ui:+',
'eclipse-deps:org.eclipse.equinox.common:+',
'eclipse-deps:org.eclipse.core.jobs:+',
'eclipse-deps:org.eclipse.equinox.registry:+',
'eclipse-deps:org.eclipse.equinox.preferences:+',
'eclipse-deps:org.eclipse.core.contenttype:+',
'eclipse-deps:org.eclipse.equinox.app:+',
'eclipse-deps:org.eclipse.ui.views:+',
'eclipse-deps:org.eclipse.ui.workbench:+',
'eclipse-deps:org.eclipse.e4.ui.workbench3:+',
'eclipse-deps:org.eclipse.ui:+',
'eclipse-deps:org.eclipse.swt:+',
'eclipse-deps:org.eclipse.swt.win32.win32.x86_64:+',
'eclipse-deps:org.eclipse.jface:+',
'eclipse-deps:org.eclipse.jface.text:+',
'eclipse-deps:org.eclipse.text:+'
}
Thanks for heads-up re: broken javadoc. Looks like your issue is resolved?
Indeed, it works like a charm. Looks like we have a winner here! I will be using goomph to manage my eclipse builds from now on. I updated my previous comment with the full solution in case anyone else runs into trouble.
Cheers and thank you!
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 alibs
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
target.p2/build.gradle
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 theorg.eclipse.emf.ecp
feature for theorg.eclipse.emf.ecp.edit
dependency. However, adding this feature to thetarget.p2
project throws an error during the build process: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