|
|
|
|
|
|
|
|
|
Re: Configure Standalone [message #1860616 is a reply to message #1860602] |
Tue, 22 August 2023 03:21 |
|
questions:
- why do you use the normal jar and not the uber jar
- file should be "./example.mydsl1"
- other xtext deps in example project not needed
=> unclear what you try to achieve
maybe you can do 2 steps back and describe what you want to achieve
with move of run.java to a package
it works for me
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
- <classpathentry kind="lib" path="/Users/grisv/GitHub/KanoaV2/Resources/zzz.example.mydsl1.parent/zzz.example.mydsl1/target/zzz.example.mydsl1-1.0.0-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="/home/dietrich/tmp/Xtext-Maven/zzz.example.mydsl1.parent/zzz.example.mydsl1.ide/target/zzz.example.mydsl1.ide-1.0.0-SNAPSHOT-ls.jar"/>
umbenannt: Examplemaven/src/main/java/run.java -> Examplemaven/src/main/java/demo/run.java
it diff Examplemaven/src/main/java/demo/run.java
diff --git a/Examplemaven/src/main/java/demo/run.java b/Examplemaven/src/main/java/demo/run.java
index 3035a07..22dd3cd 100644
--- a/Examplemaven/src/main/java/demo/run.java
+++ b/Examplemaven/src/main/java/demo/run.java
@@ -1,3 +1,4 @@
+package demo;
import java.util.ArrayList;
import org.eclipse.emf.common.util.EList;
@@ -18,14 +19,12 @@ public class run {
Injector injector = new MyDslStandaloneSetup().createInjectorAndDoEMFRegistration();
XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class);
- Resource resource = resourceSet.getResource(URI.createFileURI("./example.mydsl"), true);
+ Resource resource = resourceSet.getResource(URI.createFileURI("./example.mydsl1"), true);
Model model = (Model) resource.getContents().get(0);
- @SuppressWarnings("unchecked")
- EList<Greeting> gs = (EList<Greeting>) new ArrayList();
- for (Greeting g : gs) {
+ for (Greeting g : model.getGreetings()) {
System.out.println(g.toString());
}
git diff Examplemaven/pom.xml
diff --git a/Examplemaven/pom.xml b/Examplemaven/pom.xml
index 22a0d3f..c047ad8 100644
--- a/Examplemaven/pom.xml
+++ b/Examplemaven/pom.xml
@@ -4,23 +4,7 @@
<artifactId>zzzzmaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-api</artifactId>
- <version>2.10.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <version>2.10.0</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.xtext</groupId>
- <artifactId>org.eclipse.xtext</artifactId>
- <version>2.12.0</version>
- </dependency>
-</dependencies>
+
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
[Updated on: Tue, 22 August 2023 03:27] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.06415 seconds