diff --git a/source/dub/package_.d b/source/dub/package_.d index 78fbc74..1abdbb4 100644 --- a/source/dub/package_.d +++ b/source/dub/package_.d @@ -45,7 +45,7 @@ } // Supported package descriptions in decreasing order of preference. -enum FilenameAndFormat[] packageInfoFiles = [ +static immutable FilenameAndFormat[] packageInfoFiles = [ {"dub.json", PackageFormat.json}, /*{"dub.sdl",PackageFormat.sdl},*/ {"package.json", PackageFormat.json} @@ -53,9 +53,8 @@ @property string[] packageInfoFilenames() { return packageInfoFiles.map!(f => f.filename).array; } -string defaultPackageFilename() { - return packageInfoFiles[0].filename; -} +@property string defaultPackageFilename() { return packageInfoFiles[0].filename; } + /** Represents a package, including its sub packages @@ -64,8 +63,6 @@ http://registry.vibed.org/package-format */ class Package { - static struct LocalPackageDef { string name; Version version_; Path path; } - private { Path m_path; PathAndFormat m_infoFile; @@ -140,13 +137,6 @@ m_path = root; m_path.endsWithSlash = true; - // check for default string import folders - foreach(defvf; ["views"]){ - auto p = m_path ~ defvf; - if( existsFile(p) ) - m_info.buildSettings.stringImportPaths[""] ~= defvf; - } - // use the given recipe as the basis m_info = recipe; @@ -154,6 +144,13 @@ // could overwrite what was determined here. Now the default paths // are always added. This must be fixed somehow! + // check for default string import folders + foreach(defvf; ["views"]){ + auto p = m_path ~ defvf; + if( existsFile(p) ) + m_info.buildSettings.stringImportPaths[""] ~= defvf; + } + // check for default source folders string app_main_file; auto pkg_name = recipe.name.length ? recipe.name : "unknown";