The values after the colon for the lines starting with SetName, SetID and Version must be written to the new file META-INF/MANIFEST.MF:
SetName:bean generator SetID:bean.generator Controller:bean.generator/control.pat Version:1.0 *Appdef: name="sample.appdef" description="bean generator" Filter: type="appdef" resource="file" enablesFor="1"
Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: value of SetName Bundle-SymbolicName: value of SetID Bundle-Version: value of Version Bundle-Localization: plugin Bundle-Vendor: Require-Bundle: org.eclipse.jet Bundle-ClassPath: .,bin/
The value after the colon of the Controller line must be written to the new file plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
id=""
name=""
point="org.eclipse.jet.transform">
<transform
startTemplate="value of Controller"
templateLoaderClass="org.eclipse.jet.compiled._jet_transformation">
<description></description>
<tagLibraries>
<importLibrary
id="com.ibm.xtools.jet.dptk.dptk"
usePrefix=""
autoImport="true"/>
</tagLibraries>
</transform>
</extension>
</plugin>
A new folder jet2java must be created in the root of the project. In addition, a new file .classpath must be added to the root of the project. Note that the .classpath file refers to this folder (highlighted in bold).
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="jet2java/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
To add the JET natures and builders to the project, the file .project must be modified to include the bold lines in the following code:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>existing project name</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jet.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.ibm.dptk.patternBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.jet.jet2Nature</nature>
<nature>com.ibm.dptk.patternNature</nature>
</natures>
</projectDescription>
To enable the JET compiler to recognize PAT files as JET templates, the file .settings/org.eclipse.jet.prefs must be created with the following content:
eclipse.preferences.version=1 org.eclipse.jet.projectPrefs=true org.eclipse.jet.templateExt=pat,jet
To permit proper exporting of the pattern to a JAR (the functional equivalent of a DPTK PATZIP file), create the file build.properties in the project root with the following content:
source.. = jet2java/
output.. = bin/
bin.includes = .,\
plugin.xml,\
META-INF/,\
**/*.pat,\
**/*.jet
src.includes = .project,\
build.properties,\
.classpath