10 Commits

Author SHA1 Message Date
Joerg Bornemann
eaf87cdfd8 CMake: Add targets for building Android docs from Java sources
One can now run "ninja android_docs" to generate HTML docs for Android
Java sources of Qt. This is done with javadoc.

One can now run "ninja android_source_jars" to generate source jars for
Android. They're supposed to be loaded into an IDE.

The targets are enabled automatically for Android builds.
For non-Android builds, set QT_BUILD_HOST_JAVA_DOCS=ON to create those
targets. In that case you must also set ANDROID_SDK_ROOT.

Fixes: QTBUG-117028
Change-Id: I2df51153359a95870c055d3ee373b8381f10cb51
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2025-06-02 19:18:04 +02:00
Assam Boudjelthia
51ccfc0b32 Android: enable javadoc lint checks
Enable all checks except 'missing' because we don't
want to get errors of missing docs for every variable
or method.

See docs of -Xdoclint at https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#extra-options

Change-Id: I7d7e775a1ef34dc1efacbc11cf85db99c81a4fe2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-11-25 15:47:32 +02:00
Assam Boudjelthia
edd29f7624 CMake:Android: pass absolute paths to add_jar()
This would make paths in warning/error messages absolute
also, being more clear which module it is from and another
benefit is it being clickable from various IDEs in case the
qt5 repo is opened as a project and not only single modules.

Change-Id: Ic95cea0005f0675186ad700e197e217dad016876
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-11-14 01:56:13 +02:00
Assam Boudjelthia
1cf03c974c Android: enable all warnings on javac
To help spot issues with Java code more often and more
easily.

Change-Id: I535378f1e128f168200696312a940edb1fb9fab2
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-10-30 02:45:45 +02:00
Assam Boudjelthia
9826e4e38b Android: report more warnings for Jar builds
this makes it more visible in the build when introduing
or having java code that for example might be doing
something wrong. deprecation option can't be added at this
 point since we compile the java code against the max
supported version and that will always print a lot of
deprecation warnings that are valid for the max version
but not valid for the min supported version.

Task-number: QTBUG-118077
Change-Id: I7d1e9c80d5208817a342cc1d79a28f233feeda0e
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-11-24 03:48:39 +02:00
Assam Boudjelthia
64fe6d836c Android: support lambda expressions in Java code
use -classpath instead of -bootclasspath param to allow
javac to use the default boot class path to support
building lambdas, pass the user Android class via -classpath.

Task-number: QTBUG-118077
Change-Id: I1ba8274d57e1bd528a1d5b7d779191e7f1412184
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-24 03:48:39 +02:00
Assam Boudjelthia
c76918eca2 CMake:Android: Add jar files to a ${target}JarSources
For better integrations with Qt Creator, add a custom target with
the Jar files so they are shown under the project files. Since
source_group() is not supported, add_custom_target() is used.

Pick-to: 6.6 6.5
Change-Id: Ie527fdce918d526ee6e8953e27d4e0f4131a9828
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-09-08 16:48:33 +00:00
Lucie Gérard
32df595275 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 23:58:42 +02:00
Lucie Gérard
fb1b20eab3 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-03 17:14:55 +02:00
Assam Boudjelthia
b9c85d6b0e CMake: build add flags for building QtAndroid.jar
Adds -source, -target, -Xlint:unchecked, -bootclasspath flags.

Setting default javac build source and target versions to 8.

Allow setting custom values for javac build versions via
-DQT_ANDROID_JAVAC_SOURCE, and -DQT_ANDROID_JAVAC_TARGET.

Task-number: QTBUG-86282
Change-Id: I98f4f193ac96016dc722d178594d7fd401202f68
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-16 20:55:16 +03:00