Skip to content

Commit 55381cb

Browse files
committed
Include edits suggested by Amanda
1 parent 8f69af0 commit 55381cb

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

docs/cont/adding_exporters.md

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
# Adding exporters
22

3-
This is a guide for adding exporters to the mbed-os tools. First, This document describes what an exporter is and what rules it follows. Then, it covers the structure of the export subsystem and the individual exporter. Finally, this document gives some implementation suggestions.
3+
This is a guide for adding exporters to the mbed-os tools. First, this document describes what an exporter is and what rules it follows. Then, it covers the structure of the export subsystem and the individual exporter. Finally, this document gives some implementation suggestions.
44

55
<span class="notes">**Note:** All paths are relative to [https://github.com/ARMmbed/mbed-os/](https://github.com/ARMmbed/mbed-os/).</span>
66

7-
## What is an exporter
8-
9-
An exporter is a python plugin to the mbed OS tools that convert a project using mbed CLI into one specialized for a particular IDE. For the best user experience, an exporter should:
10-
- Take input from the resource scan.
11-
- Use the flags in the build profiles.
12-
- Have a single template file for each file type they produce. For example, an eclipse CDT project would have one template for `.project` files and one for `.cproject` files.
13-
- Not call mbed CLI. It is possible to export from the website, which will not include mbed CLI in the resulting zip.
7+
## What an exporter is
148

9+
An exporter is a Python plugin to the mbed OS tools that convert a project using mbed CLI into one specialized for a particular IDE. For the best user experience, an exporter:
10+
- Takes input from the resource scan.
11+
- Uses the flags in the build profiles.
12+
- Has a single template file for each file type they produce. For example, an eclipse CDT project would have one template for `.project` files and one for `.cproject` files.
13+
- Does not call mbed CLI. It is possible to export from the website, which will not include mbed CLI in the resulting zip.
1514

1615
## Export subsystem structure
1716

1817
The export subsystem is organized as a group of common code and a group of IDE or toolchain specific plugins.
1918

20-
The **common code** is contained in four files:
19+
The **common code** is contained in three files:
2120

2221
* `tools/project.py` contains the command-line interface and handles the differences between mbed OS 2 tests and mbed OS 5 projects.
2322
* `tools/export/__init__.py` contains a high-level API for use by the mbed Online Compiler and mbed CLI. Responsible for doing boilerplate-like things, such as scanning for resources.
@@ -248,14 +247,11 @@ There are several paths forward that can lead to an easily maintained exporter:
248247

249248
### GNU ARM Eclipse
250249

251-
If your IDE uses Eclipse and uses the GNU ARM Eclipse plugin, then you should
252-
specialize or alias your exporter with the generic GNU ARM Eclipse.
250+
If your IDE uses Eclipse and uses the GNU ARM Eclipse plugin, then specialize or alias your exporter with the generic GNU ARM Eclipse.
253251

254252
#### Alias
255253

256-
If you do not need any specialization of the export, then replace your
257-
exporters class in the `EXPORT_MAP` with the `GNUARMEclipse` class. For example,
258-
if KDS met all of these requirements, we could:
254+
If you do not need any specialization of the export, then replace your exporters class in the `EXPORT_MAP` with the `GNUARMEclipse` class. For example, if KDS met all of these requirements, we could:
259255

260256
```diff
261257
EXPORTERS = {
@@ -270,9 +266,7 @@ EXPORTERS = {
270266

271267
#### Specialization
272268

273-
If you need more specialization and are using an Eclipse based IDE and the GNU
274-
ARM Eclipse plugin, then your exporter class inherits from the `GNUARMEclipse`
275-
class. For example (with KDS again):
269+
If you need more specialization and are using an Eclipse based IDE and the GNU ARM Eclipse plugin, then your exporter class inherits from the `GNUARMEclipse` class. For example (with KDS again):
276270

277271
```python
278272
from tools.export.exporters.gnuarmeclipse import GNUARMEcilpse
@@ -301,13 +295,9 @@ decide to alias or specialize.
301295

302296
### Make
303297

304-
If your IDE is not Eclipse based but can still use a Makefile, then you can
305-
specialize the Makefile exporter. Specializing the Makefile is actually how we
306-
implement the Eclipse + Make exporter.
298+
If your IDE is not Eclipse based but can still use a Makefile, then you can specialize the Makefile exporter. Specializing the Makefile is actually how ARM mbed implemented the Eclipse + Make exporter.
307299

308-
Creating an exporter based on the Makefile exporter is a two step process:
309-
inherit from the appropriate Makefile class, and call its generate method.
310-
Taking Eclipse + Make using GCC_ARM as an example, your exporter will look like:
300+
Creating an exporter based on the Makefile exporter is a two step process: inherit from the appropriate Makefile class, and call its generate method. Taking Eclipse + Make using GCC_ARM as an example, your exporter will look like:
311301

312302
```python
313303
class EclipseGcc(GccArm):
@@ -316,11 +306,11 @@ class EclipseGcc(GccArm):
316306

317307
Your generate method will look similar to:
318308

319-
320309
```python
321310
def generate(self):
322311
"""Generate Makefile, .cproject & .project Eclipse project file,
323312
py_ocd_settings launch file, and software link .p2f file
324313
"""
325314
super(EclipseGcc, self).generate()
326315
...
316+
```

0 commit comments

Comments
 (0)