Project deployment
Rikki Cattermole
alphaglosined at gmail.com
Sat Mar 1 03:53:21 PST 2014
On Saturday, 1 March 2014 at 10:18:09 UTC, Uranuz wrote:
> It's not look like question about D, but because I developing
> some web site on D I asking this question there. The question
> is about how to organize automative deployment process which
> include building executables, shared libraries, running
> unittests etc. Then I need it to place these builded files,
> resources (like html-templates, images, style sheets and other
> documents) in directories from which application will run. Also
> creation of documentation for libraries, aplications is needed.
>
> I have no experience in deployment process so I'll be thankful
> any advices how to start. It could be links for some articles,
> tools that helps to solve this problem.
>
> What is about *dub*? What kind of programme is it. Is it tool
> for only building application but not deploying? If no where I
> could read about these features (may be some examples exist)
If your utilising e.g. Vibe-d or templ-d for templating then
templates will be compiled into the application. The raw source
files are not required at runtime.
It would be possible for the same thing for e.g. css files.
However this is a little bit more difficult.
Dub is a build manager for D. Its responsibility is to compile
the executable. In other words, make it ready for deployment. It
may not create e.g. .deb files but it will provide you with your
executable and resources should you configure it so. Although
copying directories is a little intensive with raw cli commands
to do so.
Dub can handle creation of documentation in the form of html
files, as does dmd itself. Its just a switch you need to use.
However you do need to adhere to ddoc for this.
The alternative to using the import("file") syntax to load a file
at compile time (do note you need to add a string import path to
the compiler i.e. -J.) is to use e.g. a binary file to D file
converter [0]. Which would allow you to compile in all your
resources.
Please note however, because of the differences in e.g. Linux
distributions you will be required to compile for the target
especially. So e.g. in a VM.
[0] https://github.com/rikkimax/Bin2D
More information about the Digitalmars-d-learn
mailing list