Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ automated test suite passes on every CI run, compiled against the module.
## Getting started

```sh
mcpp new sdlinfo --template mcpplibs.mwrap.sdl3@3.4.18
mcpp new sdlinfo --template mcpplibs.mwrap.sdl3@3.4.18.1
cd sdlinfo
mcpp run
```
Expand All @@ -39,11 +39,11 @@ version, CPU features, video, render, audio and GPU drivers, the displays, a
GPU device and its shader formats. It needs no window or desktop; without a
display it reports through SDL's offscreen driver. The `window` template is a
sketch pad on SDL's app callbacks and needs a desktop:
`mcpp new pad --template mcpplibs.mwrap.sdl3@3.4.18:window`.
`mcpp new pad --template mcpplibs.mwrap.sdl3@3.4.18.1:window`.

```toml
[dependencies]
"mcpplibs.mwrap.sdl3" = "3.4.18"
mcpplibs.mwrap.sdl3 = "3.4.18.1"
```

```cpp
Expand Down
6 changes: 3 additions & 3 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@
## 快速开始

```sh
mcpp new sdlinfo --template mcpplibs.mwrap.sdl3@3.4.18
mcpp new sdlinfo --template mcpplibs.mwrap.sdl3@3.4.18.1
cd sdlinfo
mcpp run
```

默认模板(`info`)打印 SDL 在这台机器上看到的一切:版本、CPU 特性、视频/渲染/
音频/GPU 驱动、显示器、一个 GPU 设备及其着色器格式。它不需要窗口或桌面;没有显示器时
通过 SDL 的 offscreen 驱动报告。`window` 模板是基于 SDL 应用回调的画板,需要桌面环境:
`mcpp new pad --template mcpplibs.mwrap.sdl3@3.4.18:window`。
`mcpp new pad --template mcpplibs.mwrap.sdl3@3.4.18.1:window`。

```toml
[dependencies]
"mcpplibs.mwrap.sdl3" = "3.4.18"
mcpplibs.mwrap.sdl3 = "3.4.18.1"
```

```cpp
Expand Down
2 changes: 1 addition & 1 deletion mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[package]
namespace = "mcpplibs.mwrap"
name = "sdl3"
version = "3.4.18"
version = "3.4.18.1"
description = "SDL 3.4.18 C++ modules for mcpp (import mcpplibs.mwrap.sdl3;): the C API of SDL.h (with SDL_vulkan.h and SDL_main.h's functions) over compat.sdl3, its inline API adapted, its macros as constants and functions"
license = "Apache-2.0"
authors = ["mcpp-community"]
Expand Down
2 changes: 1 addition & 1 deletion templates/info/mcpp.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ kind = "bin"
main = "src/main.cpp"

[dependencies]
"{{self.name}}" = "{{self.version}}"
{{self.name}} = "{{self.version}}"
2 changes: 1 addition & 1 deletion templates/window/mcpp.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ kind = "bin"
main = "src/main.cpp"

[dependencies]
"{{self.name}}" = "{{self.version}}"
{{self.name}} = "{{self.version}}"
11 changes: 7 additions & 4 deletions tools/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,20 @@ def main():
project = temporary / "quickstart"
manifest = project / "mcpp.toml"
text = manifest.read_text()
dependency = tomllib.loads(text)["dependencies"][identity]
# The key is unquoted, so TOML reads it as one table per segment.
dependency = tomllib.loads(text)["dependencies"]
for segment in identity.split("."):
dependency = dependency[segment]
options = {"version": dependency} if isinstance(dependency, str) else dependency
assert options["version"] == version, options
replacement = '{ path = ' + json.dumps(package.as_posix())
if options.get("features"):
replacement += ', features = ' + json.dumps(options["features"])
replacement += ' }'
lines = text.splitlines()
matches = [i for i, line in enumerate(lines) if line.startswith(json.dumps(identity) + " =")]
assert len(matches) == 1, "Expected exactly one qualified dependency from self.name"
lines[matches[0]] = json.dumps(identity) + " = " + replacement
matches = [i for i, line in enumerate(lines) if line.startswith(identity + " =")]
assert len(matches) == 1, "Expected exactly one unquoted qualified dependency from self.name"
lines[matches[0]] = identity + " = " + replacement
manifest.write_text("\n".join(lines) + "\n")
if args.index:
candidate_index = args.index.resolve()
Expand Down
Loading