Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [JET]How to compile JET templates headless using ANT(How to compile JET templates headless using ANT)
[JET]How to compile JET templates headless using ANT [message #547636] Mon, 19 July 2010 08:36
hintcnuie  is currently offline hintcnuie Friend
Messages: 7
Registered: July 2010
Junior Member
I am trying to compile JET templates headless using ANT, but I always met kinds of issues.
I know JET provides a Ant task <jet.compile> task , but as for how to use this task, there is tricks and difficulites.From http:// _headless_build and I know that the Jet project (say, A) should be placed under a workspace, then use Eclipse Ant runner to build it, but I always meet issues.
my build files:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== 
     compile JET template files into java classes file format.                                                         
     ====================================================================== -->
<project name="compileJET" default="init" basedir=".">
	<property file="" />
	<property name="temp-workspace" value="${basedir}/tmpWorkspace"/>
	<target name="init">
		<mkdir dir="${temp-workspace}" />
		<copy todir="${temp-workspace}">
			<fileset dir="../">
				<include name="**" />
				<include name="**"/>
			<fileset dir=".">
				<include name="pde_build_compile.xml"/>

    	        This target actually executes the PDE Build process by launching the
    	        Eclipse antRunner application.
	<target name="pde-build" depends="init">
		<echo message="Executing ${eclipseLocation}/plugins/org.eclipse.equinox.launcher_${equinoxLauncherPluginVersion}.jar" />
		<property name="builder" value="${temp-workspace}"/>
		<java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true">
			<arg value="-application" />
			<arg value="org.eclipse.ant.core.antRunner" />
			<arg value="-buildfile" />
			<arg value="${temp-workspace}/pde_build_compile.xml" />
			<arg value="-Dtimestamp=${timestamp}" />
				<pathelement location="${eclipseLocation}/plugins/org.eclipse.equinox.launcher_${equinoxLauncherPluginVersion}.jar" />

the the pde_build_compile project:
<project name="Build All Elements" default="main">

<property name="builder" location="${user.dir}"/>
<property name="builderDirectory" location="${builder}"/>

<available property="customTargets" file="${builder}/customTargets.xml" value="${builder}/customTargets.xml"/>

<!-- ===================================================================== -->
<!-- main entry point to setup, fetch, generate, build etc. Use -->
<!-- the customTargets.xml to modify the build behaviour. -->
<!-- ===================================================================== -->

<!-- ******* add in the descriptions for each of the top level targets to teh target decl -->
<target name="main" description="the main build target">	
  	<antcall target="preBuild" /> 


<!-- ===================================================================== -->
<!-- Steps to do before starting the build.  Typical setup includes -->
<!-- fetching the map files and building the directory.  -->
<!-- ===================================================================== -->
<target name="preBuild">
	<echo >compile project </echo>
  <jet.compile project="" destdir="jet2java" >
    <srcdir dir="." includes="templates/**/*.jet"/>
  <jet.compile project="" destdir="jet2java" >
    <srcdir dir="." includes="templates/**/*.jet"/>

When I run the compileJET build, it create folders tree:
The returned result is:
Buildfile: D:\autobuild\\compile.xml

     [copy] Copying 1 file to D:\autobuild\\tmpWorkspace

     [echo] Executing C:/IBM/SDP/plugins/org.eclipse.equinox.launcher_1.0.101.R3
     [java] 00:00.40 WARNING [Thread:main] org.eclipse.emf.ecore.plugin.Extensio
nParserRegistryReader readElement
     [java]   Both '' and ''
register an extension parser for 'http'
     [java] Buildfile: D:\autobuild\
     [java] main:
     [java] preBuild:
     [java]      [echo] compile project
     [java] BUILD FAILED
     [java] D:\autobuild\\tmpWorkspace\pde_build_compile.xm
l:16: The following error occurred while executing this line:
     [java] D:\autobuild\\tmpWorkspace\pde_build_compile.xm
l:26: project does not exist
     [java] Total time: 0 seconds

D:\autobuild\\compile.xml:29: Java returned: 13

Would anyone have use feature before and give me some advice?
Previous Topic:[Acceleo 3] how to Define queries in many modules
Next Topic:[Acceleo 3] Intersection on 2 list return string, and not the objects [Solved]
Goto Forum:

Current Time: Tue Jan 21 16:33:18 GMT 2020

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

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

Back to the top