Skip to content

Commit 4e978ce

Browse files
committed
Prepare mbed-tools release 6.0.0
1 parent de8a876 commit 4e978ce

File tree

6 files changed

+53
-28
lines changed

6 files changed

+53
-28
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ beta releases are not included in this history. For a full list of all releases,
1212

1313
[//]: # (begin_release_notes)
1414

15+
6.0.0 (2021-02-10)
16+
==================
17+
18+
Major changes
19+
-------------
20+
21+
- The compile subcommand now requires both toolchain and mbed-target arguments. (#20210203124012)
22+
23+
24+
Features
25+
--------
26+
27+
- Builds are now separated by target, profile and toolchain, allowing use of different configurations without clearing previous builds. (#141)
28+
29+
1530
5.5.0 (2021-02-06)
1631
==================
1732

docs/api/cli/build.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ <h1 class="title">Module <code>mbed_tools.cli.build</code></h1>
104104

105105
Args:
106106
program_path: Path to the Mbed project.
107-
mbed_os_path: the path to the local Mbed OS directory
107+
mbed_os_path: The path to the local Mbed OS directory.
108108
profile: The Mbed build profile (debug, develop or release).
109109
custom_targets_json: Path to custom_targets.json.
110110
toolchain: The toolchain to use for the build.
@@ -115,23 +115,21 @@ <h1 class="title">Module <code>mbed_tools.cli.build</code></h1>
115115
sterm: Open a serial terminal to the connected target.
116116
baudrate: Change the serial baud rate (ignored unless --sterm is also given).
117117
&#34;&#34;&#34;
118+
_validate_target_and_toolchain_args(mbed_target, toolchain)
119+
cmake_build_subdir = pathlib.Path(mbed_target.upper(), profile.lower(), toolchain.upper())
118120
if mbed_os_path is None:
119-
program = MbedProgram.from_existing(pathlib.Path(program_path))
121+
program = MbedProgram.from_existing(pathlib.Path(program_path), cmake_build_subdir)
120122
else:
121-
program = MbedProgram.from_existing(pathlib.Path(program_path), pathlib.Path(mbed_os_path))
122-
mbed_config_file = program.files.cmake_config_file
123+
program = MbedProgram.from_existing(pathlib.Path(program_path), cmake_build_subdir, pathlib.Path(mbed_os_path))
123124
build_tree = program.files.cmake_build_dir
124125
if clean and build_tree.exists():
125126
shutil.rmtree(build_tree)
126127

127-
if any([not mbed_config_file.exists(), not build_tree.exists(), mbed_target, toolchain]):
128-
click.echo(&#34;Configuring project and generating build system...&#34;)
129-
_validate_target_and_toolchain_args(mbed_target, toolchain)
130-
if custom_targets_json is not None:
131-
program.files.custom_targets_json = pathlib.Path(custom_targets_json)
132-
133-
generate_config(mbed_target.upper(), toolchain, program)
134-
generate_build_system(program.root, build_tree, profile)
128+
click.echo(&#34;Configuring project and generating build system...&#34;)
129+
if custom_targets_json is not None:
130+
program.files.custom_targets_json = pathlib.Path(custom_targets_json)
131+
generate_config(mbed_target.upper(), toolchain, program)
132+
generate_build_system(program.root, build_tree, profile)
135133

136134
click.echo(&#34;Building Mbed project...&#34;)
137135
build_project(build_tree)
@@ -156,7 +154,9 @@ <h1 class="title">Module <code>mbed_tools.cli.build</code></h1>
156154

157155
def _validate_target_and_toolchain_args(target: str, toolchain: str) -&gt; None:
158156
if not all([toolchain, target]):
159-
raise click.UsageError(&#34;--toolchain and --mbed-target arguments are required when generating Mbed config!&#34;)</code></pre>
157+
raise click.UsageError(
158+
&#34;Both --toolchain and --mbed-target arguments are required when using the compile subcommand.&#34;
159+
)</code></pre>
160160
</details>
161161
</section>
162162
<section>

docs/api/cli/configure.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ <h1 class="title">Module <code>mbed_tools.cli.configure</code></h1>
7777
program_path: the path to the local Mbed program
7878
mbed_os_path: the path to the local Mbed OS directory
7979
&#34;&#34;&#34;
80+
cmake_build_subdir = pathlib.Path(mbed_target.upper(), &#34;develop&#34;, toolchain.upper())
8081
if mbed_os_path is None:
81-
program = MbedProgram.from_existing(pathlib.Path(program_path))
82+
program = MbedProgram.from_existing(pathlib.Path(program_path), cmake_build_subdir)
8283
else:
83-
program = MbedProgram.from_existing(pathlib.Path(program_path), pathlib.Path(mbed_os_path))
84+
program = MbedProgram.from_existing(pathlib.Path(program_path), cmake_build_subdir, pathlib.Path(mbed_os_path))
8485
mbed_target = mbed_target.upper()
8586
output_path = generate_config(mbed_target, toolchain, program)
8687
click.echo(f&#34;mbed_config.cmake has been generated and written to &#39;{str(output_path.resolve())}&#39;&#34;)</code></pre>

docs/api/project/mbed_program.html

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,15 @@ <h1 class="title">Module <code>mbed_tools.project.mbed_program</code></h1>
9595
return cls(program_files, mbed_os)
9696

9797
@classmethod
98-
def from_existing(cls, dir_path: Path, mbed_os_path: Path = None, check_mbed_os: bool = True) -&gt; &#34;MbedProgram&#34;:
98+
def from_existing(
99+
cls, dir_path: Path, build_subdir: Path, mbed_os_path: Path = None, check_mbed_os: bool = True,
100+
) -&gt; &#34;MbedProgram&#34;:
99101
&#34;&#34;&#34;Create an MbedProgram from an existing program directory.
100102

101103
Args:
102104
dir_path: Directory containing an Mbed program.
103-
mbed_os_path: Directory containing Mbed OS
105+
build_subdir: The subdirectory for the CMake build tree.
106+
mbed_os_path: Directory containing Mbed OS.
104107
check_mbed_os: If True causes an exception to be raised if the Mbed OS source directory does not
105108
exist.
106109

@@ -114,7 +117,7 @@ <h1 class="title">Module <code>mbed_tools.project.mbed_program</code></h1>
114117
program_root = dir_path
115118

116119
logger.info(f&#34;Found existing Mbed program at path &#39;{program_root}&#39;&#34;)
117-
program = MbedProgramFiles.from_existing(program_root)
120+
program = MbedProgramFiles.from_existing(program_root, build_subdir)
118121

119122
try:
120123
mbed_os = MbedOS.from_existing(mbed_os_path, check_mbed_os)
@@ -308,12 +311,15 @@ <h2 id="args">Args</h2>
308311
return cls(program_files, mbed_os)
309312

310313
@classmethod
311-
def from_existing(cls, dir_path: Path, mbed_os_path: Path = None, check_mbed_os: bool = True) -&gt; &#34;MbedProgram&#34;:
314+
def from_existing(
315+
cls, dir_path: Path, build_subdir: Path, mbed_os_path: Path = None, check_mbed_os: bool = True,
316+
) -&gt; &#34;MbedProgram&#34;:
312317
&#34;&#34;&#34;Create an MbedProgram from an existing program directory.
313318

314319
Args:
315320
dir_path: Directory containing an Mbed program.
316-
mbed_os_path: Directory containing Mbed OS
321+
build_subdir: The subdirectory for the CMake build tree.
322+
mbed_os_path: Directory containing Mbed OS.
317323
check_mbed_os: If True causes an exception to be raised if the Mbed OS source directory does not
318324
exist.
319325

@@ -327,7 +333,7 @@ <h2 id="args">Args</h2>
327333
program_root = dir_path
328334

329335
logger.info(f&#34;Found existing Mbed program at path &#39;{program_root}&#39;&#34;)
330-
program = MbedProgramFiles.from_existing(program_root)
336+
program = MbedProgramFiles.from_existing(program_root, build_subdir)
331337

332338
try:
333339
mbed_os = MbedOS.from_existing(mbed_os_path, check_mbed_os)
@@ -342,16 +348,18 @@ <h2 id="args">Args</h2>
342348
<h3>Static methods</h3>
343349
<dl>
344350
<dt id="mbed_tools.project.mbed_program.MbedProgram.from_existing"><code class="name flex">
345-
<span>def <span class="ident">from_existing</span></span>(<span>dir_path: pathlib.Path, mbed_os_path: pathlib.Path = None, check_mbed_os: bool = True) ‑> <a title="mbed_tools.project.mbed_program.MbedProgram" href="#mbed_tools.project.mbed_program.MbedProgram">MbedProgram</a></span>
351+
<span>def <span class="ident">from_existing</span></span>(<span>dir_path: pathlib.Path, build_subdir: pathlib.Path, mbed_os_path: pathlib.Path = None, check_mbed_os: bool = True) ‑> <a title="mbed_tools.project.mbed_program.MbedProgram" href="#mbed_tools.project.mbed_program.MbedProgram">MbedProgram</a></span>
346352
</code></dt>
347353
<dd>
348354
<div class="desc"><p>Create an MbedProgram from an existing program directory.</p>
349355
<h2 id="args">Args</h2>
350356
<dl>
351357
<dt><strong><code>dir_path</code></strong></dt>
352358
<dd>Directory containing an Mbed program.</dd>
359+
<dt><strong><code>build_subdir</code></strong></dt>
360+
<dd>The subdirectory for the CMake build tree.</dd>
353361
<dt><strong><code>mbed_os_path</code></strong></dt>
354-
<dd>Directory containing Mbed OS</dd>
362+
<dd>Directory containing Mbed OS.</dd>
355363
<dt><strong><code>check_mbed_os</code></strong></dt>
356364
<dd>If True causes an exception to be raised if the Mbed OS source directory does not
357365
exist.</dd>
@@ -366,12 +374,15 @@ <h2 id="raises">Raises</h2>
366374
<span>Expand source code</span>
367375
</summary>
368376
<pre><code class="python">@classmethod
369-
def from_existing(cls, dir_path: Path, mbed_os_path: Path = None, check_mbed_os: bool = True) -&gt; &#34;MbedProgram&#34;:
377+
def from_existing(
378+
cls, dir_path: Path, build_subdir: Path, mbed_os_path: Path = None, check_mbed_os: bool = True,
379+
) -&gt; &#34;MbedProgram&#34;:
370380
&#34;&#34;&#34;Create an MbedProgram from an existing program directory.
371381

372382
Args:
373383
dir_path: Directory containing an Mbed program.
374-
mbed_os_path: Directory containing Mbed OS
384+
build_subdir: The subdirectory for the CMake build tree.
385+
mbed_os_path: Directory containing Mbed OS.
375386
check_mbed_os: If True causes an exception to be raised if the Mbed OS source directory does not
376387
exist.
377388

@@ -385,7 +396,7 @@ <h2 id="raises">Raises</h2>
385396
program_root = dir_path
386397

387398
logger.info(f&#34;Found existing Mbed program at path &#39;{program_root}&#39;&#34;)
388-
program = MbedProgramFiles.from_existing(program_root)
399+
program = MbedProgramFiles.from_existing(program_root, build_subdir)
389400

390401
try:
391402
mbed_os = MbedOS.from_existing(mbed_os_path, check_mbed_os)

news/141.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

news/20210203124012.major

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)