diff --git a/source/dub/commandline.d b/source/dub/commandline.d index 1e2cfab..81f1db3 100644 --- a/source/dub/commandline.d +++ b/source/dub/commandline.d @@ -603,6 +603,7 @@ BuildPlatform m_buildPlatform; BuildSettings m_buildSettings; string m_defaultConfig; + bool m_nodeps; bool m_allowNonLibraryConfigs = true; } @@ -626,6 +627,9 @@ args.getopt("d|debug", &m_debug_versions, [ "Define the specified debug version identifier when building - can be used multiple times" ]); + args.getopt("nodeps", &m_nodeps, [ + "Do not check/update dependencies before building" + ]); } protected void setupPackage(Dub dub, string package_name) @@ -643,6 +647,11 @@ if (environment.get("DFLAGS")) m_build_type = "$DFLAGS"; else m_build_type = "debug"; } + + if (!m_nodeps) { + logInfo("Checking dependencies in '%s'", dub.projectPath.toNativeString()); + dub.update(UpdateOptions.none); + } } private bool loadSpecificPackage(Dub dub, string package_name) @@ -688,7 +697,6 @@ bool m_run = false; bool m_force = false; bool m_print_platform, m_print_builds, m_print_configs; - bool m_nodeps; } this() @@ -720,9 +728,6 @@ args.getopt("print-platform", &m_print_platform, [ "Prints the identifiers for the current build platform as used for the build fields in package.json" ]); - args.getopt("nodeps", &m_nodeps, [ - "Do not check dependencies for 'run' or 'build'" - ]); } override int execute(Dub dub, string[] free_args, string[] app_args) @@ -862,11 +867,6 @@ setupPackage(dub, package_name); - //if (!m_nodeps) { - logInfo("Checking dependencies in '%s'", dub.projectPath.toNativeString()); - dub.update(UpdateOptions.none); - //} - logInfo("Running unit tests for package %s, configuration '%s'.", dub.project.mainPackage.name, m_build_config); dub.testProject(m_buildSettings, m_buildPlatform, m_build_config, Path(m_mainFile), app_args);