digitalmars.D.learn - How Add Local modules mymodule.d using DUB?
- Marcone (2/2) Aug 09 2021 My main program need import a local module called mymodule.d.
- Steven Schveighoffer (5/7) Aug 09 2021 You mean how to add a local project (that isn't on code.dlang.org)?
- Marcone (3/12) Aug 09 2021 I want add modules as phobos modules, but custom modules.
- Marcone (3/12) Aug 09 2021 Add module to linker.
- Bastiaan Veelo (6/8) Aug 09 2021 Let’s assume you just created a dub project in `myproject` with
My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you.
Aug 09 2021
On 8/9/21 12:32 PM, Marcone wrote:My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you.You mean how to add a local project (that isn't on code.dlang.org)? `dub add-local .` inside the project directory. I don't think you can add a file directly without a project, but possibly. -Steve
Aug 09 2021
On Monday, 9 August 2021 at 16:37:10 UTC, Steven Schveighoffer wrote:On 8/9/21 12:32 PM, Marcone wrote:I want add modules as phobos modules, but custom modules.My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you.You mean how to add a local project (that isn't on code.dlang.org)? `dub add-local .` inside the project directory. I don't think you can add a file directly without a project, but possibly. -Steve
Aug 09 2021
On Monday, 9 August 2021 at 16:37:10 UTC, Steven Schveighoffer wrote:On 8/9/21 12:32 PM, Marcone wrote:Add module to linker.My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you.You mean how to add a local project (that isn't on code.dlang.org)? `dub add-local .` inside the project directory. I don't think you can add a file directly without a project, but possibly. -Steve
Aug 09 2021
On Monday, 9 August 2021 at 16:32:13 UTC, Marcone wrote:My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you.Let’s assume you just created a dub project in `myproject` with `dub init`. Place `mymodule.d` alongside `app.d` in `myproject/source`. Now you can `import mymodule` in `app.d`. Dub takes care of the linking. — Bastiaan.
Aug 09 2021