Closed aberba closed 6 months ago
You use it just like dub, or do you mean the library part?
I've added how to build, run and use its public API in the last commit:
dub run redub
dub run redub -- --help
dub
dub -b debug-release --compiler=ldc2
since this will also improve its speed on dependency resolutionThe usage of the library APIispretty straightforward. You get mainly 2 functions
resolveDependencies
which will parse the project and its dependencies, after that, you got all the project informationbuildProject
which will get the project information and build in parallelimport redub.api;
import redub.logging;
void main()
{
import std.file;
//Enables logging on redub
setLogLevel(LogLevel.verbose);
//Gets the project information
ProjectDetails d = resolveDependencies(
invalidateCache: false,
std.system.os,
CompilationDetails("dmd", "arch not yet implemented", "dmd v[2.105.0]"),
ProjectToParse("configuration", getcwd(), "subPackage", "path/to/dub/recipe.json (optional)")
);
/** Optionally, you can change some project information by accessing the details.tree (a ProjectNode), from there, you can freely modify the BuildRequirements of the project
* d.tree.requirements.cfg.outputDirectory = "some/path";
* d.tree.requirements.cfg.dFlags~= "-gc";
*/
//Execute the build process
buildProject(d);
}
The README does not show how to go about using this package