diff --git a/README.md b/README.md index ad807df..69ab40b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ it in one program. ## Getting started ```sh -mcpp new tone --template mcpplibs.mwrap.dr_libs@2026.03.03 +mcpp new tone --template mcpplibs.mwrap.dr_libs@2026.03.03.1 cd tone mcpp run ``` @@ -46,7 +46,7 @@ MP3 files. ```toml [dependencies] -"mcpplibs.mwrap.dr_libs" = "2026.03.03" +mcpplibs.mwrap.dr_libs = "2026.03.03.1" ``` ```cpp diff --git a/README.zh.md b/README.zh.md index a59edcd..4d32161 100644 --- a/README.zh.md +++ b/README.zh.md @@ -33,7 +33,7 @@ RF64、Wave64 与 AIFF(PCM、浮点、A-law、mu-law、ADPCM)并写入 WAV ## 快速开始 ```sh -mcpp new tone --template mcpplibs.mwrap.dr_libs@2026.03.03 +mcpp new tone --template mcpplibs.mwrap.dr_libs@2026.03.03.1 cd tone mcpp run ``` @@ -43,7 +43,7 @@ mcpp run ```toml [dependencies] -"mcpplibs.mwrap.dr_libs" = "2026.03.03" +mcpplibs.mwrap.dr_libs = "2026.03.03.1" ``` ```cpp diff --git a/examples/dr_libs/mcpp.toml b/examples/dr_libs/mcpp.toml index 51f741b..0b01b72 100644 --- a/examples/dr_libs/mcpp.toml +++ b/examples/dr_libs/mcpp.toml @@ -9,4 +9,4 @@ kind = "bin" main = "src/main.cpp" [dependencies] -"mcpplibs.mwrap.dr_libs" = { path = "../.." } +mcpplibs.mwrap.dr_libs = { path = "../.." } diff --git a/mcpp.toml b/mcpp.toml index 7d6ad4b..f8d4a8b 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -2,7 +2,7 @@ [package] namespace = "mcpplibs.mwrap" name = "dr_libs" -version = "2026.03.03" +version = "2026.03.03.1" description = "dr_libs C++ modules for mcpp (import mcpplibs.mwrap.dr_libs;): dr_wav 0.14.5, dr_flac 0.13.3 and dr_mp3 0.7.3 over compat.dr_libs, one module per header, their macros as constants" license = "Apache-2.0" authors = ["mcpp-community"] diff --git a/templates/tone/mcpp.toml.in b/templates/tone/mcpp.toml.in index a637560..43c2cea 100644 --- a/templates/tone/mcpp.toml.in +++ b/templates/tone/mcpp.toml.in @@ -7,4 +7,4 @@ kind = "bin" main = "src/main.cpp" [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()