|
92 | 92 | <div data-md-component="skip"> |
93 | 93 |
|
94 | 94 |
|
95 | | - <a href="#excluding-source-files" class="md-skip"> |
| 95 | + <a href="#including-and-excluding-source-files" class="md-skip"> |
96 | 96 | Skip to content |
97 | 97 | </a> |
98 | 98 |
|
|
931 | 931 | <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> |
932 | 932 |
|
933 | 933 | <li class="md-nav__item"> |
934 | | - <a href="#excluding-source-files" class="md-nav__link"> |
935 | | - Excluding Source Files |
| 934 | + <a href="#including-and-excluding-source-files" class="md-nav__link"> |
| 935 | + Including and Excluding Source Files |
936 | 936 | </a> |
937 | 937 |
|
938 | 938 | </li> |
|
1193 | 1193 |
|
1194 | 1194 |
|
1195 | 1195 |
|
| 1196 | + |
| 1197 | + |
1196 | 1198 |
|
1197 | 1199 |
|
1198 | 1200 |
|
1199 | 1201 |
|
1200 | 1202 | <div class="md-nav__link md-nav__link--index "> |
1201 | | - <a href="../../migration-modelrt/">Migration from Model RT</a> |
| 1203 | + <a href="../../migration-modelrt/">Migration from Model RealTime</a> |
1202 | 1204 |
|
1203 | 1205 | <label for="__nav_2_11"> |
1204 | 1206 | <span class="md-nav__icon md-icon"></span> |
|
1209 | 1211 | <nav class="md-nav" data-md-level="2" aria-labelledby="__nav_2_11_label" aria-expanded="false"> |
1210 | 1212 | <label class="md-nav__title" for="__nav_2_11"> |
1211 | 1213 | <span class="md-nav__icon md-icon"></span> |
1212 | | - Migration from Model RT |
| 1214 | + Migration from Model RealTime |
1213 | 1215 | </label> |
1214 | 1216 | <ul class="md-nav__list" data-md-scrollfix> |
1215 | 1217 |
|
|
1229 | 1231 |
|
1230 | 1232 |
|
1231 | 1233 |
|
| 1234 | + |
| 1235 | + |
| 1236 | + |
| 1237 | + |
| 1238 | + |
| 1239 | + <li class="md-nav__item"> |
| 1240 | + <a href="../../migration-modelrt/best-practices/" class="md-nav__link"> |
| 1241 | + Best Practices |
| 1242 | + </a> |
| 1243 | + </li> |
| 1244 | + |
| 1245 | + |
| 1246 | + |
| 1247 | + |
1232 | 1248 | </ul> |
1233 | 1249 | </nav> |
1234 | 1250 | </li> |
|
1404 | 1420 | <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> |
1405 | 1421 |
|
1406 | 1422 | <li class="md-nav__item"> |
1407 | | - <a href="#excluding-source-files" class="md-nav__link"> |
1408 | | - Excluding Source Files |
| 1423 | + <a href="#including-and-excluding-source-files" class="md-nav__link"> |
| 1424 | + Including and Excluding Source Files |
1409 | 1425 | </a> |
1410 | 1426 |
|
1411 | 1427 | </li> |
@@ -1462,15 +1478,15 @@ <h1>C++ Source Files</h1> |
1462 | 1478 | }; |
1463 | 1479 | </code></pre> |
1464 | 1480 | <p>It's recommended to place C++ source files in subfolders as in the example above. If you place them directly in the workspace folder you need to ensure they don't have the same name as any of the Art elements that are built. This is to ensure there are no name clashes between the object files that are produced when building.</p> |
1465 | | -<h2 id="excluding-source-files">Excluding Source Files</h2> |
| 1481 | +<h2 id="including-and-excluding-source-files">Including and Excluding Source Files</h2> |
1466 | 1482 | <p>By default all <code>.cpp</code> and <code>.h</code> files that are found in a workspace folder, or in a folder that is directly or indirectly contained in the workspace folder, will be included in the build. If you want to exclude some of these files from the build you can use the <a href="../transformation-configurations/#sources"><code>sources</code></a> TC property, just as for Art files. All <code>.cpp</code> and <code>.h</code> files that match at least one pattern in the <a href="../transformation-configurations/#sources"><code>sources</code></a> property, and doesn't match an anti-pattern (starting with the character <code>!</code>) will be included into the build. </p> |
1467 | 1483 | <div class="admonition note"> |
1468 | 1484 | <p class="admonition-title">Note</p> |
1469 | 1485 | <p>If you set the <a href="../transformation-configurations/#sources"><code>sources</code></a> property to explicitly include some specific <code>.cpp</code> and <code>.h</code> files you also need to specify which <code>.art</code> files to include. That is, make sure the specified patterns match all files that should be included in the build (both <code>.cpp</code>, <code>.h</code> and <code>.art</code> files). If you only specify anti-patterns (i.e. files to exclude from the build) you don't need to do this, since by default all files are included except the ones that are excluded.</p> |
1470 | 1486 | </div> |
1471 | 1487 | <p>Here are some examples:</p> |
1472 | | -<pre><code class="language-js">tc.sources = ["**/*.cpp", "**/*.h", "*.art"]; // Include all .cpp and .h files from the workspace folder and all its subfolders, and all .art files from the workspace folder. This is the default behavior if the "sources" property is not set. |
1473 | | -tc.sources = ["src/utils.cpp", "include/utils.h", "*.art"]; // Include a specific .cpp and .h file into the build |
| 1488 | +<pre><code class="language-js">tc.sources = ["**/*.art", "**/*.h", "**/*.cpp"]; // Include all .art, .cpp and .h files from the workspace folder and all its subfolders. This is the default behavior if the "sources" property is not set. |
| 1489 | +tc.sources = ["src/utils.cpp", "include/utils.h", "**/*.art"]; // Include a specific .cpp and .h file into the build |
1474 | 1490 | tc.sources = ["!src/utils.cpp", "!include/utils.h"]; // Include all .cpp and .h files except two specific ones (all .art files will be built) |
1475 | 1491 | </code></pre> |
1476 | 1492 | <p>If you have set-up the TC to place generated C++ files in a subfolder of the workspace folder, you don't have to exclude them by means of the <a href="../transformation-configurations/#sources"><code>sources</code></a> TC property. Generated files will always be included in the build exactly once, no matter where they are located. </p> |
|
0 commit comments