Don't search the default source directories for sources for single-file packages.
Also disallows specifying source files or paths in the embedded package recipe.
1 parent 5ace394 commit d8d77c043fb1d6b6f5d31d7337a3e650e09128d7
@Sönke Ludwig Sönke Ludwig authored on 8 Jun 2016
Showing 1 changed file
View
5
source/dub/dub.d
auto recipe_filename = recipe_content[0 .. idx].strip();
recipe_content = recipe_content[idx+1 .. $];
 
auto recipe = parsePackageRecipe(recipe_content, recipe_filename);
enforce(recipe.buildSettings.sourceFiles.length == 0, "Single-file packages are not allowed to specify source files.");
enforce(recipe.buildSettings.sourcePaths.length == 0, "Single-file packages are not allowed to specify source paths.");
enforce(recipe.buildSettings.importPaths.length == 0, "Single-file packages are not allowed to specify import paths.");
recipe.buildSettings.sourceFiles[""] = [path.toNativeString()];
recipe.buildSettings.sourcePaths[""] = [];
recipe.buildSettings.importPaths[""] = [];
recipe.buildSettings.mainSourceFile = path.toNativeString();
if (recipe.buildSettings.targetType == TargetType.autodetect)
recipe.buildSettings.targetType = TargetType.executable;