From be92e3783751b8bf1481dc81635e86b70977698a Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Sat, 19 Jun 2021 01:50:15 -0500 Subject: Add Java module The Java module will serve as a source for easing Java development within Meson. Currently it only supports generating native header files. --- docs/markdown/Java-module.md | 15 +++++++++++++++ docs/markdown/snippets/java_module.md | 18 ++++++++++++++++++ docs/sitemap.txt | 1 + docs/theme/extra/templates/navbar_links.html | 1 + 4 files changed, 35 insertions(+) create mode 100644 docs/markdown/Java-module.md create mode 100644 docs/markdown/snippets/java_module.md (limited to 'docs') diff --git a/docs/markdown/Java-module.md b/docs/markdown/Java-module.md new file mode 100644 index 0000000..9857de7 --- /dev/null +++ b/docs/markdown/Java-module.md @@ -0,0 +1,15 @@ +# Java Module + +*Added 0.60.0* + +## Functions + +### `generate_native_header()` + +This function will generate a header file for use in Java native module +development by reading the supplied Java file for `native` method declarations. + +Keyword arguments: + +- `package`: The [package](https://en.wikipedia.org/wiki/Java_package) of the +file. If left empty, Meson will assume that there is no package. diff --git a/docs/markdown/snippets/java_module.md b/docs/markdown/snippets/java_module.md new file mode 100644 index 0000000..b806aee --- /dev/null +++ b/docs/markdown/snippets/java_module.md @@ -0,0 +1,18 @@ +## Java Module + +The Java module has been added to Meson. The Java module allows users to +generate native header files without needing to use a `custom_target()`. + +```meson +jmod = import('java') + +native_header = jmod.generate_native_header('File.java', package: 'com.mesonbuild') +native_header_includes = include_directories('.') + +jdkjava = shared_module( + 'jdkjava', + [native_header_includes, other_sources], + dependencies : [jdk], + include_directories : [native_header_includes] +) +``` diff --git a/docs/sitemap.txt b/docs/sitemap.txt index 573aed6..b659a1a 100644 --- a/docs/sitemap.txt +++ b/docs/sitemap.txt @@ -44,6 +44,7 @@ index.md Gnome-module.md Hotdoc-module.md Icestorm-module.md + Java-module.md Keyval-module.md Pkgconfig-module.md Python-3-module.md diff --git a/docs/theme/extra/templates/navbar_links.html b/docs/theme/extra/templates/navbar_links.html index 904a499..71d4bce 100644 --- a/docs/theme/extra/templates/navbar_links.html +++ b/docs/theme/extra/templates/navbar_links.html @@ -15,6 +15,7 @@ ("Hotdoc-module.html","Hotdoc"), \ ("i18n-module.html","i18n"), \ ("Icestorm-module.html","Icestorm"), \ + ("Java-module.html","Java") \ ("Keyval-module.html","Keyval"), \ ("Pkgconfig-module.html","Pkgconfig"), \ ("Python-3-module.html","Python 3"), \ -- cgit v1.1