@@ -534,7 +534,7 @@ struct CommonOptions {
534
534
bool verbose, vverbose, quiet, vquiet, verror, version_;
535
535
bool help, annotate, bare;
536
536
string [] registry_urls;
537
- string root_path;
537
+ string root_path, recipeFile ;
538
538
enum Color { automatic, on, off }
539
539
Color colorMode = Color.automatic;
540
540
SkipPackageSuppliers skipRegistry = SkipPackageSuppliers.none;
@@ -568,6 +568,7 @@ struct CommonOptions {
568
568
{
569
569
args.getopt(" h|help" , &help, [" Display general or command specific help" ]);
570
570
args.getopt(" root" , &root_path, [" Path to operate in instead of the current working dir" ]);
571
+ args.getopt(" recipe" , &recipeFile, [" Make dub use custom path as its recipe file" ]);
571
572
args.getopt(" registry" , ®istry_urls, [
572
573
" Search the given registry URL first when resolving dependencies. Can be specified multiple times. Available registry types:" ,
573
574
" DUB: URL to DUB registry (default)" ,
@@ -812,7 +813,7 @@ class Command {
812
813
Dub dub;
813
814
814
815
if (options.bare) {
815
- dub = new Dub(NativePath(options.root_path), getWorkingDirectory());
816
+ dub = new Dub(NativePath(options.root_path), getWorkingDirectory(), NativePath(options.recipeFile) );
816
817
dub.defaultPlacementLocation = options.placementLocation;
817
818
818
819
return dub;
@@ -839,7 +840,7 @@ class Command {
839
840
840
841
// make the CWD package available so that for example sub packages can reference their
841
842
// parent package.
842
- try dub.packageManager.getOrLoadPackage(NativePath(options.root_path), NativePath.init , false , StrictMode.Warn);
843
+ try dub.packageManager.getOrLoadPackage(NativePath(options.root_path), NativePath(options.recipeFile) , false , StrictMode.Warn);
843
844
catch (Exception e) { logDiagnostic(" No valid package found in current working directory: %s" , e.msg); }
844
845
845
846
return dub;
@@ -1168,6 +1169,7 @@ abstract class PackageBuildCommand : Command {
1168
1169
return true ;
1169
1170
}
1170
1171
1172
+
1171
1173
bool from_cwd = package_name.length == 0 || package_name.startsWith(" :" );
1172
1174
// load package in root_path to enable searching for sub packages
1173
1175
if (loadCwdPackage(dub, from_cwd)) {
@@ -2430,7 +2432,7 @@ class DustmiteCommand : PackageBuildCommand {
2430
2432
{
2431
2433
if (! m_testPackage.length)
2432
2434
return super .prepareDub(options);
2433
- return new Dub(NativePath(options.root_path), getWorkingDirectory());
2435
+ return new Dub(NativePath(options.root_path), getWorkingDirectory(), NativePath(options.recipeFile) );
2434
2436
}
2435
2437
2436
2438
override int execute (Dub dub, string [] free_args, string [] app_args)
0 commit comments