aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/templates
AgeCommit message (Collapse)AuthorFilesLines
2023-07-25templates: use common classes for remaining languagesDylan Baker11-369/+182
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 Baker4-99/+110
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: fix typo in function name `sameple` -> `sample`Dylan Baker1-1/+1
2023-07-25templates: move initializer to base classDylan Baker12-55/+32
Every class implements the exact same initializer, simplify this by putting it in the base class initializer
2023-07-25templates/samplefactory: move type checking only import to special blockDylan Baker1-1/+1
Don't import things we don't actually need at runtime
2023-07-25minit: use a Protocol for argumentsDylan Baker2-4/+11
Which gives better type hinting. It also points out that we're changing the type of sourcefiles. That's now fixed
2023-02-01treewide: add future annotations importEli Schwartz14-0/+26
2022-11-17Fix a typo in the CUDA templateZihua Wu1-1/+1
The original version will output something like `xtakes no arguments`, and the modified version will correctly output `x takes no arguments`.
2022-01-27flake8: fix indentation styleEli Schwartz1-3/+3
2021-11-16Add vala templateAlberto Fanjul3-3/+129
2021-08-15editorconfig: add setting to trim trailing whitespaceEli Schwartz1-1/+0
and clean up all outstanding issues Skip 'test cases/common/141 special characters/meson.build' since it intentionally uses trailing newlines.
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger11-88/+100
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-3/+3
performed by running "pyupgrade --py36-plus" and committing the results
2020-09-08typing: Fix templatesDaniel Mensinger13-24/+28
2020-04-01cuda: Fix meson template (fixes #6869)Daniel Mensinger1-2/+2
2020-04-01Fix meson_jar_templateJan Alexander Steffens (heftig)1-2/+2
It was generating an extra comma. The Meson build system Version: 0.54.0 Source dir: /tmp/tmp34halxhe Build dir: /tmp/tmp34halxhe/build Build type: native build meson.build:6:15: ERROR: Expecting rparen got comma. 'Foo.java',, ^ For a block that started at 5,3 jar('tmp34halxhe', ^ A full log can be found at /tmp/tmp34halxhe/build/meson-logs/meson-log.txt Using "tmp34halxhe" (name of current directory) as project name. Using "tmp34halxhe" (project name) as name of executable to build. Detected source files: Foo.java Detected language: java Generated meson.build file: project('tmp34halxhe', 'java', version : '0.1', default_options : ['warning_level=3']) jar('tmp34halxhe', 'Foo.java',, main_class: tmp34halxhe, install : true) It was also missing quotes around the main class name. The Meson build system Version: 0.54.0 Source dir: /tmp/tmpjm5cg44a Build dir: /tmp/tmpjm5cg44a/build Build type: native build Project name: tmpjm5cg44a Project version: 0.1 Java compiler for the host machine: javac (unknown 1.8.0) Host machine cpu family: x86_64 Host machine cpu: x86_64 meson.build:5:0: ERROR: Unknown variable "tmpjm5cg44a". A full log can be found at /tmp/tmpjm5cg44a/build/meson-logs/meson-log.txt Using "tmpjm5cg44a" (name of current directory) as project name. Using "tmpjm5cg44a" (project name) as name of executable to build. Detected source files: Foo.java Detected language: java Generated meson.build file: project('tmpjm5cg44a', 'java', version : '0.1', default_options : ['warning_level=3']) jar('tmpjm5cg44a', 'Foo.java', main_class: tmpjm5cg44a, install : true)
2020-03-19sample factory implementationMichael12-344/+475
2020-03-08add logic for Java jar projectMichael1-7/+29
2020-02-22tests: Ensure that executable and library are named differentlyNirbheek Chauhan9-9/+16
On Windows, the basename is used to determine the name of the PDB file. So for a project called myproject, we will create myproject.dll and myproject.exe, both of which will have myproject.pdb. This is a file collision. Instead, append `_test`, similar to the C# template. Fixes AllPlatformTest.test_templates on MSVC. This became a hard error when we started listing PDBs in the implicit outputs list of ninja targets. Do the same for a test that was making the same mistake.
2020-02-02add new templatesMichael5-0/+639
2019-12-31Make D template work even if dub is not available.Jussi Pakkanen1-7/+9
2019-11-02Minit templates modularizationMichael Hirsch, Ph.D7-0/+854