diff --git a/source/dub/compilers/dmd.d b/source/dub/compilers/dmd.d index b77ee4a..a181222 100644 --- a/source/dub/compilers/dmd.d +++ b/source/dub/compilers/dmd.d @@ -10,13 +10,13 @@ import dub.compilers.compiler; import dub.compilers.utils; import dub.internal.utils; +import dub.internal.vibecompat.core.file; import dub.internal.vibecompat.inet.path; import dub.internal.logging; import std.algorithm; import std.array; import std.exception; -import std.file; import std.typecons; // Determines whether the specified process is running under WOW64 or an Intel64 of x64 processor. @@ -365,7 +365,7 @@ auto res_file = getTempFile("dub-build", ".rsp"); const(string)[] args = settings.dflags; if (platform.frontendVersion >= 2066) args ~= "-vcolumns"; - std.file.write(res_file.toNativeString(), escapeArgs(args).join("\n")); + writeFile(res_file, escapeArgs(args).join("\n")); logDiagnostic("%s %s", platform.compilerBinary, escapeArgs(args).join(" ")); string[string] env; @@ -394,7 +394,7 @@ } auto res_file = getTempFile("dub-build", ".lnk"); - std.file.write(res_file.toNativeString(), escapeArgs(args).join("\n")); + writeFile(res_file, escapeArgs(args).join("\n")); logDiagnostic("%s %s", platform.compilerBinary, escapeArgs(args).join(" ")); string[string] env; diff --git a/source/dub/compilers/gdc.d b/source/dub/compilers/gdc.d index 422a513..9b42b33 100644 --- a/source/dub/compilers/gdc.d +++ b/source/dub/compilers/gdc.d @@ -10,13 +10,13 @@ import dub.compilers.compiler; import dub.compilers.utils; import dub.internal.utils; +import dub.internal.vibecompat.core.file; import dub.internal.vibecompat.inet.path; import dub.internal.logging; import std.algorithm; import std.array; import std.exception; -import std.file; import std.process; import std.typecons; @@ -208,7 +208,7 @@ void invoke(in BuildSettings settings, in BuildPlatform platform, void delegate(int, string) output_callback) { auto res_file = getTempFile("dub-build", ".rsp"); - std.file.write(res_file.toNativeString(), join(settings.dflags.map!(s => escape(s)), "\n")); + writeFile(res_file, join(settings.dflags.map!(s => escape(s)), "\n")); logDiagnostic("%s %s", platform.compilerBinary, join(cast(string[])settings.dflags, " ")); string[string] env; diff --git a/source/dub/compilers/ldc.d b/source/dub/compilers/ldc.d index 76c42e2..f071d7b 100644 --- a/source/dub/compilers/ldc.d +++ b/source/dub/compilers/ldc.d @@ -10,13 +10,13 @@ import dub.compilers.compiler; import dub.compilers.utils; import dub.internal.utils; +import dub.internal.vibecompat.core.file; import dub.internal.vibecompat.inet.path; import dub.internal.logging; import std.algorithm; import std.array; import std.exception; -import std.file; import std.typecons; @@ -250,7 +250,7 @@ auto res_file = getTempFile("dub-build", ".rsp"); const(string)[] args = settings.dflags; if (platform.frontendVersion >= 2066) args ~= "-vcolumns"; - std.file.write(res_file.toNativeString(), escapeArgs(args).join("\n")); + writeFile(res_file, escapeArgs(args).join("\n")); logDiagnostic("%s %s", platform.compilerBinary, escapeArgs(args).join(" ")); string[string] env; @@ -273,7 +273,7 @@ args ~= settings.dflags.filter!(f => isLinkerDFlag(f)).array; auto res_file = getTempFile("dub-build", ".lnk"); - std.file.write(res_file.toNativeString(), escapeArgs(args).join("\n")); + writeFile(res_file, escapeArgs(args).join("\n")); logDiagnostic("%s %s", platform.compilerBinary, escapeArgs(args).join(" ")); string[string] env; diff --git a/source/dub/package_.d b/source/dub/package_.d index c406925..010ee79 100644 --- a/source/dub/package_.d +++ b/source/dub/package_.d @@ -27,7 +27,6 @@ import std.array; import std.conv; import std.exception; -import std.file; import std.range; import std.string; import std.typecons : Nullable; diff --git a/source/dub/recipe/packagerecipe.d b/source/dub/recipe/packagerecipe.d index 74ef546..d282233 100644 --- a/source/dub/recipe/packagerecipe.d +++ b/source/dub/recipe/packagerecipe.d @@ -493,7 +493,7 @@ enforce(!spath.empty, "Paths must not be empty strings."); auto path = NativePath(spath); if (!path.absolute) path = base_path ~ path; - if (!existsFile(path) || !isDir(path.toNativeString())) { + if (!existsDirectory(path)) { import std.algorithm : any, find; const hasVar = chain(buildSettingsVars, envVarCache.get.byKey).any!((string var) { return spath.find("$"~var).length > 0 || spath.find("${"~var~"}").length > 0;