www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What's the dub command to create a library to be published in dub.pm?

reply Adnan <relay.public.adnan outlook.com> writes:
In Rust they have $cargo new --lib

Even if dub doesn't have this, how can I change dub.json to build 
it as a library and not look for the main function?
Feb 23 2020
parent dnsmt <null dnsmt.nl> writes:
On Monday, 24 February 2020 at 06:02:00 UTC, Adnan wrote:
 how can I change dub.json to build it as a library and not look 
 for the main function?
The targetType setting determines how a project is build. It defaults to autodetect, which attempts to create an executable if there's a file at source/app.d. To create a library, either set the targetType setting to library explicitly, or make sure there are no files that trigger an application build. See the dub documentation for a complete list of files that trigger an application build on autodetect. https://dub.pm/package-format-json.html#configurations https://dub.pm/package-format-json.html#target-types
Feb 24 2020