There doesn't seem to be any docs on how to actually create packages.
Is there a description anywhere?
Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
March 02, 2022 How do I create a package? | ||||
---|---|---|---|---|
| ||||
There doesn't seem to be any docs on how to actually create packages. Is there a description anywhere? |
March 02, 2022 Re: How do I create a package? | ||||
---|---|---|---|---|
| ||||
Posted in reply to M | On Wednesday, 2 March 2022 at 16:38:58 UTC, M wrote: >There doesn't seem to be any docs on how to actually create packages. Is there a description anywhere? https://dub.pm/getting_started.html is it, I think. It should get you started on creating a package, and then you have https://dub.pm/publish.html on how to register it. |
March 02, 2022 Re: How do I create a package? | ||||
---|---|---|---|---|
| ||||
Posted in reply to M | On Wednesday, 2 March 2022 at 16:38:58 UTC, M wrote: >There doesn't seem to be any docs on how to actually create packages. Is there a description anywhere? In case you're talking about a language-level package and not a dub package, just create a directory in your source tree with the name of your package, stick your source files in it and add a module statement to the top of each source file like so:
For subpackages, add subdirectories and throw those names into the module statement:
|
March 05, 2022 Re: How do I create a package? | ||||
---|---|---|---|---|
| ||||
Posted in reply to M | On Wednesday, 2 March 2022 at 16:38:58 UTC, M wrote: >There doesn't seem to be any docs on how to actually create packages. THE DOCS ARE INADEQUATE TO THE TASK. dub app-path .. dub build It says "module bcm2835 is in file bcm2835.d' which cannot be read." I want to make bcm2835.d common to a few projects. How do I do it? Is there something I can add to dub.json to tell it where to look? I tried to do import ../bcm2835; but that doesn't work either. What am I supposed to do? |
March 05, 2022 Re: How do I create a package? | ||||
---|---|---|---|---|
| ||||
Posted in reply to M | On Saturday, 5 March 2022 at 15:12:35 UTC, M wrote: >THE DOCS ARE INADEQUATE TO THE TASK. I've created a directory bcm2835. Then within source/bcm2835 I have bcm2835.d. I run dub build, and file called libbcm2835.a gets built. I type and it reports
So, some kind of success, presumably. So then, in the app I want to build, I type
but it says
So, dunno, any ideas? |
March 05, 2022 Re: How do I create a package? | ||||
---|---|---|---|---|
| ||||
Posted in reply to M | On 3/5/22 10:30 AM, M wrote: >On Saturday, 5 March 2022 at 15:12:35 UTC, M wrote: >THE DOCS ARE INADEQUATE TO THE TASK. I've created a directory bcm2835. Then within source/bcm2835 I have bcm2835.d. I run dub build, and file called libbcm2835.a gets built. I type and it reports Packages present in the system and known to dub: So, some kind of success, presumably. So then, in the app I want to build, I type dub add bcm2835 but it says Could not find package 'bcm2835'. So, dunno, any ideas?
You can I use this for private packages I'm not ready to publish. -Steve |
March 05, 2022 Re: How do I create a package? | ||||
---|---|---|---|---|
| ||||
Posted in reply to M | On Saturday, 5 March 2022 at 15:30:19 UTC, M wrote: >On Saturday, 5 March 2022 at 15:12:35 UTC, M wrote: >THE DOCS ARE INADEQUATE TO THE TASK. I've created a directory bcm2835. Then within source/bcm2835 I have bcm2835.d. I run dub build, and file called libbcm2835.a gets built. I type and it reports
So, some kind of success, presumably. So then, in the app I want to build, I type
but it says
So, dunno, any ideas? So I tried and I agree it's not intuitive. Once you've created a package
This you already did, presumably, or something to the same effect.
Then you can add it to your
|