Resolve sub packages of the root package directly instead of using the package manager. Fixes #287.
1 parent cc4c1c6 commit 76112bf5aabc591ceaa2cc0f7bae689fc72deb7d
@Sönke Ludwig Sönke Ludwig authored on 26 Mar 2014
Showing 3 changed files
View
2
■■■
source/dub/dub.d
logDiagnostic("Invalid package in dependency tree: %s %s", node.pack, node.config);
return null;
}
foreach (dname, dspec; pack.dependencies) {
auto dbasename = getBasePackage(dname);
auto dbasename = getBasePackageName(dname);
if (dspec.optional && !m_dub.packageManager.getFirstPackage(dname))
continue;
if (m_options & UpdateOptions.upgrade || !m_selectedVersions || !m_selectedVersions.hasSelectedVersion(dbasename))
ret ~= TreeNodes(dname, dspec.mapToPath(pack.path));
View
6
source/dub/packagemanager.d
 
// Additionally to the internally defined subpackages, whose metadata
// is loaded with the main package.json, load all externally defined
// packages after the package is available with all the data.
foreach ( sub_path; pack.exportedPackages ) {
foreach (sub_path; pack.exportedPackages) {
auto path = pack.path ~ sub_path;
if ( !existsFile(path) ) {
if (!existsFile(path)) {
logError("Package %s declared a sub-package, definition file is missing: %s", pack.name, path.toNativeString());
continue;
}
// Add the subpackage.
try {
dst_repos ~= new Package(path, pack);
} catch( Exception e ){
} catch (Exception e) {
logError("Package '%s': Failed to load sub-package in %s, error: %s", pack.name, path.toNativeString(), e.msg);
logDiagnostic("Full error: %s", e.toString().sanitize());
}
}
View
source/dub/project.d