15
Copyright 2005 Symbian Software Ltd. 1 Lars Kurth Technology Architect, Core Toolchain The Template Engine CDT Developer Conference, Oct 2005

Copyright 2005 Symbian Software Ltd. 1 Lars Kurth Technology Architect, Core Toolchain The Template Engine CDT Developer Conference, Oct 2005

Embed Size (px)

Citation preview

Copyright 2005 Symbian Software Ltd. 1

Lars KurthTechnology Architect, Core Toolchain

The Template EngineCDT Developer Conference, Oct 2005

Copyright 2005 Symbian Software Ltd. 2

Background

• Symbian joined the Eclipse Foundation as an Add-in Provider in March 2005

• Since then we have made some contributions to CDT, in particular to the MBS

• Carbide.C++ Express Edition is the first Eclipse/CDT-based C++ Development Environment for Symbian OS. This product was co-developed between Symbian and Nokia.

• Some interesting technology has been developed as part of this co-operation

• This has been a learning exercise for Symbian

• Symbian would like to take on more responsibility in the CDT community

Copyright 2005 Symbian Software Ltd. 3

The Proposal

• Symbian donate the Template Engine to CDT

• Symbian would become code committer for the Template Engine

• Time-scales for CDT 3.1 look too tight, but for CDT 3.2 they look achievable

Copyright 2005 Symbian Software Ltd. 4

Symbian Internal Status

In principle agreement to the proposal by Symbian management team

Legal process to donate code to CDT has been started

Formal approval from Symbian legal team and management still needed

Full-time role for committer yet to be created

Some technical issues to be resolved (more details later)

… Dependencies, © of files, Java v5 compliant code

… Most tests use Rational Functional Tester

… Could be resolved after donation or as pre-requisite

Copyright 2005 Symbian Software Ltd. 5

Template Engine - Overview

• Data driven UI generator and processing mechanism

• Base classes for wizards that interface with the Template Engine

• Template Test Wizard to aid development of Templates

• Main Symbian Use-case are:

… Creation of projects with content (individual ones or groups of projects)

… Adding resources to the workspace

• Extension points to:

… Associate templates with a wizard

… Add new processes to the process mechanism

… Future: Add new UI controls or layouts to the UI generator

Copyright 2005 Symbian Software Ltd. 6

What is a Template?

• A set of sources and binaries in a directory

• Including a directory structure

• Source files may contain macros, e.g. $(baseName), that are replaced during processing of the template

• A Template Descriptor file that describes the

… User Interface

… Processes to be performed on files within the template

Copyright 2005 Symbian Software Ltd. 7

UI Generation

• UI organized in pages

… Currently only simple pages supported with list layout supported

… Help, Description, Icon, etc.

• UI Elements consist of

… Label, Description, Input Validation, Default Value, etc.

… UI Control (7 different ones)

• Each UI Element maps onto a macro that can be used in the processing mechanism

• Architected to be extensible

Copyright 2005 Symbian Software Ltd. 8

Processed files, project properties,

etc.

The Processing Mechanism - Overview

Generated UIPages

Description of Processes in Template Descriptor:

(1) Processes can use macros and files from template as arguments

(2) Processes are added through an extension point(3) Processes can be executed conditionally

Macro Value Store

A wizard may move values provided by custom wizard pages, e.g. from CProjectPlatformPage, into the value store

Sources andbinaries in template

Processes executed in order as defined in Template Descriptor

Copyright 2005 Symbian Software Ltd. 9

The Processing Syntax - Sample<process type="com.symbian.cdt.templateengine.NewProject">

<simple name="name" value="$(projectName)"/>

<simple name="targetType" value="$(targetType)"/>

<simple name="uid2" value="$(uid2)"/>

</process>

<process type="com.symbian.cdt.templateengine.CreateSourceFolder">

<simple name="projectName" value="$(projectName)"/>

<simple name="path" value="$(sourceDir)"/>

</process>

<process type="com.symbian.cdt.templateengine.AddFiles">

<simple name="projectName" value="$(projectName)"/>

<complex-array name="files">

<element>

<simple name="source" value="inc/Basename.h"/>

<simple name="target" value="$(incDir)/$(baseName).h"/>

<simple name="replaceable" value="true"/>

</element>

Macro from outsidethe Template Engine

Macro from generated UI

Apply macro processing to the source file itself.

Refers to process that add files to a project.

Copyright 2005 Symbian Software Ltd. 10

Adding Processes

• Processes are added through an extension point• Process signatures are defined in extension point• Processes implement an abstract base class, called ProcessRunner• The class must marshal arguments from the Template Descriptor (via ProcessArgument[]) to the function that implements the process• Arguments can be integral types (simple), structured types (complex) and arrays of both.

Copyright 2005 Symbian Software Ltd. 11

Wizard Base Classes

• Generic Template driven wizards (TemplateDrivenWizard)

• Wizard where a Template is chosen from a list (TemplatesChoiceWizard)

• Both wizards allow for insertion of custom wizard pages (not generated) before and after generated pages

• A wizard page which enables choosing templates (TemplateListSelectionPage)

… Filtering can be applied to only show templates that are relevant for a particular wizard

Copyright 2005 Symbian Software Ltd. 12

Adding Templates

• Templates added through an extension point

• Templates are associated to specific wizards

• Templates can be filtered on …

… Arbitrary patterns

… On project type, for project wizards

Copyright 2005 Symbian Software Ltd. 13

Extra Functionality

• Test Wizard to make it easier to develop, validate and test templates

• A facility to share template values between templates, including a preference page to edit these values

… Useful for © notices, author name and other entries that may be shared between Templates

Copyright 2005 Symbian Software Ltd. 14

Potential Technical Issues

• Heavy dependency on Java v5.0 syntax, in particular

… typesafe collection class syntax

… Java v5.0 iterator syntax

• Small extent of dependency on other Symbian components

• © notices in header files and some branding in UIs

• Most tests are performed using Rational Functional Tester

• Template Test Wizard is not of product quality (currently only used as internal tool)

• MBS Wizard Pages not designed to be incorporated into other wizards hard to use MBS wizards with Template Engine wizard base classes

Copyright 2005 Symbian Software Ltd. 15

Demo…