Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Building a xText projects temporal with Ant
Building a xText projects temporal with Ant [message #836275] Wed, 04 April 2012 09:55 Go to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
Hello all,

i am developing a plug-in xText project, which should be build (Generate Xtext Artifacts) temporary at runtime.
I dont want all the *.ui *.test projects in my Version Control.

I have already looked up many different explainations to build xText with ant, but i still get errors i don't know how to fix.

I did the following:
(Using Eclipse 3.7)

I created a plug-in project with xText nature, then added the grammatic for my language (Language.xtext) and the mwe2 file (GenerateLanguage.mwe2). The build.xml i added to the META-INF Folder.
After that i wrote an Activator class which copies the project to a temporary Folder("C:/Language-test") i created before and executes the build.xml file which is localed directly in the project folder.

The build.xml and a snapshot of the mwe2 file are appended.

when i execute the ant-file via the Activator class in eclipse as well as via console i get the Exception in 'log.txt', i hope somebody can help me:
(console-command: C:\Language-test>C:\Users\myUser\Downloads\apache-ant-1.8.3-bin\apache-ant-1.8.3\bin\ant -f build.xml -Declipse.home=C:\Users\myUser\private_indigo > log.txt)
  • Attachment: log.txt
    (Size: 84.88KB, Downloaded 182 times)
  • Attachment: mwe2file.txt
    (Size: 0.56KB, Downloaded 172 times)
  • Attachment: build.xml
    (Size: 2.63KB, Downloaded 134 times)

[Updated on: Wed, 04 April 2012 10:04]

Report message to a moderator

Re: Building a xText projects temporal with Ant [message #836279 is a reply to message #836275] Wed, 04 April 2012 10:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
Hi,

the build.xml is missing. but i guess the main problem is that the workflow assumes that the project already exists in C:\Language-test
=> you have to add some mkdirs to the antfile yourself

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #836285 is a reply to message #836279] Wed, 04 April 2012 10:07 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
Thanks you, Christian

for the fast reply. I already tried this via the Activator class, but didn't help.
I wonder why eg. 'de.cs3d.test.dsl.language/src-gen/de/cs3d/test/dsl/serializer'also parser and these are generate without a problem, but 'de.cs3d.test.dsl.language/src-gen/de/cs3d/test/dsl/language' not.

~Paul

[Updated on: Wed, 04 April 2012 10:08]

Report message to a moderator

Re: Building a xText projects temporal with Ant [message #836288 is a reply to message #836285] Wed, 04 April 2012 10:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
Hi,

have no idea what you mean with "Activator" so can you share your ant file?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #836296 is a reply to message #836288] Wed, 04 April 2012 10:17 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
P.S: it does not help if you create folders
- de.cs3d.test.dsl.language
- de.cs3d.test.dsl.language.ui
and maybe others in
C:/language-test


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #836301 is a reply to message #836296] Wed, 04 April 2012 10:21 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
what i mean with Activator is this java class.
It is an Activator of the plug-in project
package de.cs3d.test.dsl;

import java.io.File;
import java.io.FileOutputStream;
import java.net.URL;
import java.util.Enumeration;

import org.apache.commons.io.IOUtils;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DefaultLogger;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.ProjectHelper;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;

/**
 * The activator class controls the plug-in life cycle
 */
public class Activator extends AbstractUIPlugin {

	// The plug-in ID
	public static final String PLUGIN_ID = "de.cs3d.test.dsl.language"; //$NON-NLS-1$

	// The shared instance
	private static Activator plugin;
	
	/**
	 * The constructor
	 */
	public Activator() {
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
		super.start(context);
		plugin = this;
		
		Bundle b = context.getBundle();
		
		Enumeration<URL> initFiles = b.findEntries(
				"/src/de/cs3d/test/dsl/", "*", true);
		
		File tempDir = new File("C:\\Language-test");
		//System.out.println("foo");
		
		
		//create common project
		File commonProject = new File(tempDir, "de.cs3d.test.dsl.language");
		commonProject.mkdir();
		
		//copy build file
		File antFile = new File(commonProject, "build.xml");
		IOUtils.copy(b.getEntry("META-INF/build.xml").openStream(),
				new FileOutputStream(antFile));
		
		//copy .project file
		/*File projectFile = new File(commonProject,".project");
		IOUtils.copy(b.getEntry(".project").openStream(),
				new FileOutputStream(projectFile));*/
		
		//create META-INF folder for project
		File metaInfFolder = new File(commonProject,"META-INF");
		metaInfFolder.mkdir();
		
		//copy manifest
		File manifestFile = new File(metaInfFolder, "MANIFEST.MF");
		IOUtils.copy(b.getEntry("META-INF/MANIFEST.MF").openStream(),
				new FileOutputStream(manifestFile));
		
		//create src folder for project
		File srcFolder =new File(commonProject,"src");
		@SuppressWarnings("unused")
		boolean succes= srcFolder.mkdir();
		
		//create packagehierachy in src folder
		File deFolder = new File(srcFolder, "de");
		deFolder.mkdir();
		
		File cs3dFolder = new File (deFolder,"cs3d");
		cs3dFolder.mkdir();
		
		File testFolder = new File(cs3dFolder, "test");
		testFolder.mkdir();
		
		File dslFolder= new File(testFolder, "dsl");
		dslFolder.mkdir();
		
		//create src-gen folder for project
		File srcGenFolder =new File(commonProject,"src-gen");
		srcGenFolder.mkdir();
		
		//create xtend-gen folder for project
		File xtendGenFolder =new File(commonProject,"xtend-gen");
		xtendGenFolder.mkdir();
		
		//create packagehierachy in src-gen folder
		/*File srcGendeFolder = new File(srcGenFolder, "de");
		srcGendeFolder.mkdir();
		
		File srcGencs3dFolder = new File (srcGendeFolder,"cs3d");
		srcGencs3dFolder.mkdir();
		
		File srcGentestFolder = new File(srcGencs3dFolder, "test");
		srcGentestFolder.mkdir();

		File srcGendslFolder = new File(srcGentestFolder,"dsl");
		srcGendslFolder.mkdir();
		
		new File(srcGendslFolder,"language").mkdir();*/
		
		// Copy File of from package to package
		while (initFiles.hasMoreElements()) {
			URL u = initFiles.nextElement();
			IOUtils.copy(u.openStream(), new FileOutputStream(
					new File(commonProject, u.getFile())));
		}
		
		//run ant script
		Project p = new Project();
		p.setUserProperty("ant.file", antFile.getAbsolutePath());
		p.setUserProperty("eclipse.home",
				"C:\\Users\\myUser\\private_indigo");
		/*p.init();
		ProjectHelper helper = ProjectHelper.getProjectHelper();
		p.addReference("ant.projectHelper", helper);
		helper.parse(p, antFile);
		p.executeTarget(p.getDefaultTarget());*/
		DefaultLogger consoleLogger = new DefaultLogger();
		consoleLogger.setErrorPrintStream(System.err);
		consoleLogger.setOutputPrintStream(System.out);
		consoleLogger.setMessageOutputLevel(Project.MSG_INFO);
		p.addBuildListener(consoleLogger);

		try {
			p.fireBuildStarted();
			p.init();
			ProjectHelper helper = ProjectHelper.getProjectHelper();
			p.addReference("ant.projectHelper", helper);
			helper.parse(p, antFile);
			p.executeTarget(p.getDefaultTarget());
			p.fireBuildFinished(null);
		} catch (BuildException e) {
			p.fireBuildFinished(e);
		}
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
		plugin = null;
		super.stop(context);
	}

	/**
	 * Returns the shared instance
	 *
	 * @return the shared instance
	 */
	public static Activator getDefault() {
		return plugin;
	}

}

Re: Building a xText projects temporal with Ant [message #836304 is a reply to message #836301] Wed, 04 April 2012 10:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
And the second point: Did you make sure the "." directory aka basedir is C:/language-test/de.cs3d.test.dsl.language

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #836311 is a reply to message #836304] Wed, 04 April 2012 10:36 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
Quote:

P.S: it does not help if you create folders
- de.cs3d.test.dsl.language
- de.cs3d.test.dsl.language.ui
and maybe others in
C:/language-test


de.cs3d.test.dsl.language.ui ist generated automatically wihout a problem also de.cs3d.test.dsl.language.test

Quote:

And the second point: Did you make sure the "." directory aka basedir is C:/language-test/de.cs3d.test.dsl.language

done.

as you can see in the Acivator the build-file is set into 'C:/language-test/de.cs3d.test.dsl.language'
and also when i mkdir() src-gen/de/ and following, the execption is still the same.
Re: Building a xText projects temporal with Ant [message #836317 is a reply to message #836311] Wed, 04 April 2012 10:47 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
Hi,

are you sure "." is the location of the buildfile? did you try to code an absolute path there?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #836324 is a reply to message #836317] Wed, 04 April 2012 10:56 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
Hi,

yes i tried, but the result stays the same.

~Paul
Re: Building a xText projects temporal with Ant [message #836339 is a reply to message #836324] Wed, 04 April 2012 11:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
very strange.

here is what i do.

(1) create a new Xtext project with wizard
(2) copy the stuff to c:/temp
(3) execute this ant file (from a location within my eclipse)
<project basedir="C:\temp\org.xtext.example.mydsl" default="gen" name="Generate Language">

	<property name="eclipse.home" value="C:\Users\dietrich\Downloads\eclipse-java-indigo-SR1-win32\eclipse"></property>
	
    <path id="gen.classpath">
        <fileset dir="${eclipse.home}/">
            <!--  antlr-2.7.7.jar
            antlr-3.0.1.jar-->
            <include name="plugins/org.antlr.generator*.jar"/>
            <include name="plugins/com.google.guava*.jar"/>
            <include name="plugins/com.google.inject*.jar"/>
            <include name="plugins/com.ibm.icu*.jar"/>
            <include name="plugins/de.itemis.xtext.antlr*.jar"/>
            <include name="plugins/org.antlr.runtime*.jar"/>
            <include name="plugins/org.apache.commons.cli*.jar"/>
            <include name="plugins/org.apache.commons.logging*.jar"/>
            <include name="plugins/org.apache.log4j*.jar"/>
            <include name="plugins/org.eclipse.emf.codegen.ecore*.jar"/>
            <include name="plugins/org.eclipse.emf.codegen*.jar"/>
            <include name="plugins/org.eclipse.emf.common*.jar"/>
            <include name="plugins/org.eclipse.emf.ecore.xmi*.jar"/>
            <include name="plugins/org.eclipse.emf.ecore*.jar"/>
            <include name="plugins/org.eclipse.emf.mwe.core*.jar"/>
            <include name="plugins/org.eclipse.emf.mwe.utils*.jar"/>
            <include name="plugins/org.eclipse.emf.mwe2.lib*.jar"/>
            <include name="plugins/org.eclipse.emf.mwe2.language*.jar"/>
            <include name="plugins/org.eclipse.emf.mwe2.launch*.jar"/>
            <include name="plugins/org.eclipse.emf.mwe2.runtime*.jar"/>
            <include name="plugins/org.eclipse.xpand*.jar"/>
            <include name="plugins/org.eclipse.xtend.typesystem.emf*.jar"/>
            <include name="plugins/org.eclipse.xtend.util.stdlib*.jar"/>
            <include name="plugins/org.eclipse.xtend*.jar"/>        
            <include name="plugins/org.eclipse.xtext.common.types_*.jar"/>
            <include name="plugins/org.eclipse.xtext.generator*.jar"/>
            <include name="plugins/org.eclipse.xtext.util*.jar"/>
            <include name="plugins/org.eclipse.xtext.xtend*.jar"/>
            <include name="plugins/org.eclipse.xtext*.jar"/>
            <include name="plugins/javax.inject*.jar"/>
            <include name="plugins/stringtemplate*.jar"/>
        </fileset>
    	<pathelement location="src"/>
    	<pathelement location="src-gen"/>
    </path>
    
    <target name="gen">
        <java classname="org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher" 
            classpathref="gen.classpath" fork="true" failonerror="true">
            <arg value="org.xtext.example.mydsl.GenerateMyDsl"/>
        </java>
    </target>
</project>


and hey: it works like a charm.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #836366 is a reply to message #836339] Wed, 04 April 2012 11:55 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
Did you create an plug-in-project and added xText nature or
did you directly choose New>Xtext Project, where eclipse generates *.ui and *.test immediately?
Re: Building a xText projects temporal with Ant [message #836372 is a reply to message #836366] Wed, 04 April 2012 12:05 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
i used the wizard. but as i said in my previous post

there folders HAVE TO exist

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #836397 is a reply to message #836372] Wed, 04 April 2012 12:43 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
Hi,

i finally set up a new xText Project also with the wizard, but it doesn't work either. I changed the grammatic to the "Hello World" example which is auto-generated, but still no success.
Which directories did you create in 'C:\temp' ? Did you use the activator class?
Re: Building a xText projects temporal with Ant [message #836407 is a reply to message #836397] Wed, 04 April 2012 12:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
hi,

no i do not use the activator.
i copy everything that is created by the wizard.
=> i think there must be something wrong with your activator thing. did you try to set fork = false in the ant file and debug
the StandaloneSetup.setPlatformUri stuff?????

~Christian

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #836427 is a reply to message #836407] Wed, 04 April 2012 13:33 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
I tried,
but Mwe2Runner doesn't find de.cs3d.test.dsl.GenerateLanguage module anymore.
Re: Building a xText projects temporal with Ant [message #836431 is a reply to message #836427] Wed, 04 April 2012 13:35 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
I need the Activator later for the RCP-project, where i want to build and use the project
Re: Building a xText projects temporal with Ant [message #836436 is a reply to message #836431] Wed, 04 April 2012 13:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
hmmm.

what is you directory structure in the C:/lanuage-test project when the workflow is executed. is the error message really the same?
does it work if you do NOT use the Activator Stuff?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #836457 is a reply to message #836436] Wed, 04 April 2012 14:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
P.S:with my build file with the (absolute) paths included and throwing out the create file stuff it works as well with the activator (copied the stuff created by the wizard manually)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #836461 is a reply to message #836436] Wed, 04 April 2012 14:05 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
Quote:
what is you directory structure in the C:/lanuage-test project when the workflow is executed.


'C:/Language-test' before the execution via Activator:
{Empty}

'C:/Language-text' after Activator before ant file:


  • de.cs3d.test.dsl.language


'C:/Language-text/de.cs3d.test.dsl.language'

  • META-INF/MANIFEST.MF
  • src/de/cs3d/test/dsl/{empty}
  • src-gen/{empty}
  • xtend-gen/{empty}
  • build.xml


'src/de/cs3d/test/dsl/'


  • Activator.java
  • GenerateLanguage.mwe2
  • Language.xtext



'C:/Language-text' after ant file:


  • de.cs3d.test.dsl.language
  • de.cs3d.test.dsl.language.ui
  • de.cs3d.test.dsl.language.tests


'src/de/cs3d/test/dsl'
contains also LanguageStandaloneSetup, etc
as well as folders like 'formatting/' 'generator/' etc

'src-gen/de/cs3d/test/dsl'
contains Language.genmodel and .ecore etc
as well as folders like 'parser/' ; 'serializer/'etc
but not the 'language' folder

Then you see the error message, which is in log.txt.

If i take this hierarchy an execute via commandline:
"C:\Language-test\de.cs3d.test.dsl.language>C:\Users\PKD\Downloads\apache-ant-1.8.3-bin\apache-ant-1.8.3\bin\ant -f build.xml"

the error message is
gen:
     [java] 0    INFO  StandaloneSetup    - Registering platform uri 'C:\Language-test'
     [java] 260  INFO  StandaloneSetup    - Adding generated EPackage 'org.eclipse.xtext.xbase.XbasePackage'
     [java] 345  ERROR Mwe2Launcher       - Problems instantiating module de.cs3d.test.dsl.GenerateLanguage: java.lang.r
eflect.InvocationTargetException
     [java] java.lang.RuntimeException: Problems instantiating module de.cs3d.test.dsl.GenerateLanguage: java.lang.refle
ct.InvocationTargetException
     [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:90)
     [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
     [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:76)
     [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:771)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
     [java]     at org.apache.tools.ant.Target.execute(Target.java:392)
     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:413)
     [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
     [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
     [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
     [java]     at org.apache.tools.ant.Main.runBuild(Main.java:811)
     [java]     at org.apache.tools.ant.Main.startAnt(Main.java:217)
     [java]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
     [java]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
     [java] Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
     [java]     at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:56)
     [java]     at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngin
e.java:143)
     [java]     at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
     [java]     at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)

     [java]     at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngin
e.java:142)
     [java]     at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
     [java]     at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)

     [java]     at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:80)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
     [java]     at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)

     [java]     at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:62)
     [java]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:88)
     [java]     ... 30 more
     [java] Caused by: java.lang.reflect.InvocationTargetException
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java]     at java.lang.reflect.Method.invoke(Unknown Source)
     [java]     at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
     [java]     ... 55 more
     [java] Caused by: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.io.IOExcept
ion: The path '/org.eclipse.xtext.xbase/model/Xbase.genmodel' is unmapped
     [java]     at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:31
5)
     [java]     at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
     [java]     at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
     [java]     at org.eclipse.emf.mwe.utils.GenModelHelper.registerGenModel(GenModelHelper.java:34)
     [java]     at org.eclipse.emf.mwe.utils.StandaloneSetup.addRegisterGenModelFile(StandaloneSetup.java:340)
     [java]     ... 60 more
     [java] Caused by: java.io.IOException: The path '/org.eclipse.xtext.xbase/model/Xbase.genmodel' is unmapped
     [java]     at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResource
URIHandlerImpl.java:462)
     [java]     at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConvert
erImpl.java:350)
     [java]     at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1262)
     [java]     at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:255)
     [java]     at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:270)
     [java]     ... 63 more

BUILD FAILED
C:\Language-test\de.cs3d.test.dsl.language\build.xml:45: Java returned: 1

Total time: 9 seconds


Quote:

P.S:with my build file with the (absolute) paths included and throwing out the create file stuff it works as well with the activator (copied the stuff created by the wizard manually)


i use absolute paths as well now, i will try with throwing out the create file stuff
Re: Building a xText projects temporal with Ant [message #836486 is a reply to message #836461] Wed, 04 April 2012 14:39 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
can you post the whole acitvator file again or post what execatly you threw out?
Re: Building a xText projects temporal with Ant [message #836559 is a reply to message #836486] Wed, 04 April 2012 16:17 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
Here is the code, but it doubt this is the problem

public void start(BundleContext context) throws Exception {
		super.start(context);
		plugin = this;
Bundle b = context.getBundle();
		
		Enumeration<URL> initFiles = b.findEntries(
				"/src/de/cs3d/test/dsl/", "*", true);
		
		
		
	
		
		//run ant script
		Project p = new Project();
		p.setUserProperty("ant.file", "C:\\Users\\dietrich\\Downloads\\mcp56\\eclipse2\\org.xtext.example.mydsl2.ui\\META-INF\\build.xml");
		p.setUserProperty("eclipse.home",
				"C:\\Users\\dietrich\\Downloads\\eclipse-java-indigo-SR1-win32\\eclipse");
		/*p.init();
		ProjectHelper helper = ProjectHelper.getProjectHelper();
		p.addReference("ant.projectHelper", helper);
		helper.parse(p, antFile);
		p.executeTarget(p.getDefaultTarget());*/
		DefaultLogger consoleLogger = new DefaultLogger();
		consoleLogger.setErrorPrintStream(System.err);
		consoleLogger.setOutputPrintStream(System.out);
		consoleLogger.setMessageOutputLevel(Project.MSG_INFO);
		p.addBuildListener(consoleLogger);

		try {
			p.fireBuildStarted();
			p.init();
			ProjectHelper helper = ProjectHelper.getProjectHelper();
			p.addReference("ant.projectHelper", helper);
			helper.parse(p, new File("C:\\Users\\dietrich\\Downloads\\mcp56\\eclipse2\\org.xtext.example.mydsl2.ui\\META-INF\\build.xml"));
			p.executeTarget(p.getDefaultTarget());
			p.fireBuildFinished(null);
		} catch (BuildException e) {
			p.fireBuildFinished(e);
		}
	}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #836621 is a reply to message #836559] Wed, 04 April 2012 18:03 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
Thanks,

i think there is maybe a problem with the mwe2 file or maybe xText or maybe it there is in the beginning a path missing.
Can you try, if yours is also build if you have an folder at 'C:/'?
Re: Building a xText projects temporal with Ant [message #836626 is a reply to message #836621] Wed, 04 April 2012 18:05 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14673
Registered: July 2009
Senior Member
i am at c:/temp, using C:/ will not work for performance reasons. but that should not be the problem. did you try it with a brand new mydsl project?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Building a xText projects temporal with Ant [message #837055 is a reply to message #836626] Thu, 05 April 2012 08:12 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
yes, two times already, but no difference.
Re: Building a xText projects temporal with Ant [message #837097 is a reply to message #837055] Thu, 05 April 2012 09:09 Go to previous messageGo to next message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
The problem appears just for the generated .java file which represent my grammar. I think at this point
gen:
     [java] 0    INFO  StandaloneSetup    - Registering platform uri 'C:\Foo-test'
     [java] 1252 INFO  DirectoryCleaner   - Cleaning C:\Foo-test\org.xtext.example.foobar\..\org.xtext.example.foobar\src-gen
     [java] 1273 INFO  DirectoryCleaner   - Cleaning C:\Foo-test\org.xtext.example.foobar\..\org.xtext.example.foobar.ui\src-gen
     [java] 1590 INFO  LanguageConfig     - generating infrastructure for org.xtext.example.foobar.Foo with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, EcoreGeneratorFragment, ParseTreeConstructorFragment, ResourceFactoryFragment, XtextAntlrGeneratorFragment, JavaValidatorFragment, ImportNamespacesScopingFragment, QualifiedNamesFragment, BuilderIntegrationFragment, GeneratorFragment, FormatterFragment, LabelProviderFragment, OutlineTreeProviderFragment, QuickOutlineFragment, QuickfixProviderFragment, JavaBasedContentAssistFragment, XtextAntlrUiGeneratorFragment, Junit4Fragment, TypesGeneratorFragment, XbaseGeneratorFragment, CodetemplatesGeneratorFragment


the .java should exist already, maybe at dies point before the error in
[java] 4682 INFO  GenModelHelper     - Registered GenModel 'ht tp:// ww w.xtext.org/example/foobar/Foo' from 'file:/C:/Foo-test/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/Foo.genmodel'
     [java] org.eclipse.emf.common.util.WrappedException: java.io.IOException: The path '/org.xtext.example.foobar/src-gen/org/xtext/example/foobar/foo/FooPackage.java' is unmapped

appear, There is a problem, what is not mentioned.

Does this fact bring up an idea to somebody, where the error could be nested?

Re: Building a xText projects temporal with Ant [message #839974 is a reply to message #837097] Mon, 09 April 2012 13:51 Go to previous message
Paul Deuster is currently offline Paul DeusterFriend
Messages: 15
Registered: April 2012
Junior Member
Addition:

Does somebody has an idea, why the classes (like Greeting.java)of my rules are not generated?
Previous Topic:Problem with Long Dsl
Next Topic:Partial Embedded Xtext Editor
Goto Forum:
  


Current Time: Tue Apr 30 02:07:30 GMT 2024

Powered by FUDForum. Page generated in 0.05415 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top