summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-04-20 13:18:46 (EDT)
committer pelder2006-04-20 13:18:46 (EDT)
commit3608e0b4d10fa827eebf0b2851b0d24014537249 (patch)
treec214d70f89387c410f66be4ae9d058a9c27d5f4f
parent6c5221eeca53d1b31d87725cc173001c6b8d2e16 (diff)
downloadorg.eclipse.jet-3608e0b4d10fa827eebf0b2851b0d24014537249.zip
org.eclipse.jet-3608e0b4d10fa827eebf0b2851b0d24014537249.tar.gz
org.eclipse.jet-3608e0b4d10fa827eebf0b2851b0d24014537249.tar.bz2
[137347] Add attributes to 'project' element in input model to allow specification of new project id, display name, version and vendor. Also included an XSD describing the expected input.
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/newproject.xsd81
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/sample.xml2
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet8
-rw-r--r--transforms/org.eclipse.jet.transforms.newproject/templates/project/manifest.mf.jet8
4 files changed, 92 insertions, 7 deletions
diff --git a/transforms/org.eclipse.jet.transforms.newproject/newproject.xsd b/transforms/org.eclipse.jet.transforms.newproject/newproject.xsd
new file mode 100644
index 0000000..55c11d1
--- /dev/null
+++ b/transforms/org.eclipse.jet.transforms.newproject/newproject.xsd
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="org.eclipse.jet.transforms.newproject" xmlns="org.eclipse.jet.transforms.newproject">
+
+ <xsd:element name="newProjectModel" type="newProjectModel"></xsd:element>
+
+ <xsd:complexType name="newProjectModel">
+ <xsd:sequence minOccurs="1">
+ <xsd:element name="project" type="project" minOccurs="1"
+ maxOccurs="1">
+ </xsd:element>
+ <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="project">
+ <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
+ <xsd:attribute name="bundleName" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation>
+ The display name of the resulting JET project. If
+ not specified, this defaults to the value specified
+ in the 'name' parameter.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="bundleSymbolicName" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation>
+ The id of the JET project. If not specified, this
+ defaults to the name of the project.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="bundleVersion" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation>
+ The initial version number of the project. If not
+ specified, this defaults to 1.0.0.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="bundleVendor" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation>
+ The Vendor of the JET Project. If not specified,
+ this defaults to the empty string.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="binDir" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation>
+ The directory which will contain binary (compiled)
+ Java classes. If not specified, the default is
+ 'bin'.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="jet2javaDir" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation>The directory into which Java source files corresponding to JET templates will be written. The default is 'jet2java'.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="templatesDir" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation>The directory to which initial tempates will be written. The default if 'templates'.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="templateLoader" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation>The fully qualified Java Class name of the template loader class. The default is 'org.eclipse.jet.compiled._jet_transformation'.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="startTemplate" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation>The path of the start template. This path is relative the the tempates directory specified by templatesDir. The default is 'main.jet'.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:anyAttribute namespace="##other"></xsd:anyAttribute>
+ </xsd:complexType>
+</xsd:schema> \ No newline at end of file
diff --git a/transforms/org.eclipse.jet.transforms.newproject/sample.xml b/transforms/org.eclipse.jet.transforms.newproject/sample.xml
index 62663fd..e17f4dd 100644
--- a/transforms/org.eclipse.jet.transforms.newproject/sample.xml
+++ b/transforms/org.eclipse.jet.transforms.newproject/sample.xml
@@ -1,3 +1,3 @@
<newProjectModel>
- <project name="foo.bar"/>
+ <project name="foo.bar" bundleName="Foo Bar Project" bundleSymbolicName="foo.bar.id"/>
</newProjectModel> \ No newline at end of file
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
index 44e1b05..b2d7103 100644
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
+++ b/transforms/org.eclipse.jet.transforms.newproject/templates/createBasicProject.jet
@@ -4,7 +4,7 @@
--- Define additional attributes for the current root element
- <c:setVariable select="/newProjectModel/project" var="project"/>
+ <c:setVariable select="/*[local-name() = 'newProjectModel']/project" var="project"/>
--- Iterate over each nested project element
--- Define additional attributes for the current project element
@@ -12,7 +12,11 @@
<c:if test="not($project/@jet2javaDir)"><c:set select="$project" name="jet2javaDir">jet2java</c:set></c:if>
<c:if test="not($project/@templatesDir)"><c:set select="$project" name="templatesDir">templates</c:set></c:if>
<c:if test="not($project/@templateLoader)"><c:set select="$project" name="templateLoader">org.eclipse.jet.compiled._jet_transformation</c:set></c:if>
- <c:if test="not($project/@startTemplate)"><c:set select="$project" name="startTemplate">control.jet</c:set></c:if>
+ <c:if test="not($project/@startTemplate)"><c:set select="$project" name="startTemplate">main.jet</c:set></c:if>
+ <c:if test="not($project/@bundleName)"><c:set select="$project" name="bundleName"><c:get select="$project/@name"/></c:set></c:if>
+ <c:if test="not($project/@bundleSymbolicName)"><c:set select="$project" name="bundleSymbolicName"><c:get select="$project/@name"/></c:set></c:if>
+ <c:if test="not($project/@bundleVersion)"><c:set select="$project" name="bundleVersion">1.0.0</c:set></c:if>
+ <c:if test="not($project/@bundleVendor)"><c:set select="$project" name="bundleVendor"></c:set></c:if>
*** Traverse the model and generate artifacts
--- Generate artifacts for the current root element
diff --git a/transforms/org.eclipse.jet.transforms.newproject/templates/project/manifest.mf.jet b/transforms/org.eclipse.jet.transforms.newproject/templates/project/manifest.mf.jet
index 2845a67..f235531 100644
--- a/transforms/org.eclipse.jet.transforms.newproject/templates/project/manifest.mf.jet
+++ b/transforms/org.eclipse.jet.transforms.newproject/templates/project/manifest.mf.jet
@@ -1,8 +1,8 @@
-<%@taglib prefix="c" id="org.eclipse.jet.controlTags"%>Manifest-Version: 1.0
+Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: <c:get select="$project/@name" />
-Bundle-SymbolicName: <c:get select="$project/@name" />;singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Name: <c:get select="$project/@bundleName" />
+Bundle-SymbolicName: <c:get select="$project/@bundleSymbolicName" />;singleton:=true
+Bundle-Version: <c:get select="$project/@bundleVersion"/>
Bundle-Localization: plugin
Bundle-Vendor:
Require-Bundle: org.eclipse.jet