October 15, 2016 Using dub.json parameters in code | ||||
---|---|---|---|---|
| ||||
Hi, I want to use the variables from dub.json. For example, use the parameter "name" to display information message. Now I read dub.json. Is there a way to import them? Please excuse any mistakes as English is my second language. |
October 15, 2016 Re: Using dub.json parameters in code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gustav | On Saturday, 15 October 2016 at 17:36:10 UTC, Gustav wrote:
> Hi,
>
> I want to use the variables from dub.json. For example, use the parameter "name" to display information message. Now I read dub.json. Is there a way to import them?
>
> Please excuse any mistakes as English is my second language.
I don't know wether there's a dub specific API but you could use string imports for that:
auto dubFile = import("dub.json");
// then parse it with your favourite json lib
You have to use the -J flag for dmd to know where to find dub.json though.
|
Copyright © 1999-2021 by the D Language Foundation