dub can build library for dependencies

Andre Pany andre at s-e-a-p.de
Thu Jul 30 20:24:23 UTC 2020


On Thursday, 30 July 2020 at 18:50:54 UTC, zoujiaqing wrote:
> Java can use gradle manager depends on compiled *.jar to Maven 
> server.

In dub the same thing is already possible like it is done for 
Python Wheels
or Node packages.

Have a look at this python wheel:
https://files.pythonhosted.org/packages/5e/89/fa556c4f9ac56d466e229dceaa5cbc3993308c5c9574f739964f853415bb/FMPy-0.2.21-py2.py3-none-any.whl

Rename the extension to zip and extract it.
It contains the *.so files for linux / *.dylib for macos / *.dll 
for windows.
The python code makes use of the functionality using wrapper code.

You could just create a new dub package, copy the 
*.so/*.dll/*.dylib files into
it, write the wrapper code in D and upload it to dub registry.

This is almost your scenario except the dynamic libraries are 
written in C and
in your case in D.

(Java is a different thing, as the jar files contains byte 
code...)

Kind regards
André


More information about the Digitalmars-d mailing list