diff --git a/source/dub/dub.d b/source/dub/dub.d index c80e7cb..bdd59bb 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -557,11 +557,12 @@ auto sver = m_project.selections.getSelectedVersion(basename); if (!sver.path.empty || !sver.repository.empty) continue; if (ver.version_ <= sver.version_) continue; - logInfo("Package %s would be upgraded from %s to %s.", - basename, sver, ver); + logInfo("Upgrade", Color.yellow, + "%s would be upgraded %s to %s.", + basename.color(Mode.bold), sver, ver); any = true; } - if (any) logInfo("Use \"dub upgrade\" to perform those changes."); + if (any) logInfo("Use \"dub upgrade\" to perform those changes"); return; } @@ -727,7 +728,7 @@ /// Cleans intermediate/cache files of the given package void cleanPackage(NativePath path) { - logInfo("Cleaning package at %s...", path.toNativeString()); + logInfo("Cleaning", Color.green, "package at %s", path.toNativeString()); enforce(!Package.findPackageFile(path).empty, "No package found.", path.toNativeString()); // TODO: clear target files and copy files @@ -798,8 +799,8 @@ } } - if (reason.length) logInfo("Fetching %s %s (%s)...", packageId, ver, reason); - else logInfo("Fetching %s %s...", packageId, ver); + if (reason.length) logInfo("Fetching", Color.yellow, "%s %s (%s)", packageId, ver, reason); + else logInfo("Fetching", Color.yellow, "%s %s", packageId, ver); if (m_dryRun) return null; logDebug("Acquiring package zip file"); diff --git a/source/dub/generators/build.d b/source/dub/generators/build.d index d9f9113..b7f0bb1 100644 --- a/source/dub/generators/build.d +++ b/source/dub/generators/build.d @@ -82,8 +82,10 @@ enforce(!(settings.rdmd && root_ti.buildSettings.targetType == TargetType.none), "Building package with target type \"none\" with rdmd is not supported yet."); - logInfo("Performing \"%s\" build using %s for %-(%s, %).", - settings.buildType, settings.platform.compilerBinary, settings.platform.architecture); + logInfo("Starting", Color.green, + "Performing \"%s\" build using %s for %-(%s, %).", + settings.buildType.color(Color.magenta), settings.platform.compilerBinary, + settings.platform.architecture); bool any_cached = false; @@ -152,7 +154,9 @@ buildTargetRec(m_project.rootPackage.name); if (any_cached) { - logInfo("To force a rebuild of up-to-date targets, run again with --force."); + logInfo("Finished", Color.green, + "To force a rebuild of up-to-date targets, run again with --force" + ); } } } @@ -203,7 +207,7 @@ // run post-build commands if (!cached && buildsettings.postBuildCommands.length) { - logInfo("Running post-build commands..."); + logInfo("Post-build", Color.green, "Running commands"); runBuildCommands(CommandType.postBuild, buildsettings.postBuildCommands, pack, m_project, settings, buildsettings, [["DUB_BUILD_PATH" : target_path.parentPath.toNativeString.absolutePath]]); } @@ -224,7 +228,7 @@ else target_path = pack.path ~ format(".dub/build/%s/", build_id); if (!settings.force && isUpToDate(target_path, buildsettings, settings, pack, packages, additional_dep_files)) { - logInfo("%s %s: target for configuration \"%s\" is up to date.", pack.name, pack.version_, config); + logInfo("Up-to-date", Color.green, "%s %s [%s]", pack.name.color(Mode.bold), pack.version_, config); logDiagnostic("Using existing build in %s.", target_path.toNativeString()); target_binary_path = target_path ~ settings.compiler.getTargetFileName(buildsettings, settings.platform); if (!settings.tempBuild) @@ -239,10 +243,10 @@ return false; } - logInfo("%s %s: building configuration \"%s\"...", pack.name, pack.version_, config); + logInfo("Building", Color.green, "%s %s [%s]", pack.name.color(Mode.bold), pack.version_, config.color(Color.blue)); if( buildsettings.preBuildCommands.length ){ - logInfo("Running pre-build commands..."); + logInfo("Pre-build", Color.green, "Running commands"); runBuildCommands(CommandType.preBuild, buildsettings.preBuildCommands, pack, m_project, settings, buildsettings); } @@ -304,11 +308,11 @@ flags ~= mainsrc.relativeTo(cwd).toNativeString(); if (buildsettings.preBuildCommands.length){ - logInfo("Running pre-build commands..."); + logInfo("Pre-build", Color.green, "Running commands"); runCommands(buildsettings.preBuildCommands); } - logInfo("%s %s: building configuration \"%s\"...", pack.name, pack.version_, config); + logInfo("Building", Color.green, "%s %s [%s]", pack.name.color(Mode.bold), pack.version_, config.color(Color.blue)); logInfo("Running rdmd..."); logDiagnostic("rdmd %s", join(flags, " ")); @@ -335,7 +339,7 @@ f = fp.toNativeString(); } - logInfo("%s %s: building configuration \"%s\"...", pack.name, pack.version_, config); + logInfo("Building", Color.green, "%s %s [%s]", pack.name.color(Mode.bold), pack.version_, config.color(Color.blue)); // make all target/import paths relative string makeRelative(string path) { @@ -362,7 +366,7 @@ } if( buildsettings.preBuildCommands.length ){ - logInfo("Running pre-build commands..."); + logInfo("Pre-build", Color.green, "Running commands"); runBuildCommands(CommandType.preBuild, buildsettings.preBuildCommands, pack, m_project, settings, buildsettings); } @@ -525,7 +529,7 @@ auto objs = new string[](srcs.walkLength); void compileSource(size_t i, string src) { - logInfo("Compiling %s...", src); + logInfo("Compiling", Color.green, "%s", src); const objPath = pathToObjName(settings.platform, src); objs[i] = compileUnit(src, objPath, buildsettings, settings); } @@ -536,7 +540,7 @@ foreach (i, src; srcs.array) compileSource(i, src); } - logInfo("Linking..."); + logInfo("Linking", Color.green, "%s", buildsettings.targetName.color(Mode.bold)); lbuildsettings.sourceFiles = is_static_library ? [] : lbuildsettings.sourceFiles.filter!(f => isLinkerFile(settings.platform, f)).array; settings.compiler.setTarget(lbuildsettings, settings.platform); settings.compiler.prepareBuildSettings(lbuildsettings, settings.platform, BuildSetting.commandLineSeparate|BuildSetting.sourceFiles); @@ -575,7 +579,7 @@ settings.compiler.invoke(buildsettings, settings.platform, settings.compileCallback); if (generate_binary) { - logInfo("Linking..."); + logInfo("Linking", Color.green, "%s", buildsettings.targetName.color(Mode.bold)); settings.compiler.invokeLinker(lbuildsettings, settings.platform, [tempobj.toNativeString()], settings.linkCallback); } } @@ -592,7 +596,7 @@ } if (!exe_file_path.absolute) exe_file_path = cwd ~ exe_file_path; runPreRunCommands(m_project.rootPackage, m_project, settings, buildsettings); - logInfo("Running %s %s", exe_file_path.relativeTo(runcwd), run_args.join(" ")); + logInfo("Running", Color.green, "%s %s", exe_file_path.relativeTo(runcwd), run_args.join(" ")); string[string] env; foreach (aa; [buildsettings.environments, buildsettings.runEnvironments]) foreach (k, v; aa)