Diffusion Clazy 579779bd16dc

Initial check for invalid JNI method signatures

Authored by nicolasfella on Apr 24 2020, 9:32 AM.

Description

Initial check for invalid JNI method signatures

Summary:
When using QAndroidJniObject to call Android API one needs to specify method signatures using strings. This is error-prone and errors are usually only detected at runtime.
This check searches for a set of known methods that take such signatures and validates them using a regular expression. If a signature is invalid a warning is emitted.

To be able to verify Android-specific code with a desktop clang we need some include path hackery. QAndroidJniObject required jni.h, which is shipped in the Android NDK. We therefore need to amend the include paths. In order to do that we rely on $ANDROID_NDK being set and print an error if not.

Test Plan: Ran tests

Reviewers: smartins

Reviewed By: smartins

Differential Revision: https://phabricator.kde.org/D28887

Details

Committed
nicolasfellaApr 24 2020, 9:41 AM
Reviewer
smartins
Differential Revision
D28887: Initial check for invalid JNI method signatures
Parents
R74:19125399c11b: Merge branch '1.6'
Branches
Unknown
Tags
Unknown