aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/qt.py
AgeCommit message (Collapse)AuthorFilesLines
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-1/+1
2021-10-10Fix typos discovered by codespellChristian Clauss1-3/+3
2021-09-30interpreter: Use typed_kwargs for func_custom_targetDylan Baker1-8/+8
This does not convert the build side, or remove any of the checking it does. We still need that for other callers of custom target. What we'll do for those is add an internal interface that defaults things, then we'll be able to have those callers do their own validation, and the CustomTarget validation machinary can be removed. Fixes #9096
2021-09-24pylint: check for duplicate importsDylan Baker1-2/+1
I ran into one of these from LGTM, and it would be nice if pylint could warn me as part of my local development process instead of waiting for the CI to tell me.
2021-09-10qt module: consolidate on one list of binsEli Schwartz1-25/+25
2021-09-10qt module: fix regression in building translations via qresourceEli Schwartz1-1/+1
In commit 3c4c7d042932c23a8ea24d85f24cd290d0a5ea13 the qresource variable stopped being overwritten with a mesonlib.File, which is reasonable. However, one call site for it which relied on being a built file did not get renamed when needed. Make the build target use the built file.
2021-09-10qt module: correctly register a found tool and stop looking for itEli Schwartz1-3/+1
Regression in commit d7ac2f10655433989e5e17867b6c8ef428fd39e8 since self.{tool_name} is not how it used to be tracked, and the "found" dictionary is a legacy of the old location.
2021-08-27interpreter: fix cases of `KwargInfo(..., T, default=None)`Dylan Baker1-2/+3
The correct way to mark these is `KwargInfo(..., (T, type(None)))`. There's also a few cases of `(T, None)` which is invalid, as `None` isn't a type
2021-08-18modules/qt: Allow using generated sources for compile_translations ts_filesDylan Baker1-4/+11
2021-08-18modules/qt: Allow Generated sources in compile_resourcesDylan Baker1-28/+48
2021-08-18modules/qt: allow passing generated targets to compile_uiDylan Baker1-2/+9
2021-08-18modules/qt: Allow generated sources for arguemnts to compile_mocDylan Baker1-4/+18
2021-08-17Add install tagsXavier Claessens1-0/+1
Fixes: #7007.
2021-07-23qt: Allow CustomTargets for qt.preprocess source argumentsDylan Baker1-11/+11
This works for `moc_*` and `ui_files`, but it never could have worked for `qresources` due to the implementation assuming a `str` or `File`. To restore previous compatibility I've added `CustomTarget` where it would have worked, but not where it would have failed, the former would raised an exception along the lines anyway. Fixes #9007
2021-06-27modules/qt: use _impl private methods to avoid incorrect FeatureNewDylan Baker1-11/+28
`qt.preprocess` dispatches to the individual methods instead of duplicating all of the logic itself, but this means that it goes through the type checking, and feature checking a second time. To avoid this we need to use a private helper method instead. Fixes #8920
2021-06-18holders: Fix the remaining code to respect the holder changesDaniel Mensinger1-37/+36
2021-06-18modules/qt: use append rather than extend in preprocessDylan Baker1-3/+3
Because that's what we need, of course
2021-06-18modules/qt: allow string values for include_directoriesDylan Baker1-4/+4
This should have been supported before, but wasn't.
2021-06-15modules/qt: sort and clean up dependenciesDylan Baker1-8/+9
2021-06-15modules/qt: Return GeneratedListHolder instead of GeneratedListDylan Baker1-2/+2
This really shouldn't be necissary, but fixing the typing annotations of ModuleReturnValue is much harder than just returning the Holder directly.
2021-06-15interpreterobjects|build: use typed_kwargs for generator.processDylan Baker1-3/+3
2021-06-15build: Pass name of generator to initializerDylan Baker1-6/+11
It's really a property of the Generator what name to use, not something that should be passed to each call to process files.
2021-06-15interpreter|build: Do Generator keyword argument checking in the interpreterDylan Baker1-13/+9
For qt we already have all of the necissary checking in place. Now in the interpreter we have the same, the intrperter does all of the checking, then passed the arguments to the Generator initializer, which just assigns the passed values. This is nice, neat, and clean and fixes the layering violatino between build and interpreter.
2021-06-15interpreter|build: Pass just the executable down to GeneratorDylan Baker1-3/+3
This requires that the interpreter has done the validation, which it now does at all callsites. This simplifies the Generator initializer.
2021-06-15modues/qt: Make use of typed_kwargs since/deprecation abiltiyDylan Baker1-15/+7
2021-06-15modules/qt: fix remaining typing issues and add to run_mypyDylan Baker1-13/+15
This just ignores the fact taht Generator is unchecked. Generator needs some real love in terms of type checking.
2021-06-15modules/qt: use type checking and annotations for compile_translationsDylan Baker1-13/+34
2021-06-15modules/qt: fully annotate and check qt.has_toolsDylan Baker1-4/+18
2021-06-15modules/qt: Make use of the default=[] availabilityDylan Baker1-29/+44
2021-06-15modules/qt: Type anotations and cleanupsDylan Baker1-17/+30
This adds a number of missing type annotations to existing functions, and makes a few members protected instead of public, as they were never meant to be public
2021-06-15modules/qt: have pre-process dispatch to moc_compileDylan Baker1-31/+10
for ode sharing and simplicity
2021-06-15modules/qt: Add a compile_moc methodDylan Baker1-1/+59
This method only compiles moc resources, nothing else
2021-06-15modules/qt: use the compile_ui method inside the preprocess methodDylan Baker1-8/+2
for code deduplication
2021-06-15modules/qt: Add a compile_ui methodDylan Baker1-0/+33
Which is the same functionality split out of preprocess
2021-06-15modules/qt: Dispatch the preprocess method to the compile_resources methodDylan Baker1-30/+5
Which removes code duplication and makes our testing better
2021-06-15modules/qt: Add a `compile_resources` methodDylan Baker1-14/+98
This is a separate method for just handling qrc resources.
2021-06-15modules/qt: Deprecated the preprocess sources keyword argumentDylan Baker1-2/+3
2021-06-15modules/qt: Deprecated the *sources variadic argument to preproccessDylan Baker1-2/+5
It's confusing, and it's a duplicate of the `sources` keyword argument, which has always existed.
2021-06-03deps: Split dependencies.baseDaniel Mensinger1-1/+1
Split the Factory and dependency classes out of the base.py script to improve maintainability.
2021-05-28modules: Replace find_program_impl() by state.find_program()Xavier Claessens1-11/+10
2021-05-28modules: Add methods dict everywhereXavier Claessens1-0/+5
This fix calling random internal methods from meson.build as long as they were not prefixed by underscore.
2021-05-28modules: Remove snippet methodsXavier Claessens1-2/+1
The only advantage they have is they have the interpreter in arguments, but it's already available as self.interpreter. We should discourage usage of the interpreter API and rely on ModuleState object instead in the future. This also lift the restriction that a module method cannot add build targets, but that was not enforced for snippet methods anyway (and some modules were doing it) and it's really loose restriction as it should check for many other things if we wanted to make it consistent.
2021-05-12gnome: Fix gtkdoc generationXavier Claessens1-2/+2
install_scripts used to replace @BUILD_ROOT@ and @SOURCE_ROOT@ but it was not documented and got removed in Meson 0.58.0. gnome.gtkdoc() was relying on that behaviour, but it has always been broken in the case the source or build directory contains spaces. Fix this by changing get_include_args() to substitue paths directly which will then get escaped correctly. Add a unit test that builds GObject documentation which is where this issue has been spotted. Fixes: #8744
2021-05-08Fix python exception thrown for invalid resource pathNellie Zhang1-1/+1
If an invalid resource path is specified, then an uncaught python exception occurs, and a backtrace is shown. Throw a MesonException instead to produce a cleaner error message.
2021-03-23Refactor Qt Dependency into proper split classes with factoriesDylan Baker1-13/+9
Currently the Qt Dependencies still use the old "combined" method for dependencies with multiple ways to be found. This is problematic as it means that `get_variable()` and friends don't work, as the dependency can't implement any of those methods. The correct solution is to make use of multiple Dependency instances, and a factory to tie them together. This does that. To handle QMake, I've leveraged the existing config-tool mechanism, which allows us to save a good deal of code, and use well tested code instead of rolling more of our own code. The one thing this doesn't do, but we probably should, is expose the macOS ExtraFrameworks directly, instead of forcing them to be found through QMake. That is a problem for another series, and someone who cares more about macOS than I do.
2021-03-22qt: move compilers_detect to the qt moduleDylan Baker1-2/+59
It's a method on the QtDependeny that exists purely for the consumption of the qt module (in the form, return some stuff the module makes into an instance variable). So put it where it actually belongs, and pass the qt dependency into it.
2021-03-19split program related classes and functions out of dependenciesDylan Baker1-1/+2
Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-10/+10
performed by running "pyupgrade --py36-plus" and committing the results
2021-02-07Add Qt6 moduleLuca Weiss1-2/+3
2020-11-04qt module: fix error message typo, translation qresource accepts qm not tsEli Schwartz1-1/+1
Fixes #7925