Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Texo/Developing"

(Setup Development environment)
(CVS)
Line 15: Line 15:
 
* tests: the plugins used for testing
 
* tests: the plugins used for testing
 
* develop: the developer environment setup
 
* develop: the developer environment setup
 +
 +
== Commit Mailing List ==
 +
To subscribe to the commit mailing list visit this page: [https://dev.eclipse.org/mailman/listinfo/texo-commit https://dev.eclipse.org/mailman/listinfo/texo-commit}.
  
 
== Setup Development environment ==
 
== Setup Development environment ==

Revision as of 05:54, 29 October 2010

Introduction

This page outlines how to setup a development environment to develop in Texo.

CVS

The Texo project can be found in cvs in this location:

  • dev.eclipse.org
  • /cvsroot/modeling
  • org.eclipse.emf/org.eclipse.emf.texo

Within this last path you will find several subfolders:

  • features: contains the feature projects
  • plugins: contains the plugins
  • releng: the build setup
  • tests: the plugins used for testing
  • develop: the developer environment setup

Commit Mailing List

To subscribe to the commit mailing list visit this page: [https://dev.eclipse.org/mailman/listinfo/texo-commit https://dev.eclipse.org/mailman/listinfo/texo-commit}.

Setup Development environment

Texo has the following dependencies:

  • Eclipse 3.6 (Helios)
  • EMF 2.6
  • XPand
  • MWE

Eclipse 3.6 can be downloaded from here, as Eclipse 3.6 is still in development go to the 'development builds' tab.

EMF is possibly already present as part of the Eclipse 3.6 install.

XPAND/MWE and EMF 2.6 can be installed through the update manager (type the names mwe, xpand etc. in the search box): http://download.eclipse.org/releases/helios

Then to get all the development projects do the following:

  1. Download the Texo Develop project from the above CVS location (the project can be found in the org.eclipse.emf/org.eclipse.emf.texo/develop folder in CVS).
  2. Open the Texo Develop project and right click on texo.psf and select 'Import Project Set'. Say yes when the system asks to overwrite Texo Develop.
  3. The development projects will now be downloaded and created.

The development projects are organized in working sets which you can enable.

As a next step import the clean up and formatter profiles. These can be found in the Texo Develop project.

  • Goto Window > Preferences
  • To Java > Code Style > Formatter and click import, find the texo_formatter.xml in the Texo Develop project on your file system and import it
  • To Java > Code Style > Clean Up and click import, find the texo_cleanup.xml in the Texo Develop project on your file system and import it

Testing

This is by far the most important must-do. Code and functionality must be supported with Junit test cases. Each plugin should have an equivalent *.test plugin which contains testcases which test the functionality.

Although many developers like testng, Texo uses Junit because it is slightly better supported by Eclipse and Eclipse build environments.

Texo currently does not use code coverage tools. There is however the wish to add this in the future.

JDK 1.5

Texo should be compiled for the JDK 1.5 platform. This is normally setup correctly in each plugin.

Code Formatting

The plugin projects have been set up to format the code using the Texo profile when saving a file. The Texo profiles can be found in the develop project.

Copyright

All files should start with a copy right section like this:

/**
 * <copyright>
 *
 * Copyright (c) 2009, 2010 Springsite BV (The Netherlands) and others
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Martin Taal - Initial API and implementation
 *
 * </copyright>
 *
 * $Id: AbstractModelFeatureMapEntry.java,v 1.2 2010/01/30 15:59:35 mtaal Exp $
 */

(copyright holder and contributors ofcourse set to the one creating/adapting the file)

Javadoc, Documentation

Javadoc:

  • All public and protected methods must have javadoc, except for getters and setters which do not do more than just set/get a value.
  • There must be javadoc in the class header.

The following guidelines should be followed when documenting code:

  • comment special cases in the code or special conditions/invariants
  • rather use clear and describing variable and method names than comments
  • always add comments to empty catch blocks
  • use common sense

Formatting and compiling settings

Each plugin project has to use the same settings for formatting as in the org.eclipse.emf.texo project. Specifically in the project properties:

  • Java Code Style > Clean Up: 'Enable project specific settings' has to be checked and use the Texo profile (which can be found in the Texo Develop project).
  • Java Code Style > Formatter: 'Enable project specific settings' has to be checked and use the Texo profile (which can be found in the Texo Develop project).
  • Java Compiler: 'Enable project specific settings' has to be checked and use the J2SE-1.5 as specified in the plugin (see below)
  • Java Editor > Save Action: 'Enable project specific settings' has to be checked and has to be set in the same way as in the org.eclipse.emf.texo project
  • Plug-in Development > Plug-in Manifest Compiler: has to be set in the same was as in the org.eclipse.emf.texo project

Plugin and Feature setup

See also this description for standards for Features and Plugins of the Modeling project and these guidelines from the Common-Build-Infrastructure.

A summary:

When creating a new plugin/feature for Texo then the same structure has to be followed as is visible in the org.eclipse.emf.texo plugin and feature. The following files should be present in the root:

  • about.html
  • copyright.txt
  • epl-v10.html
  • license.html
  • plugin.properties with pluginName and providerName externalized

A feature project has the following additional files:

  • about.ini
  • about.properties
  • modeling32.png

The version of the plugin and feature have to end with .qualifier (for example 0.1.0.qualifier).

The build.properties should include all these files in the build.

All plugins should use the J2SE-1.5 execution environment.

All the above files can be copied from the org.eclipse.emf.texo plugin/feature project.

Eclipse Components and Projects used by Texo

  • EMF Ecore: for runtime model support
  • EMF XMI/XML: for XML Serialization
  • Xpand/Xtend: for code generation
  • MWE: code generation workflow
  • JMerge (part of EMF): for merging generated code with manually changed code
  • JDT: for postprocessing of generated classes (organize imports)

The build environment has been setup using Buckminster and Hudson.

For the future (generation of web ui's) the Presentation Framework Project will probably be used.

Interesting links

Here are links related to coding practices:

Back to the top