Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] tycho-eclipserun-plugin antRunner task

Hi everyone,

I'm trying right now to generate model java code from an ecore model and I'm able to du this with an ant task:

java -jar /Applications/eclipse/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar -application org.eclipse.ant.core.antRunner -nosplash -buildfile build.xml

Ant task:

<?xml version="1.0" encoding="UTF-8"?>
<project default="codegen" basedir="..">
<dirname property="antfile.dir" file="${ant.file}"/>
    
  <!-- Global properties -->
<property name="main.directory" location="${antfile.dir}/.."/>
<property name="output.directory" location="${main.directory}"/>
<property name="source.directory" value="src"/>
<property name="genJDKLevel" value="5.0"/>

<target name="codegen">

  <!-- A macrodef makes it easier to generate code for multiple models in one script. -->
<macrodef name="ecore2Java">
<attribute name="modelName"/>
<element name="settings"/>
<sequential>
<emf.Ecore2Java
model="${main.directory}/ecore2java/model/@{modelName}.ecore"
genModel="${output.directory}/emf/@{modelName}.genmodel"
modelProject="${output.directory}"
modelProjectFragmentPath="${source.directory}"
modelPluginID="@{modelName}.model"
copyright="This is my code."
jdkLevel="${genJDKLevel}">
<settings/>
</emf.Ecore2Java>
</sequential>
</macrodef>

<!-- Generating the code for the library model -->
<ecore2Java modelName="library">
<settings>
<arg line="-package http:///library.ecore org.examples Library"/>
</settings>
</ecore2Java>

</target>
</project>

Now I'm trying to do the same with maven and tycho-eclipserun-plugin:

<plugin>
            <groupId>org.eclipse.tycho.extras</groupId>
            <artifactId>tycho-eclipserun-plugin</artifactId>
            <version>0.16.0</version>
            <configuration>
                <appArgLine>-application org.eclipse.ant.core.antRunner -nosplash -buildfile build.xml</appArgLine>
                <dependencies>
               <dependency>
                        <artifactId>org.eclipse.ant.core</artifactId>
                        <type>eclipse-plugin</type>
                    </dependency>
                    <dependency>
                        <artifactId>org.eclipse.emf.ant</artifactId>
                        <type>eclipse-plugin</type>
                    </dependency>
                    <dependency>
                        <artifactId>org.eclipse.emf.importer.ecore</artifactId>
                        <type>eclipse-plugin</type>
                    </dependency>
                </dependencies>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>eclipse-run</goal>
                    </goals>
                    <phase>compile</phase>
                </execution>
            </executions>
        </plugin>

And get an error:

[emf.Ecore2Java] org.eclipse.core.internal.resources.ResourceException: Invalid project description.
[emf.Ecore2Java]  at org.eclipse.core.internal.resources.Project.checkDescription(Project.java:175)
[emf.Ecore2Java]  at org.eclipse.core.internal.resources.Project.assertCreateRequirements(Project.java:53)
[emf.Ecore2Java]  at org.eclipse.core.internal.resources.Project.create(Project.java:287)


Did anyone know what's about?
Thanks for help!
Artem.



Back to the top