diff --git a/source/dub/compilers/buildsettings.d b/source/dub/compilers/buildsettings.d index cfc39c4..27fc596 100644 --- a/source/dub/compilers/buildsettings.d +++ b/source/dub/compilers/buildsettings.d @@ -164,9 +164,9 @@ static void addSI(ref string[] arr, in string[] vals) { bool[string] existing; - foreach (v; arr) existing[NativePath(v).head.toString()] = true; + foreach (v; arr) existing[NativePath(v).head.name] = true; foreach (v; vals) { - auto s = NativePath(v).head.toString(); + auto s = NativePath(v).head.name; if (s !in existing) { existing[s] = true; arr ~= v; diff --git a/source/dub/dub.d b/source/dub/dub.d index e1406c8..5cbe3af 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -677,14 +677,14 @@ import std.path; tcinfo.sourceFiles[""] ~= custom_main_file.relativeTo(m_project.rootPackage.path).toNativeString(); tcinfo.importPaths[""] ~= custom_main_file.parentPath.toNativeString(); - custommodname = custom_main_file.head.toString().baseName(".d"); + custommodname = custom_main_file.head.name.baseName(".d"); } // prepare the list of tested modules string[] import_modules; foreach (file; lbuildsettings.sourceFiles) { if (file.endsWith(".d")) { - auto fname = NativePath(file).head.toString(); + auto fname = NativePath(file).head.name; if (NativePath(file).relativeTo(m_project.rootPackage.path) == NativePath(mainfil)) { logWarn("Excluding main source file %s from test.", mainfil); tcinfo.excludedSourceFiles[""] ~= mainfil; @@ -1300,7 +1300,7 @@ } auto srcfile = m_project.rootPackage.recipePath; - auto srcext = srcfile.head.toString().extension; + auto srcext = srcfile.head.name.extension; if (srcext == "."~destination_file_ext) { logInfo("Package format is already %s.", destination_file_ext); return; diff --git a/source/dub/generators/visuald.d b/source/dub/generators/visuald.d index 13ab9a3..9f9691a 100644 --- a/source/dub/generators/visuald.d +++ b/source/dub/generators/visuald.d @@ -217,7 +217,7 @@ foreach(unused; 0..decrease) ret.put("\n "); foreach(idx; 0..increase) - ret.formattedWrite("\n ", cur[same + idx].toString()); + ret.formattedWrite("\n ", cur[same + idx].name); lastFolder = cur; } ret.formattedWrite("\n ", source.build ? "" : "tool=\"None\" ", source.filePath.toNativeString()); diff --git a/source/dub/init.d b/source/dub/init.d index da068fc..d29b679 100644 --- a/source/dub/init.d +++ b/source/dub/init.d @@ -53,7 +53,7 @@ string username = getUserName(); PackageRecipe p; - p.name = root_path.head.toString().toLower(); + p.name = root_path.head.name.toLower(); p.authors ~= username; p.license = "proprietary"; foreach (pack, v; deps) { diff --git a/source/dub/internal/utils.d b/source/dub/internal/utils.d index 043812d..7139a39 100644 --- a/source/dub/internal/utils.d +++ b/source/dub/internal/utils.d @@ -148,7 +148,7 @@ foreach (ArchiveMember am; archive.directory) { auto path = NativePath(am.name).bySegment.array; foreach (fil; packageInfoFiles) { - if ((path.length == 1 && path[0] == fil.filename) || (path.length == 2 && path[$-1].toString == fil.filename)) { + if ((path.length == 1 && path[0] == fil.filename) || (path.length == 2 && path[$-1].name == fil.filename)) { fileName = fil.filename; return stripUTF8Bom(cast(string) archive.expand(archive.directory[am.name])); } @@ -612,7 +612,7 @@ //create module name from path foreach (i; 0 .. mpath.length) { import std.path; - auto p = mpath[i].toString(); + auto p = mpath[i].name; if (p == "package.d") break; if (i > 0) ret ~= "."; if (i+1 < mpath.length) ret ~= p; diff --git a/source/dub/packagemanager.d b/source/dub/packagemanager.d index 08a02d0..c06da9c 100644 --- a/source/dub/packagemanager.d +++ b/source/dub/packagemanager.d @@ -387,7 +387,7 @@ outer: foreach(ArchiveMember am; archive.directory) { auto path = NativePath(am.name).bySegment.array; foreach (fil; packageInfoFiles) - if (path.length == 2 && path[$-1].toString == fil.filename) { + if (path.length == 2 && path[$-1].name == fil.filename) { zip_prefix = path[0 .. $-1]; break outer; } @@ -696,12 +696,12 @@ string[] ignored_files = []; SHA1 sha1; foreach(file; dirEntries(pack.path.toNativeString(), SpanMode.depth)) { - if(file.isDir && ignored_directories.canFind(NativePath(file.name).head.toString())) + if(file.isDir && ignored_directories.canFind(NativePath(file.name).head.name)) continue; - else if(ignored_files.canFind(NativePath(file.name).head.toString())) + else if(ignored_files.canFind(NativePath(file.name).head.name)) continue; - sha1.put(cast(ubyte[])NativePath(file.name).head.toString()); + sha1.put(cast(ubyte[])NativePath(file.name).head.name); if(file.isDir) { logDebug("Hashed directory name %s", NativePath(file.name).head); } diff --git a/source/dub/packagesuppliers/filesystem.d b/source/dub/packagesuppliers/filesystem.d index 61b125c..e271510 100644 --- a/source/dub/packagesuppliers/filesystem.d +++ b/source/dub/packagesuppliers/filesystem.d @@ -30,7 +30,7 @@ NativePath p = NativePath(d.name); logDebug("Entry: %s", p); enforce(to!string(p.head)[$-4..$] == ".zip"); - auto vers = p.head.toString()[package_id.length+1..$-4]; + auto vers = p.head.name[package_id.length+1..$-4]; logDebug("Version: %s", vers); ret ~= Version(vers); } diff --git a/source/dub/project.d b/source/dub/project.d index 8a807a9..61a8dd5 100644 --- a/source/dub/project.d +++ b/source/dub/project.d @@ -239,7 +239,7 @@ string ret; ret ~= `Please modify the "name" field in %s accordingly.`.format(m_rootPackage.recipePath.toNativeString()); if (!m_rootPackage.recipe.buildSettings.targetName.length) { - if (m_rootPackage.recipePath.head.toString().endsWith(".sdl")) { + if (m_rootPackage.recipePath.head.name.endsWith(".sdl")) { ret ~= ` You can then add 'targetName "%s"' to keep the current executable name.`.format(m_rootPackage.name); } else { ret ~= ` You can then add '"targetName": "%s"' to keep the current executable name.`.format(m_rootPackage.name); @@ -1430,7 +1430,7 @@ import std.path : dirSeparator; - static Path woSlash(Path p) { p.endsWithSlash = false; return p; } + static NativePath woSlash(NativePath p) { p.endsWithSlash = false; return p; } // basic vars assert(processVars("Hello $PACKAGE_DIR", proj, pack, gsettings, !isPath) == "Hello "~woSlash(pack.path).toNativeString); assert(processVars("Hello $ROOT_PACKAGE_DIR", proj, pack, gsettings, !isPath) == "Hello "~woSlash(proj.rootPackage.path).toNativeString.chomp(dirSeparator));