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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
## Install

```sh
mcpp new godot_math --template mcpplibs.mwrap.godot_cpp@10.0.0
mcpp new godot_math --template mcpplibs.mwrap.godot_cpp@10.0.0.1
cd godot_math
mcpp run
```

```toml
[dependencies]
mcpplibs.mwrap.godot_cpp = "10.0.0"
mcpplibs.mwrap.godot_cpp = "10.0.0.1"
```

## Macros
Expand Down
4 changes: 2 additions & 2 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
## 安装

```sh
mcpp new godot_math --template mcpplibs.mwrap.godot_cpp@10.0.0
mcpp new godot_math --template mcpplibs.mwrap.godot_cpp@10.0.0.1
cd godot_math
mcpp run
```

```toml
[dependencies]
mcpplibs.mwrap.godot_cpp = "10.0.0"
mcpplibs.mwrap.godot_cpp = "10.0.0.1"
```

## 宏
Expand Down
3 changes: 2 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main() {

```toml
[dependencies]
"mcpplibs.mwrap.godot_cpp" = "10.0.0" # Upstream-default Godot 4.7 API
mcpplibs.mwrap.godot_cpp = "10.0.0.1" # Upstream-default Godot 4.7 API
```

The version tracks upstream godot-cpp. A numeric wrapper revision may follow
Expand All @@ -40,6 +40,7 @@ The historical upstream mapping is:
| package version | upstream tag | engine |
|---|---|---|
| `10.0.0` | `10.0.0-stable` | Godot 4.7 (upstream-default API) |
| `10.0.0.1` | `10.0.0-stable` | Godot 4.7 (upstream-default API) |

## Macros

Expand Down
2 changes: 1 addition & 1 deletion examples/summator/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ kind = "shared"
windows_auto_export = false

[dependencies]
"mcpplibs.mwrap.godot_cpp" = { path = "../.." }
mcpplibs.mwrap.godot_cpp = { path = "../.." }
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 = "godot_cpp"
version = "10.0.0"
version = "10.0.0.1"
description = "godot-cpp as a C++23 module (import mcpplibs.mwrap.godot_cpp;) on top of the compat.godot-cpp source build"
license = "Apache-2.0"
authors = ["mcpp-community"]
Expand Down
2 changes: 1 addition & 1 deletion templates/math/mcpp.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ name = "{{project.name}}"
version = "0.1.0"

[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 @@ -48,17 +48,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