Project

General

Profile

User story #274

Include DLL_API in eclipse templates

Added by André Neto over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
11.11.2015
Due date:
% Done:

0%

Estimated time:
Git branch (link):
Git merge to develop (link):
SVN commit (link/?p=rev):

Description

Update the eclipse template plugins to automatically put the DLL_API macros.

Remark: In Eclipse, there are two contexts where templates are used, one while editing code (called editor templates) and another when a new item is created (called code templates; e.g. when creating a new class). These two sets of templates are not related between them, so DLL_API must be added twice.

Warning: The export option in "Window → Preferences → C/C++ → Code Style → Code Templates", executed on an Eclipse instance running on Windows, adds extra tabs and blank spaces. This is not a problem when the templates are imported on an Eclipse running on Windows because they are ignored, but on Linux they are not ignored, so it messes a bit the generated code based on templates.

Source code files modified

  • Assets/Configuration/marte_cpp_code_templates.xml
  • Assets/Configuration/marte_cpp_editor_templates.xml

Architecture & design review

N/A

Code and documentation review

Verified with Eclipse 4.4.1 (Luna) running on Windows.

Verified with Eclipse 4.4.1 (Luna) running on Linux.

Unit test review

N/A

History

#1 Updated by André Neto over 9 years ago

  • Target version changed from 0.8 to 0.9

#2 Updated by Ivan Herrero over 9 years ago

  • Description updated (diff)

The macro DLL_API has to be added between the keyword "class" and the name of the class (e.g for a class named Timer, the generated code must be "class DLL_API Timer"). This macro has been added to the editor template "class", but in the code template "Class body" the only viable solution has been adding a todo message telling the developer to add the DLL_API by hand.

The "#define DLL_API" has to be added at the beginning of all source C++ files (i.e. *.cpp). This define has been added to the code template named "Default C++ source template".

Other improvements have been made in the code template "Default C++ source template", like adding an anonymmous namespace in the "Static definitions" section and adding todos reminding developers to check date and author.

See commit 6ded924 on MARTe2-doc repository.

#3 Updated by Ivan Herrero over 9 years ago

Note: The wiki page https://vcis-wiki.f4e.europa.eu/doku.php?id=devenviromenteclipse&#configuration has been modified telling the user to select “User code formatter” option on C/C++ → Editor → Templates screen, otherwise the code assist does not work properly and editor templates like "class" are not expanded at all.

#4 Updated by Ivan Herrero over 9 years ago

  • Description updated (diff)

#5 Updated by Ivan Herrero over 9 years ago

  • Description updated (diff)

#6 Updated by Ivan Herrero over 9 years ago

  • Description updated (diff)

#7 Updated by Riccardo Vitelli over 9 years ago

  • Status changed from Code: Impl to Closed

Also available in: Atom PDF