Note: It is not possible to make subpackage inside subpackage.
To make a subpackage with dub; follow these general guidelines.
General guidelines
- Create a new folder.
- Open the folder.
- Initialise a new package. (
dub init
) - Open
dub.json
file- Append this:
"subPackages": [ "./component1/" ]
- Append this:
- Create a new inner folder named
component1
- Initialise a new package inside the inner folder (
dub init
) - Open the previous package folder.
- Run the subpackage as a test. (
dub run :component1
)
This is how it is made in Windows 10:
(I use Windows 10, please excuse for not giving Linux directions.)
mkdir "NewPackage"
cd "./NewPackage"
dub init
notepad dub.json
"subPackages": [
"./component1/"
]
> mkdir "component1"
cd "./component1"
dub init
cd "../"
dub run :component1
More information can be found: https://dub.pm/package-format-json#sub-packages
For SDL Package File Format: https://dub.pm/package-format-sdl#sub-packages