diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-07-21 02:46:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-21 02:46:11 +0300 |
commit | 306fa07f62bd6d2833af80a654411740a4626dd7 (patch) | |
tree | f65d93cc77536f34687e1b1a94d33c986db745b6 /docs/markdown/Dlang-module.md | |
parent | f67630d26cf128cb1b659638918968a21955270e (diff) | |
parent | 0173b2457d9840ae63fff96aa30f387570e985cf (diff) | |
download | meson-306fa07f62bd6d2833af80a654411740a4626dd7.zip meson-306fa07f62bd6d2833af80a654411740a4626dd7.tar.gz meson-306fa07f62bd6d2833af80a654411740a4626dd7.tar.bz2 |
Merge pull request #3893 from FFY00/master
Add dlang module (dub support)
Diffstat (limited to 'docs/markdown/Dlang-module.md')
-rw-r--r-- | docs/markdown/Dlang-module.md | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/markdown/Dlang-module.md b/docs/markdown/Dlang-module.md new file mode 100644 index 0000000..ca9a381 --- /dev/null +++ b/docs/markdown/Dlang-module.md @@ -0,0 +1,43 @@ +# Dlang module + +This module provides tools related to the D programming language. + +## Usage + +To use this module, just do: **`dlang = import('dlang')`**. +You can, of course, replace the name `dlang` with anything else. + +The module only exposes one fucntion, `generate_dub_file`, used to +automatically generate Dub configuration files. + +### generate_dub_file() +This method only has two required arguments, the project name and the +source folder. You can pass other arguments with additional keywords, +they will be automatically translated to json and added to the +`dub.json` file. + +**Structure** +```meson +generate_dub_file("project name", "source/folder", key: "value" ...) +``` + +**Example** +```meson +dlang = import('dlang') +dlang.generate_dub_file(meson.project_name().to_lower(), meson.source_root(), + authors: 'Meson Team', + description: 'Test executable', + copyright: 'Copyright © 2018, Meson Team', + license: 'MIT', + sourceFiles: 'test.d', + targetType: 'executable', + dependencies: my_dep +) +``` + +You can manually edit a meson generated `dub.json` file or provide a +initial one. The module will only update the values specified in +`generate_dub_file()`. + +Although not required, you will need to have a `description` and +`license` if you want to publish the package in the [D package registry](https://code.dlang.org/).
\ No newline at end of file |