diff --git a/README.md b/README.md index 9a26dfc..f277704 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/README.zh.md b/README.zh.md index 63c71e8..4d6f073 100644 --- a/README.zh.md +++ b/README.zh.md @@ -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" ``` ## 宏 diff --git a/docs/usage.md b/docs/usage.md index fd9e478..29fb8c6 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -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 @@ -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 diff --git a/examples/summator/mcpp.toml b/examples/summator/mcpp.toml index ac6da42..3cc50fb 100644 --- a/examples/summator/mcpp.toml +++ b/examples/summator/mcpp.toml @@ -18,4 +18,4 @@ kind = "shared" windows_auto_export = false [dependencies] -"mcpplibs.mwrap.godot_cpp" = { path = "../.." } +mcpplibs.mwrap.godot_cpp = { path = "../.." } diff --git a/mcpp.toml b/mcpp.toml index fac2796..ccc8a40 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -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"] diff --git a/templates/math/mcpp.toml.in b/templates/math/mcpp.toml.in index 00381f1..8903f52 100644 --- a/templates/math/mcpp.toml.in +++ b/templates/math/mcpp.toml.in @@ -3,4 +3,4 @@ name = "{{project.name}}" version = "0.1.0" [dependencies] -"{{self.name}}" = "{{self.version}}" +{{self.name}} = "{{self.version}}" diff --git a/tools/test_template.py b/tools/test_template.py index 81ea805..07f1ca6 100644 --- a/tools/test_template.py +++ b/tools/test_template.py @@ -48,7 +48,10 @@ 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()) @@ -56,9 +59,9 @@ def main(): 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()