summaryrefslogtreecommitdiff
path: root/mesonbuild/templates/sampleimpl.py
AgeCommit message (Collapse)Author
2025-12-01templates: fix --executableSam James
* In 1.7.1, the behaviour of --executable was to just ignore it. * After my recent 9104bb616766bd9a05f0b2f280359463d32e227d, the behaviour was that we'd require, for --executable xyz, xyz.c to exist or we'd fail to generate. Neither are good! Instead, create the sample source file w/ the project name, but call the executable whatever the user passed with `--executable`. Bug: https://github.com/mesonbuild/meson/issues/15286
2025-11-23templates: respect parametersSam James
Respect collected sources for `meson init` as well as --executable. This regressed in 9f0ac314ba0c54cc18c2499845324efc14c1849e (part of https://github.com/mesonbuild/meson/pull/14086, it's easier to see how with the whole PR). Also, add subtests (distinguishing between empty directories and those with some file(s) within). We already had some of these but they weren't marked as such. Test `meson init` with a broken source file in the source directory as we should fail with that, not ignore the file. It's easier to test with a broken file than a working one as we can assert the build should fail, it'll pass with just the 1 example file we generate. Closes: https://github.com/mesonbuild/meson/issues/15286
2025-01-08templates: plumb dependencies into the new project templateDylan Baker
The command line value exists, and we'll want it soon.
2025-01-08templates: Don't overwrite files that existDylan Baker
This is going to allow us to re-use the implementation for the "create a new project" in the "add meson for an existing project" path.
2025-01-08templates: replace abc.abstractproperty with abc.abstractmethod and propertyDylan Baker
because abstractproperty is deprecated
2025-01-08templates: Add a Meson versionDylan Baker
Without a version certain kinds of warnings will be suppressed, which is bad. I've picked 1.0 because it's pretty old, except for Rust where I've maintained the 1.3.0 requirement
2025-01-08templates: Update copyright informationDylan Baker
Intel's copyright was missing on these.
2024-12-09modernize Rust templatePaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-07-25templates: use common classes for remaining languagesDylan Baker
These all break down into either a single file or a file + header. This means a little more customization per class, but not too much.
2023-07-25templates: use a common template for C# and JavaDylan Baker
The only real differences between these generators is the file extension and the templates themselves. We can uses a shared abstract class with a few abstract properties to provide all of this to the same base class. This results in less code duplication and easier maintanence. I've made a few cleanups to the shared template: - use `str.capitalize()` instead of `str.upper()[0] + str[1:]` - use `open` as a context manager - use f-strings - put some duplicate calculations in the initializer
2023-07-25templates: move initializer to base classDylan Baker
Every class implements the exact same initializer, simplify this by putting it in the base class initializer
2023-02-01treewide: add future annotations importEli Schwartz
2020-09-08typing: Fix templatesDaniel Mensinger
2020-03-19sample factory implementationMichael