Skip to content

Commit

Permalink
Remove all trailing whitespace
Browse files Browse the repository at this point in the history
> sed 's/[ \t]*$//' -i **/*.d
  • Loading branch information
wilzbach committed Feb 23, 2017
1 parent 3d559a0 commit 3818543
Show file tree
Hide file tree
Showing 34 changed files with 384 additions and 384 deletions.
2 changes: 1 addition & 1 deletion source/dub/description.d
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct ProjectDescription {
PackageDescription[] packages; /// All packages in the dependency tree
TargetDescription[] targets; /// Build targets
@ignore size_t[string] targetLookup; /// Target index by package name name

/// Targets by name
ref inout(TargetDescription) lookupTarget(string name) inout
{
Expand Down
6 changes: 3 additions & 3 deletions source/dub/dub.d
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Dub {
loading a package.
This constructor corresponds to the "--bare" option of the command line
interface. Use
interface. Use
*/
this(Path override_path)
{
Expand Down Expand Up @@ -243,7 +243,7 @@ class Dub {
Single-file packages are D files that contain a package receipe comment
at their top. A recipe comment must be a nested `/+ ... +/` style
comment, containing the virtual recipe file name and a colon, followed by the
comment, containing the virtual recipe file name and a colon, followed by the
recipe contents (what would normally be in dub.sdl/dub.json).
Example:
Expand Down Expand Up @@ -736,7 +736,7 @@ class Dub {
logInfo("Removing %s in %s", pack.name, pack.path.toNativeString());
if (!m_dryRun) m_packageManager.remove(pack);
}

/// Compatibility overload. Use the version without a `force_remove` argument instead.
void remove(in Package pack, bool force_remove)
{
Expand Down
38 changes: 19 additions & 19 deletions source/dub/generators/cmake.d
Original file line number Diff line number Diff line change
Expand Up @@ -26,71 +26,71 @@ class CMakeGenerator: ProjectGenerator
{
super(project);
}

override void generateTargets(GeneratorSettings settings, in TargetInfo[string] targets)
{
auto script = appender!(char[]);
auto scripts = appender!(string[]);
bool[string] visited;
Path projectRoot = m_project.rootPackage.path;
Path cmakeListsPath = projectRoot ~ "CMakeLists.txt";

foreach(name, info; targets)
{
if(visited.get(name, false))
continue;

visited[name] = true;
name = name.sanitize;
string targetType;
string libType;
bool addTarget = true;

switch(info.buildSettings.targetType) with(TargetType)
{
case autodetect:
throw new Exception("Don't know what to do about autodetect target type");
case executable:
targetType = "executable";

break;
case dynamicLibrary:
libType = "SHARED";

goto case;
case library:
case staticLibrary:
targetType = "library";

break;
case sourceLibrary:
addTarget = false;

break;
case none:
continue;
default:
assert(false);
}

script.put("include(UseD)\n");
script.put(
"add_d_conditions(VERSION %s DEBUG %s)\n".format(
info.buildSettings.versions.dup.join(" "),
info.buildSettings.debugVersions.dup.join(" "),
)
);

foreach(directory; info.buildSettings.importPaths)
script.put("include_directories(%s)\n".format(directory.sanitizeSlashes));

if(addTarget)
{
script.put("add_%s(%s %s\n".format(targetType, name, libType));

foreach(file; info.buildSettings.sourceFiles)
script.put(" %s\n".format(file.sanitizeSlashes));

script.put(")\n");
script.put(
"target_link_libraries(%s %s %s)\n".format(
Expand All @@ -106,29 +106,29 @@ class CMakeGenerator: ProjectGenerator
) ~ "\n"
);
}

string filename = (projectRoot ~ "%s.cmake".format(name)).toNativeString;
File file = File(filename, "w");

file.write(script.data);
file.close;
script.shrinkTo(0);
scripts.put(filename);
}

if(!cmakeListsPath.existsFile)
{
logWarn("You must use a fork of CMake which has D support for these scripts to function properly.");
logWarn("It is available at https://github.com/trentforkert/cmake");
logInfo("Generating default CMakeLists.txt");
script.put("cmake_minimum_required(VERSION 3.0)\n");
script.put("project(%s D)\n".format(m_project.rootPackage.name));

foreach(path; scripts.data)
script.put("include(%s)\n".format(path));

File file = File(cmakeListsPath.toNativeString, "w");

file.write(script.data);
file.close;
}
Expand Down
4 changes: 2 additions & 2 deletions source/dub/generators/generator.d
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ private void finalizeGeneration(in Package pack, in Project proj, in GeneratorSe
in BuildSettings buildsettings, Path target_path, bool generate_binary)
{
import std.path : globMatch;

if (buildsettings.postGenerateCommands.length && !isRecursiveInvocation(pack.name)) {
logInfo("Running post-generate commands for %s...", pack.name);
runBuildCommands(buildsettings.postGenerateCommands, pack, proj, settings, buildsettings);
Expand Down Expand Up @@ -513,7 +513,7 @@ void runBuildCommands(in string[] commands, in Package pack, in Project proj,
env["DUB_PARALLEL_BUILD"] = settings.parallelBuild? "TRUE" : "";

env["DUB_RUN_ARGS"] = (cast(string[])settings.runArgs).map!(escapeShellFileName).join(" ");

auto depNames = proj.dependencies.map!((a) => a.name).array();
storeRecursiveInvokations(env, proj.rootPackage.name ~ depNames);
runCommands(commands, env);
Expand Down
4 changes: 2 additions & 2 deletions source/dub/generators/sublimetext.d
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class SublimeTextGenerator : ProjectGenerator {
{
auto buildSettings = targets[m_project.name].buildSettings;
logDebug("About to generate sublime project for %s.", m_project.rootPackage.name);

auto root = Json([
"folders": targets.byValue.map!(f => targetFolderJson(f)).array.Json,
"build_systems": buildSystems(settings.platform),
Expand Down Expand Up @@ -100,7 +100,7 @@ private Json buildSystems(BuildPlatform buildPlatform, string workingDiretory =
"variants": [
[
"name": "Run".Json,
"cmd": ["dub", "run", "--build=" ~ buildType, "--arch=" ~ arch, "--compiler="~buildPlatform.compilerBinary].map!Json.array.Json,
"cmd": ["dub", "run", "--build=" ~ buildType, "--arch=" ~ arch, "--compiler="~buildPlatform.compilerBinary].map!Json.array.Json,
].Json
].array.Json,
]);
Expand Down
26 changes: 13 additions & 13 deletions source/dub/internal/libInputVisitor.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://www.wtfpl.net/ for more details.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
+/
Expand Down Expand Up @@ -50,7 +50,7 @@ class InputVisitor(Obj, Elem) : Fiber
{
obj.visit(this);
}

private void ensureStarted()
{
if(!started)
Expand All @@ -59,27 +59,27 @@ class InputVisitor(Obj, Elem) : Fiber
started = true;
}
}

// Member 'front' must be a function due to DMD Issue #5403
private Elem _front;
@property Elem front()
{
ensureStarted();
return _front;
}

void popFront()
{
ensureStarted();
call();
}

@property bool empty()
{
ensureStarted();
return state == Fiber.State.TERM;
}

void yield(Elem elem)
{
_front = elem;
Expand Down
Loading

0 comments on commit 3818543

Please sign in to comment.