You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cont/adding_exporters.md
+14-24Lines changed: 14 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,22 @@
1
1
# Adding exporters
2
2
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.
4
4
5
5
<spanclass="notes">**Note:** All paths are relative to [https://github.com/ARMmbed/mbed-os/](https://github.com/ARMmbed/mbed-os/).</span>
6
6
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
14
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:
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.
15
14
16
15
## Export subsystem structure
17
16
18
17
The export subsystem is organized as a group of common code and a group of IDE or toolchain specific plugins.
19
18
20
-
The **common code** is contained in four files:
19
+
The **common code** is contained in three files:
21
20
22
21
*`tools/project.py` contains the command-line interface and handles the differences between mbed OS 2 tests and mbed OS 5 projects.
23
22
*`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:
248
247
249
248
### GNU ARM Eclipse
250
249
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.
253
251
254
252
#### Alias
255
253
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,
from tools.export.exporters.gnuarmeclipse import GNUARMEcilpse
@@ -301,13 +295,9 @@ decide to alias or specialize.
301
295
302
296
### Make
303
297
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.
307
299
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:
0 commit comments